Skip to content

Commit

Permalink
update data models
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanbierce committed Mar 19, 2024
1 parent 9e0fe4b commit a713cb5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
from typing import Optional
from decimal import Decimal
from datetime import datetime

from enum import Enum

class DeductionDetails:
companyId: str
employeeId: str
deductionCode: str
effectiveFrom: datetime
endDate: datetime
totalContribution: Optional[Decimal]
employeeContribution: Optional[Decimal]
domesticPartnerPostTax: Optional[Decimal]
imputedIncome: Optional[Decimal]
companyContribution: Optional[Decimal]

class DeductionCodeField(Enum):
EMPLOYEE_CONTRIBUTION = "EMPLOYEE_CONTRIBUTION"
COMPANY_CONTRIBUTION = "COMPANY_CONTRIBUTION"

class ExternalDeductionCodeToRipplingCode:
externalCode: str
ripplingCode: str
ripplingDeductionField: DeductionCodeField


Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
from abc import ABC, abstractmethod
from io import IOBase

from flux_sdk.flux_core.data_models import CompanyInfo, File
from flux_sdk.benefits_administration.capabilities.process_employees_deductions.data_models import DeductionDetails
from flux_sdk.benefits_administration.capabilities.process_employees_deductions.data_models import {
DeductionDetails,
ExternalDeductionCodeToRipplingCode
}


class ProcessEmployeesDeductions(ABC):
Expand All @@ -22,7 +25,7 @@ def get_file_name(company_name: str) -> str:

@staticmethod
@abstractmethod
def format_and_fetch_deduction_info(uri: str, stream: IOBase) -> list[DeductionDetails]:
def format_and_fetch_deduction_info(uri: str, 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ class EmployeePersonalAndEmploymentData:
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
Expand Down

0 comments on commit a713cb5

Please sign in to comment.