-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ben Admin Kit #18
Merged
Merged
Ben Admin Kit #18
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
6596b36
add ben admin scaffold
bryanbierce ea3e2a7
update data models
bryanbierce ccf692e
update models. bump version
bryanbierce 5ce3da4
update comment
bryanbierce 7a469ca
add deductions app config;
bryanbierce 5b74a8a
update naming
bryanbierce f98af7c
update name
bryanbierce 3362011
fix type
bryanbierce db1c925
update employee data
bryanbierce 583539f
update group_number
bryanbierce 388c4c1
add company_id
bryanbierce 9bc1c9b
add id at top level
bryanbierce 679d608
update name
bryanbierce 4a487ae
Revert "update dep"
bryanbierce d8e679b
update name
bryanbierce dffecf1
add place holder for deductions
bryanbierce 2252eec
add comp values
bryanbierce 11ef9a0
Update BUILD
bryanbierce b02f681
Update data_models.py
bryanbierce 91248f0
Update BUILD
bryanbierce f74bd7d
Add Ben Admin deduction data models (#36)
sravyavalipe 7249db4
update data models
bryanbierce 5894a83
reset poetry
bryanbierce 1cdb40f
lint
bryanbierce f0657d6
bump version
bryanbierce 3580ff3
lint
bryanbierce b982548
lint
bryanbierce 2a7489b
lint
bryanbierce 8bb6d05
lint
bryanbierce b0d41a0
try again
bryanbierce 28e45e0
dont change version
bryanbierce 600648b
remove options for long hand union. ¯\_(ツ)_/¯
bryanbierce b8db335
change capability name
bryanbierce 3f7e790
update types
bryanbierce a6bc315
remove get_file_name
bryanbierce f61d5d3
move types to core
bryanbierce 423a348
import format
bryanbierce 4a4b29d
update field name casing. fix doc strings
bryanbierce 090230b
import order again
bryanbierce 40e2abb
add types to core
bryanbierce 0fd6d99
fix import sort
bryanbierce 16887cd
fix rebase
bryanbierce da100d9
field casing
bryanbierce File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Empty file.
1 change: 1 addition & 0 deletions
1
flux_sdk/benefits_administration/capabilities/process_employees_deductions/BUILD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
python_sources() |
Empty file.
23 changes: 23 additions & 0 deletions
23
flux_sdk/benefits_administration/capabilities/process_employees_deductions/data_models.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from datetime import datetime | ||
from decimal import Decimal | ||
from enum import Enum | ||
|
||
|
||
class DeductionDetails: | ||
company_id: str | ||
employee_id: str | ||
deduction_code: str | ||
effective_from: datetime | ||
end_date: datetime | None | ||
employee_contribution: Decimal | None | ||
company_contribution: Decimal | None | ||
|
||
class DeductionCodeField(Enum): | ||
EMPLOYEE_CONTRIBUTION = "EMPLOYEE_CONTRIBUTION" | ||
COMPANY_CONTRIBUTION = "COMPANY_CONTRIBUTION" | ||
|
||
class ExternalDeductionCodeToRipplingCode: | ||
external_code: str | ||
rippling_code: str | ||
rippling_deduction_field: DeductionCodeField | ||
|
29 changes: 29 additions & 0 deletions
29
flux_sdk/benefits_administration/capabilities/process_employees_deductions/interface.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from abc import ABC, abstractmethod | ||
from io import IOBase | ||
|
||
from flux_sdk.benefits_administration.capabilities.process_employees_deductions.data_models import ( | ||
DeductionDetails, | ||
ExternalDeductionCodeToRipplingCode, | ||
) | ||
|
||
|
||
class ProcessEmployeesDeductions(ABC): | ||
""" | ||
This class represents the "process employee deductions" capability. The developer is supposed to implement | ||
the following methods in their implementation. | ||
|
||
The methods on this class are required to instantiate an instance of this class. | ||
""" | ||
|
||
@staticmethod | ||
@abstractmethod | ||
def format_and_fetch_deduction_info( | ||
stream: IOBase, deduction_code_mapping: list[ExternalDeductionCodeToRipplingCode] | ||
) -> list[DeductionDetails]: | ||
""" | ||
This method receives the file which contains the deductions relevant to the companies employees and returns the | ||
deductions details for each employee | ||
:param IOBase: | ||
:param list[ExternalDeductionCodeToRipplingCode]: | ||
:return list[DeductionDetails]: | ||
""" |
1 change: 1 addition & 0 deletions
1
flux_sdk/benefits_administration/capabilities/report_employees_hr_data/BUILD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
python_sources() |
Empty file.
84 changes: 84 additions & 0 deletions
84
flux_sdk/benefits_administration/capabilities/report_employees_hr_data/data_models.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
from datetime import datetime | ||
from decimal import Decimal | ||
from enum import Enum | ||
|
||
from flux_sdk.flux_core.data_models import ( | ||
Employee, | ||
EmployeeState, | ||
EmploymentType, | ||
PayFrequency, | ||
PayTimeUnit, | ||
TerminationType, | ||
) | ||
|
||
|
||
class ReportEmployeesHrDataConfig: | ||
''' | ||
This contains the application data gathered durring installation | ||
which is necesary to prepare employee data or process deductions | ||
''' | ||
auto_enroll: bool | ||
group_number: str | ||
company_id: str | ||
|
||
|
||
class MonetaryValue: | ||
value: Decimal | ||
currency_type: str | ||
|
||
|
||
class Pay: | ||
frequency: PayFrequency | ||
frequency_effective_date: datetime | ||
time_unit: PayTimeUnit | ||
value_per_unit: MonetaryValue | ||
value_effective_date: datetime | ||
salary_or_equivalent: MonetaryValue | ||
expected_commission: MonetaryValue | None | ||
|
||
class EmploymentHours: | ||
type: EmploymentType | ||
type_effective_date: datetime | ||
hours_per_week: int | None | ||
hours_effective_date: datetime | ||
|
||
|
||
class Employment: | ||
hours: EmploymentHours | ||
pay: Pay | ||
is_rehire: bool | ||
termination_date: datetime | None | ||
termination_type: TerminationType | None | ||
start_date: datetime | ||
original_hire_date: datetime | ||
w2_start_date: datetime | ||
|
||
|
||
class BenefitsEligibility(Enum): | ||
# this will expand to cover cobra later | ||
ELIGIBLE = 1 | ||
IN_ELIGIBLE = 2 | ||
|
||
class BenefitsEligibilityStatus: | ||
eligibility: BenefitsEligibility | ||
effective_date: datetime | ||
|
||
class EmployeeStatus: | ||
status: EmployeeState | ||
effective_date: datetime | ||
|
||
|
||
class EmployeeHrData: | ||
''' | ||
This contains the core data about an employee | ||
which is relevant to a benefits administration provider | ||
''' | ||
id: str | ||
employee_number: int | ||
company_tax_id: str | ||
personal: Employee | ||
employment: Employment | ||
pay: Pay | ||
status: EmployeeStatus | ||
benefits_eligibility: BenefitsEligibilityStatus | ||
|
32 changes: 32 additions & 0 deletions
32
flux_sdk/benefits_administration/capabilities/report_employees_hr_data/interface.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from abc import ABC, abstractmethod | ||
|
||
from flux_sdk.benefits_administration.capabilities.report_employees_hr_data.data_models import ( | ||
EmployeeHrData, | ||
ReportEmployeesHrDataConfig, | ||
) | ||
from flux_sdk.flux_core.data_models import File | ||
|
||
|
||
class ReportEmployeesHrData(ABC): | ||
""" | ||
This class represents the "report employee data" capability. The developer is supposed to implement | ||
the following methods in their implementation. | ||
|
||
The methods on this class are required to instantiate an instance of this class. | ||
""" | ||
|
||
@staticmethod | ||
@abstractmethod | ||
def format_employees_hr_data( | ||
config: ReportEmployeesHrDataConfig, | ||
employee_data: list[EmployeeHrData] | ||
) -> File: | ||
""" | ||
This method receives the apps configuration data and a list of employee data. | ||
The developer is expected to create a file, formated to their use case, and return that file. | ||
The file will be tranfered to the partner company via SFTP | ||
|
||
:param ReportEmployeesHrDataConfig: | ||
:param list[EmployeeHrData]: | ||
:return File: | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bryanbierce What are the fields do you need that are not part of Employee ?
I see that
hours_per_week
andhours_effective_date
are the only fields ? Can they go inside Employee data type ? cc: @stevevls @Kingpin007 @ujjwalshuklaThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type_effective_date
,hours_per_week
,hours_effective_date
,termination_type
and thepay
object are not onEmployee
currently. I had asked the team if I could extendEmployee
with these originally and the answer from @Kingpin007 and @ujjwalshukla was no. Happy to move them around if you all would rather co-locate these now. ThisEmployment
object only existed because the team originally did not want any of the new data influx_core
so I took the opportunity to duplicate some fields and make the objects a bit more sensible to work with.