brynq-sdk-nmbrs 2.3.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. brynq_sdk_nmbrs/__init__.py +226 -0
  2. brynq_sdk_nmbrs/absence.py +124 -0
  3. brynq_sdk_nmbrs/address.py +66 -0
  4. brynq_sdk_nmbrs/bank.py +125 -0
  5. brynq_sdk_nmbrs/children.py +100 -0
  6. brynq_sdk_nmbrs/companies.py +93 -0
  7. brynq_sdk_nmbrs/contract.py +132 -0
  8. brynq_sdk_nmbrs/costcenter.py +166 -0
  9. brynq_sdk_nmbrs/costunit.py +90 -0
  10. brynq_sdk_nmbrs/days.py +137 -0
  11. brynq_sdk_nmbrs/debtors.py +25 -0
  12. brynq_sdk_nmbrs/department.py +122 -0
  13. brynq_sdk_nmbrs/document.py +30 -0
  14. brynq_sdk_nmbrs/employees.py +196 -0
  15. brynq_sdk_nmbrs/employment.py +107 -0
  16. brynq_sdk_nmbrs/function.py +89 -0
  17. brynq_sdk_nmbrs/hours.py +252 -0
  18. brynq_sdk_nmbrs/leave.py +139 -0
  19. brynq_sdk_nmbrs/manager.py +294 -0
  20. brynq_sdk_nmbrs/salaries.py +85 -0
  21. brynq_sdk_nmbrs/salary_tables.py +242 -0
  22. brynq_sdk_nmbrs/schedules.py +84 -0
  23. brynq_sdk_nmbrs/schemas/__init__.py +37 -0
  24. brynq_sdk_nmbrs/schemas/absence.py +61 -0
  25. brynq_sdk_nmbrs/schemas/address.py +76 -0
  26. brynq_sdk_nmbrs/schemas/bank.py +83 -0
  27. brynq_sdk_nmbrs/schemas/contracts.py +60 -0
  28. brynq_sdk_nmbrs/schemas/costcenter.py +91 -0
  29. brynq_sdk_nmbrs/schemas/costunit.py +40 -0
  30. brynq_sdk_nmbrs/schemas/days.py +98 -0
  31. brynq_sdk_nmbrs/schemas/debtor.py +16 -0
  32. brynq_sdk_nmbrs/schemas/department.py +57 -0
  33. brynq_sdk_nmbrs/schemas/employees.py +153 -0
  34. brynq_sdk_nmbrs/schemas/employment.py +48 -0
  35. brynq_sdk_nmbrs/schemas/function.py +50 -0
  36. brynq_sdk_nmbrs/schemas/hours.py +121 -0
  37. brynq_sdk_nmbrs/schemas/leave.py +53 -0
  38. brynq_sdk_nmbrs/schemas/manager.py +126 -0
  39. brynq_sdk_nmbrs/schemas/salary.py +92 -0
  40. brynq_sdk_nmbrs/schemas/schedules.py +96 -0
  41. brynq_sdk_nmbrs/schemas/social_insurance.py +40 -0
  42. brynq_sdk_nmbrs/schemas/wage_tax.py +98 -0
  43. brynq_sdk_nmbrs/schemas/wagecomponents.py +114 -0
  44. brynq_sdk_nmbrs/social_insurance.py +52 -0
  45. brynq_sdk_nmbrs/wage_tax.py +164 -0
  46. brynq_sdk_nmbrs/wagecomponents.py +268 -0
  47. brynq_sdk_nmbrs-2.3.1.dist-info/METADATA +21 -0
  48. brynq_sdk_nmbrs-2.3.1.dist-info/RECORD +50 -0
  49. brynq_sdk_nmbrs-2.3.1.dist-info/WHEEL +5 -0
  50. brynq_sdk_nmbrs-2.3.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,60 @@
1
+ import pandas as pd
2
+ import pandera as pa
3
+ from pandera import Bool
4
+ from pandera.typing import Series, String, Float, DateTime
5
+ import pandera.extensions as extensions
6
+ from brynq_sdk_functions import BrynQPanderaDataFrameModel
7
+ from typing import Optional
8
+ from pydantic import BaseModel, Field
9
+ from datetime import datetime
10
+
11
+ # ---------------------------
12
+ # Get Schemas
13
+ # ---------------------------
14
+ class ContractGet(BrynQPanderaDataFrameModel):
15
+ employee_id: Series[String] = pa.Field(coerce=True, description="Employee ID", alias="employeeId")
16
+ contract_id: Series[String] = pa.Field(coerce=True, description="Contract ID", alias="contractId")
17
+ start_date: Series[DateTime] = pa.Field(coerce=True, description="Start Date Contract", alias="startDate")
18
+ trial_period: Series[String] = pa.Field(coerce=True, nullable=True, description="Trial Period Contract", alias="trialPeriod")
19
+ end_date: Series[DateTime] = pa.Field(coerce=True, nullable=True, description="End Date Contract", alias="endDate")
20
+ indefinite: Series[Bool] = pa.Field(coerce=True, description="Indefinite Contract", alias="indefinite")
21
+ written_contract: Series[Bool] = pa.Field(coerce=True, description="Written Contract", alias="writtenContract")
22
+ weekly_hours: Series[Float] = pa.Field(coerce=True, nullable=True, description="Contract Hours per Week", alias="hoursPerWeek")
23
+ created_at: Series[DateTime] = pa.Field(coerce=True, description="Contract Created At", alias="createdAt")
24
+
25
+ class _Annotation:
26
+ primary_key = "contract_id"
27
+ foreign_keys = {
28
+ "employee_id": {
29
+ "parent_schema": "EmployeeSchema",
30
+ "parent_column": "employee_id",
31
+ "cardinality": "N:1"
32
+ }
33
+ }
34
+
35
+ # ---------------------------
36
+ # Upload Schemas
37
+ # ---------------------------
38
+ class ContractCreate(BaseModel):
39
+ employee_id: str = Field(..., description="Employee identifier", alias="employeeId")
40
+ start_date_contract: datetime = Field(..., example="2021-01-01T09:29:18Z", description="Start Date Contract", alias="startDate")
41
+ trial_period: Optional[datetime] = Field(None, example="2021-02-01T00:00:00Z", description="Trial Period Contract", alias="trialPeriod")
42
+ end_date_contract: Optional[datetime] = Field(None, example="2021-08-24T14:15:22Z", description="End Date Contract", alias="endDate")
43
+ indefinite_contract: bool = Field(..., example=True, description="Indefinite Contract", alias="indefinite")
44
+ written_contract: Optional[bool] = Field(None, example=True, description="Written Contract", alias="writtenContract")
45
+ weekly_hours: Optional[float] = Field(None, ge=0, le=168, example=40, description="Contract Hours per Week", alias="hoursPerWeek")
46
+
47
+ class ContractUpdate(BaseModel):
48
+ employee_id: str = Field(..., description="Employee identifier", alias="employeeId")
49
+ contract_id: str = Field(..., example="e35e343b-55a3-4e44-bc4b-f41c3b93bcf5", description="Contract ID", alias="contractId")
50
+ trial_period: Optional[datetime] = Field(None, example="2021-07-31T00:00:00Z", description="Trial Period Contract", alias="trialPeriod")
51
+ end_date_contract: Optional[datetime] = Field(None, example="2021-12-31T00:00:00Z", description="End Date Contract", alias="endDate")
52
+ indefinite_contract: bool = Field(..., example=True, description="Indefinite Contract", alias="indefinite")
53
+ written_contract: Optional[bool] = Field(None, example=True, description="Written Contract", alias="writtenContract")
54
+ weekly_hours: Optional[float] = Field(None, ge=0, le=168, example=20, description="Contract Hours per Week", alias="hoursPerWeek")
55
+
56
+ class Config:
57
+ primary_key = "contractId"
58
+
59
+ class ContractDelete(BaseModel):
60
+ contract_id: str = Field(..., example="e35e343b-55a3-4e44-bc4b-f41c3b93bcf5", description="Contract ID", alias="contractId")
@@ -0,0 +1,91 @@
1
+ import pandas as pd
2
+ import pandera as pa
3
+ from pandera import Bool
4
+ from pandera.typing import Series, String, Float, DateTime
5
+ import pandera.extensions as extensions
6
+ from brynq_sdk_functions import BrynQPanderaDataFrameModel
7
+ from typing import Optional, List
8
+ from pydantic import BaseModel, Field
9
+ from datetime import datetime
10
+
11
+ # ---------------------------
12
+ # Get Schemas
13
+ # ---------------------------
14
+ class EmployeeCostcenterGet(BrynQPanderaDataFrameModel):
15
+ employee_id: Series[String] = pa.Field(coerce=True, description="Employee ID", alias="employeeId")
16
+ employee_cost_center_id: Series[String] = pa.Field(coerce=True, description="Employee Cost Center ID", alias="employeeCostCenterId")
17
+ cost_centers_cost_center_id: Series[String] = pa.Field(coerce=True, description="Cost Center ID", alias="costCenters.costCenterId")
18
+ cost_centers_code: Series[String] = pa.Field(coerce=True, description="Cost Centers Code", alias="costCenters.code")
19
+ cost_centers_description: Series[String] = pa.Field(coerce=True, description="Cost Centers Description", alias="costCenters.description")
20
+ cost_units_cost_unit_id: Series[String] = pa.Field(coerce=True, description="Cost Unit ID", alias="costUnits.costUnitId")
21
+ cost_units_code: Series[String] = pa.Field(coerce=True, description="Cost Unit Code", alias="costUnits.code")
22
+ cost_units_description: Series[String] = pa.Field(coerce=True, description="Cost Unit Description", alias="costUnits.description")
23
+ percentage: Series[Float] = pa.Field(coerce=True, description="Percentage", alias="percentage")
24
+ default: Series[Bool] = pa.Field(coerce=True, description="Default", alias="default")
25
+ period_year: Series[pd.Int64Dtype] = pa.Field(coerce=True, description="Year", alias="period.year")
26
+ period_period: Series[pd.Int64Dtype] = pa.Field(coerce=True, description="Period", alias="period.period")
27
+ created_at: Series[DateTime] = pa.Field(coerce=True, description="Created At", alias="createdAt")
28
+
29
+ class _Annotation:
30
+ primary_key = "employee_cost_center_id"
31
+ foreign_keys = {
32
+ "employee_id": {
33
+ "parent_schema": "EmployeeSchema",
34
+ "parent_column": "employee_id",
35
+ "cardinality": "N:1"
36
+ }
37
+ }
38
+
39
+ class CostcenterGet(BrynQPanderaDataFrameModel):
40
+ cost_center_id: Series[String] = pa.Field(coerce=True, description="Cost Center ID", alias="costCenterId")
41
+ code: Series[String] = pa.Field(coerce=True, description="Code", alias="code")
42
+ description: Series[String] = pa.Field(coerce=True, description="Description", alias="description")
43
+
44
+ class _Annotation:
45
+ primary_key = "cost_center_id"
46
+
47
+ # ---------------------------
48
+ # Upload Schemas
49
+ # ---------------------------
50
+ class CostcenterTable(BaseModel):
51
+ costcenter_id: str = Field(..., example="a405f980-1c4c-42c1-8ddb-2d90c58da0b1", description="Cost Center ID", alias="costCenterId")
52
+ costunit_id: Optional[str] = Field(None, example="b505f980-1c4c-42c1-8ddb-2d90c58da0b2", description="Cost Unit ID", alias="costUnitId")
53
+ percentage: Optional[float] = Field(100, example=100, description="Percentage", alias="percentage")
54
+ default: Optional[bool] = Field(True, example=True, description="Default", alias="default")
55
+
56
+
57
+ class Period(BaseModel):
58
+ year: int = Field(..., ge=1900, le=2100, example=2021, description="Year", alias="year")
59
+ period: int = Field(..., ge=1, le=53, example=4, description="Period", alias="period")
60
+
61
+
62
+ class EmployeeCostcenterUpdate(BaseModel):
63
+ employee_id: str = Field(..., example="c605f980-1c4c-42c1-8ddb-2d90c58da0b3", description="Employee Cost Center ID", alias="employeeId")
64
+ employee_cost_centers: List[CostcenterTable] = Field(..., description="Employee Cost Centers", alias="employeeCostCenters")
65
+ period_details: Period = Field(..., example=Period(year=2021, period=4), description="Period details", alias="period")
66
+
67
+ class Config:
68
+ primary_key = "employee_id"
69
+
70
+
71
+ class EmployeeCostcenterDelete(BaseModel):
72
+ employee_cost_center_id: str = Field(..., example="c605f980-1c4c-42c1-8ddb-2d90c58da0b3", description="Employee Cost Center ID", alias="employeeCostCenterId")
73
+
74
+ # CostCenter CRUD schemas - These are hypothetical since the API doesn't have create/update/delete endpoints
75
+ # but we add them for consistency with other schema files
76
+ class CostcenterCreate(BaseModel):
77
+ company_id: str = Field(..., description="Company identifier", alias="companyId")
78
+ code: str = Field(..., example="CC001", description="Code", alias="code")
79
+ description: str = Field(..., example="Sales Department", description="Description", alias="description")
80
+
81
+ class CostcenterUpdate(BaseModel):
82
+ company_id: str = Field(..., description="Company identifier", alias="companyId")
83
+ cost_center_id: str = Field(..., example="a405f980-1c4c-42c1-8ddb-2d90c58da0b1", description="Cost Center ID", alias="costCenterId")
84
+ code: str = Field(..., example="CC001", description="Code", alias="code")
85
+ description: str = Field(..., example="Sales Department", description="Description", alias="description")
86
+
87
+ class Config:
88
+ primary_key = "costCenterId"
89
+
90
+ class CostcenterDelete(BaseModel):
91
+ cost_center_id: str = Field(..., example="a405f980-1c4c-42c1-8ddb-2d90c58da0b1", description="Cost Center ID", alias="costCenterId")
@@ -0,0 +1,40 @@
1
+ import pandas as pd
2
+ import pandera as pa
3
+ from pandera import Bool
4
+ from pandera.typing import Series, String, Float, DateTime
5
+ import pandera.extensions as extensions
6
+ from brynq_sdk_functions import BrynQPanderaDataFrameModel
7
+ from typing import Optional
8
+ from pydantic import BaseModel, Field
9
+ from datetime import datetime
10
+
11
+ # ---------------------------
12
+ # Get Schemas
13
+ # ---------------------------
14
+ class CostunitGet(BrynQPanderaDataFrameModel):
15
+ cost_unit_id: Series[String] = pa.Field(coerce=True, description="Cost Unit ID", alias="costUnitId")
16
+ code: Series[String] = pa.Field(coerce=True, description="Cost Unit Code", alias="code")
17
+ description: Series[String] = pa.Field(coerce=True, description="Cost Unit Description", alias="description")
18
+
19
+ class _Annotation:
20
+ primary_key = "cost_unit_id"
21
+
22
+ # ---------------------------
23
+ # Upload Schemas
24
+ # ---------------------------
25
+ class CostunitCreate(BaseModel):
26
+ company_id: str = Field(..., description="Company identifier", alias="companyId")
27
+ code: str = Field(..., example="CU001", description="Code", alias="code")
28
+ description: str = Field(..., example="Marketing Unit", description="Description", alias="description")
29
+
30
+ class CostunitUpdate(BaseModel):
31
+ company_id: str = Field(..., description="Company identifier", alias="companyId")
32
+ cost_unit_id: str = Field(..., example="b505f980-1c4c-42c1-8ddb-2d90c58da0b2", description="Cost Unit ID", alias="costUnitId")
33
+ code: str = Field(..., example="CU001", description="Code", alias="code")
34
+ description: str = Field(..., example="Marketing Unit", description="Description", alias="description")
35
+
36
+ class Config:
37
+ primary_key = "costUnitId"
38
+
39
+ class CostunitDelete(BaseModel):
40
+ cost_unit_id: str = Field(..., example="b505f980-1c4c-42c1-8ddb-2d90c58da0b2", description="Cost Unit ID", alias="costUnitId")
@@ -0,0 +1,98 @@
1
+ import pandas as pd
2
+ import requests
3
+ import pandera as pa
4
+ from pandera.typing import Series, String, Float, DateTime
5
+ import pandas as pd
6
+ from typing import Optional
7
+ from uuid import UUID
8
+ from pydantic import BaseModel, Field
9
+ from brynq_sdk_functions import BrynQPanderaDataFrameModel
10
+ from typing import Optional
11
+ from pydantic import BaseModel, Field
12
+
13
+ # ---------------------------
14
+ # Get Schemas
15
+ # ---------------------------
16
+ # PANDERA SCHEMA
17
+ class VariableDaysGet(BrynQPanderaDataFrameModel):
18
+ days: Series[String] = pa.Field(coerce=True, description="Hour Component ID", alias="days")
19
+ days_for_wage_components_per_day: Series[pd.Int64Dtype] = pa.Field(coerce=True, description="Hour Code", alias="daysForWageComponentsPerDay")
20
+ employee_id: Series[String] = pa.Field(coerce=True, description="Employee ID", alias="employeeId")
21
+
22
+ class Config:
23
+ coerce = True
24
+
25
+ class FixedDaysGet(BrynQPanderaDataFrameModel):
26
+ days: Series[String] = pa.Field(coerce=True, description="Hour Component ID", alias="days")
27
+ days_for_wage_components_per_day: Series[pd.Int64Dtype] = pa.Field(coerce=True, description="Hour Code", alias="daysForWageComponentsPerDay")
28
+ end_year: Series[pd.Int64Dtype] = pa.Field(nullable=True, coerce=True, description="End Year", alias="endYear")
29
+ end_period: Series[pd.Int64Dtype] = pa.Field(nullable=True, coerce=True, description="End Period", alias="endPeriod")
30
+ employee_id: Series[String] = pa.Field(coerce=True, description="Employee ID", alias="employeeId")
31
+
32
+ class Config:
33
+ coerce = True
34
+
35
+ # ---------------------------
36
+ # Upload Schemas
37
+ # ---------------------------
38
+ class PeriodModel(BaseModel):
39
+ year: Optional[int] = Field(None, ge=1900, le=2100, example=2025, description="Year", alias="year")
40
+ period: Optional[int] = Field(None, ge=1, le=53, example=1, description="Period", alias="period")
41
+
42
+ class PeriodPost(BaseModel):
43
+ period: Optional[PeriodModel] = Field(None, description="Period", alias="period")
44
+ unprotected_mode: Optional[bool] = Field(None, example=False, description="Unprotected Mode", alias="unprotectedMode")
45
+
46
+ class FixedHoursCreate(BaseModel):
47
+ hour_code: int = Field(..., ge=1, example=2100, description="Hour Code", alias="hourCode")
48
+ hours: float = Field(..., ge=0, le=1000, example=40, description="Hours", alias="hours")
49
+ cost_center_id: Optional[str] = Field(None, example="aa506564-d1db-4fa8-83dc-d68db4cfcd82", description="Cost Center ID", alias="costCenterId")
50
+ cost_unit_id: Optional[str] = Field(None, example="d8ac6afb-2ac6-43bf-9880-2d382cdace43", description="Cost Unit ID", alias="costUnitId")
51
+ comment: Optional[str] = Field(None, example="Regular working hours with full details", description="Comment", alias="comment")
52
+ end_year: Optional[int] = Field(None, ge=1900, le=2100, example=2025, description="End Year", alias="endYear")
53
+ end_period: Optional[int] = Field(None, ge=1, le=53, example=12, description="End Period", alias="endPeriod")
54
+ period_details: Optional[PeriodPost] = None
55
+
56
+ class FixedHoursUpdate(BaseModel):
57
+ hour_component_id: str = Field(..., example="ddaae291-47fa-4c67-bb2f-de0e5da9e8a1", description="Hour Component ID", alias="hourComponentId")
58
+ hour_code: Optional[int] = Field(None, ge=1, example=2100, description="Hour Code", alias="hourCode")
59
+ hours: Optional[float] = Field(None, ge=0, le=1000, example=40, description="Hours", alias="hours")
60
+ cost_center_id: Optional[str] = Field(None, example="aa506564-d1db-4fa8-83dc-d68db4cfcd82", description="Cost Center ID", alias="costCenterId")
61
+ cost_unit_id: Optional[str] = Field(None, example="d8ac6afb-2ac6-43bf-9880-2d382cdace43", description="Cost Unit ID", alias="costUnitId")
62
+ comment: Optional[str] = Field(None, example="Comment about update", description="Comment", alias="comment")
63
+ end_year: Optional[int] = Field(None, ge=1900, le=2100, example=2025, description="End Year", alias="endYear")
64
+ end_period: Optional[int] = Field(None, ge=1, le=53, example=12, description="End Period", alias="endPeriod")
65
+ period_details: Optional[PeriodPost] = None
66
+
67
+ class VariableHoursCreate(BaseModel):
68
+ hour_code: int = Field(..., ge=1, example=2100, description="Hour Code", alias="hourCode")
69
+ hours: float = Field(..., ge=0, le=1000, example=3.5, description="Hours", alias="hours")
70
+ cost_center_id: Optional[str] = Field(None, example="aa506564-d1db-4fa8-83dc-d68db4cfcd82", description="Cost Center ID", alias="costCenterId")
71
+ cost_unit_id: Optional[str] = Field(None, example="d8ac6afb-2ac6-43bf-9880-2d382cdace43", description="Cost Unit ID", alias="costUnitId")
72
+ comment: Optional[str] = Field(None, example="Shift hours", description="Comment", alias="comment")
73
+ period_details: Optional[PeriodPost] = Field(None, example="Period details", description="Period details", alias="periodDetails")
74
+
75
+ class VariableHoursUpdate(BaseModel):
76
+ hour_component_id: str = Field(..., example="49a69eda-252e-4ccb-a220-38ea90511d4f", description="Hour Component ID", alias="hourComponentId")
77
+ hour_code: Optional[int] = Field(None, ge=1, example=2100, description="Hour Code", alias="hourCode")
78
+ hours: Optional[float] = Field(None, ge=0, le=1000, example=45.5, description="Hours", alias="hours")
79
+ cost_center_id: Optional[str] = Field(None, example="aa506564-d1db-4fa8-83dc-d68db4cfcd82", description="Cost Center ID", alias="costCenterId")
80
+ cost_unit_id: Optional[str] = Field(None, example="d8ac6afb-2ac6-43bf-9880-2d382cdace43", description="Cost Unit ID", alias="costUnitId")
81
+ comment: Optional[str] = Field(None, example="Comment about update", description="Comment", alias="comment")
82
+ period_details: Optional[PeriodPost] = None
83
+
84
+ class HoursDelete(BaseModel):
85
+ hour_component_id: str = Field(..., example="49a69eda-252e-4ccb-a220-38ea90511d4f", description="Hour Component ID", alias="hourComponentId")
86
+
87
+
88
+ class FixedDaysCreate(BaseModel):
89
+ employee_id: str = Field(..., description="Employee identifier", alias="employeeId")
90
+ number_of_days: int = Field(..., ge=0, le=1000, example=40, description="Days", alias="days")
91
+ days_for_wage_components_per_day: Optional[int] = Field(None, ge=0, le=1000, example=40, description="Days for Wage Components per Day", alias="daysForWageComponentsPerDay")
92
+ period_details: Optional[PeriodPost] = Field(None, example="Period details", description="Period details", alias="periodDetails")
93
+
94
+ class VariableDaysCreate(BaseModel):
95
+ employee_id: str = Field(..., description="Employee identifier", alias="employeeId")
96
+ number_of_days: int = Field(..., ge=0, le=1000, example=40, description="Days", alias="days")
97
+ days_for_wage_components_per_day: Optional[int] = Field(None, ge=0, le=1000, example=40, description="Days for Wage Components per Day", alias="daysForWageComponentsPerDay")
98
+ period_details: Optional[PeriodPost] = Field(None, example="Period details", description="Period details", alias="periodDetails")
@@ -0,0 +1,16 @@
1
+ import pandas as pd
2
+ import pandera as pa
3
+ from pandera import Bool
4
+ from pandera.typing import Series, String, Float, DateTime
5
+ import pandera.extensions as extensions
6
+ from brynq_sdk_functions import BrynQPanderaDataFrameModel
7
+ from typing import Optional, Annotated
8
+ from pydantic import BaseModel, Field, StringConstraints
9
+
10
+ # ---------------------------
11
+ # Get Schemas
12
+ # ---------------------------
13
+ class DebtorsGet(BrynQPanderaDataFrameModel):
14
+ debtor_id: Series[String] = pa.Field(coerce=True, description="Debtor ID", alias="debtorId")
15
+ number: Series[String] = pa.Field(coerce=True, description="Debtor number", alias="number")
16
+ name: Series[Bool] = pa.Field(coerce=True, description="Debtor name", alias="name")
@@ -0,0 +1,57 @@
1
+ from datetime import datetime
2
+ import pandas as pd
3
+ import pandera as pa
4
+ from pandera.typing import Series, String, Float, DateTime
5
+ import pandera.extensions as extensions
6
+ from brynq_sdk_functions import BrynQPanderaDataFrameModel
7
+ from typing import Optional
8
+ from pydantic import BaseModel, Field
9
+
10
+ # ---------------------------
11
+ # Get Schemas
12
+ # ---------------------------
13
+ class EmployeeDepartmentGet(BrynQPanderaDataFrameModel):
14
+ employee_id: Series[String] = pa.Field(coerce=True, description="Employee ID", alias="employeeId")
15
+ department_id: Series[String] = pa.Field(coerce=True, description="Department ID", alias="departmentId")
16
+ code: Series[String] = pa.Field(coerce=True, description="Department Code", alias="code")
17
+ description: Series[String] = pa.Field(coerce=True, description="Department Description", alias="description")
18
+ created_at: Series[DateTime] = pa.Field(coerce=True, description="Created At", alias="createdAt")
19
+ period_year: Series[pd.Int64Dtype] = pa.Field(coerce=True, nullable=True, description="Year", alias="period.year")
20
+ period_period: Series[pd.Int64Dtype] = pa.Field(coerce=True, nullable=True, description="Period", alias="period.period")
21
+
22
+ class _Annotation:
23
+ primary_key = "department_id"
24
+ foreign_keys = {
25
+ "employee_id": {
26
+ "parent_schema": "EmployeeSchema",
27
+ "parent_column": "employee_id",
28
+ "cardinality": "N:1"
29
+ }
30
+ }
31
+
32
+ # ---------------------------
33
+ # Upload Schemas
34
+ # ---------------------------
35
+ class Period(BaseModel):
36
+ year: int = Field(..., ge=1900, le=2100, example=2021, description="Year", alias="year")
37
+ period: int = Field(..., ge=1, le=53, example=4, description="Period", alias="period")
38
+
39
+ class DepartmentGet(BrynQPanderaDataFrameModel):
40
+ department_id: Series[String] = pa.Field(coerce=True, description="Department ID", alias="departmentId")
41
+ code: Series[String] = pa.Field(coerce=True, description="Department Code", alias="code")
42
+ description: Series[String] = pa.Field(coerce=True, description="Department Description", alias="description")
43
+ created_at: Series[DateTime] = pa.Field(coerce=True, description="Created At", alias="createdAt")
44
+ managers: Series[String] = pa.Field(coerce=True, description="List of managers", alias="managers")
45
+
46
+ class DepartmentCreate(BaseModel):
47
+ employee_id: str = Field(..., description="Employee identifier", alias="employeeId")
48
+ code: int = Field(..., ge=1, example=2, description="Department Code", alias="code")
49
+ description: str = Field(..., min_length=1, max_length=200, example="Sales", description="Department Description", alias="description")
50
+
51
+ class EmployeeDepartmentUpdate(BaseModel):
52
+ employee_id: str = Field(..., description="Employee identifier", alias="employeeId")
53
+ department_id: str = Field(..., example="3214", description="Department ID", alias="departmentId")
54
+ period_details: Period = Field(..., example=Period(year=2021, period=4), description="Period details", alias="periodDetails")
55
+
56
+ class Config:
57
+ primary_key = "departmentId"
@@ -0,0 +1,153 @@
1
+ import math
2
+ import pandas as pd
3
+ import pandera as pa
4
+ from pandera.typing import Series, String, DateTime
5
+ import pandera.extensions as extensions
6
+ from brynq_sdk_functions import BrynQPanderaDataFrameModel
7
+ from typing import Optional, Annotated
8
+ from pydantic import BaseModel, Field, StringConstraints
9
+
10
+ # ---------------------------
11
+ # Get Schemas
12
+ # ---------------------------
13
+ class EmployeeGet(BrynQPanderaDataFrameModel):
14
+ employee_id: Series[String] = pa.Field(coerce=True, description="Employee ID", alias="employeeId")
15
+ personal_info_id: Series[String] = pa.Field(coerce=True, description="Personal Info ID", alias="personalInfoId")
16
+ created_at: Series[DateTime] = pa.Field(coerce=True, description="Employee Created At", alias="createdAt", nullable=True)
17
+ basic_info_employee_number: Series[pd.Int64Dtype] = pa.Field(coerce=True, description="Employee Number", alias="basicInfo.employeeNumber")
18
+ basic_info_first_name: Series[String] = pa.Field(coerce=True, nullable=True, description="First Name", alias="basicInfo.firstName")
19
+ basic_info_first_name_in_full: Series[String] = pa.Field(coerce=True, nullable=True, description="First Name In Full", alias="basicInfo.firstNameInFull")
20
+ basic_info_prefix: Series[String] = pa.Field(coerce=True, nullable=True, description="Prefix", alias="basicInfo.prefix")
21
+ basic_info_initials: Series[String] = pa.Field(coerce=True, nullable=True, description="Initials", alias="basicInfo.initials")
22
+ basic_info_last_name: Series[String] = pa.Field(coerce=True, description="Last Name", alias="basicInfo.lastName")
23
+ basic_info_employee_type: Series[String] = pa.Field(coerce=True, description="Employee Type", alias="basicInfo.employeeType")
24
+ birth_info_birth_date: Series[DateTime] = pa.Field(coerce=True, description="Birth Date", alias="birthInfo.birthDate")
25
+ birth_info_birth_country_code_iso: Series[String] = pa.Field(coerce=True, nullable=True, description="Birth Country Code ISO", alias="birthInfo.birthCountry.codeISO")
26
+ birth_info_nationality_code_iso: Series[String] = pa.Field(coerce=True, nullable=True, description="Nationality Code ISO", alias="birthInfo.nationality.codeISO")
27
+ birth_info_gender: Series[String] = pa.Field(coerce=True, nullable=True, description="Gender", alias="birthInfo.gender")
28
+ contact_info_private_email: Series[String] = pa.Field(coerce=True, nullable=True, description="Private Email", alias="contactInfo.privateEmail")
29
+ contact_info_business_email: Series[String] = pa.Field(coerce=True, nullable=True, description="Business Email", alias="contactInfo.businessEmail")
30
+ contact_info_business_phone: Series[String] = pa.Field(coerce=True, nullable=True, description="Business Phone", alias="contactInfo.businessPhone")
31
+ contact_info_business_mobile_phone: Series[String] = pa.Field(coerce=True, nullable=True, description="Business Mobile Phone", alias="contactInfo.businessMobilePhone")
32
+ contact_info_private_phone: Series[String] = pa.Field(coerce=True, nullable=True, description="Private Phone", alias="contactInfo.privatePhone")
33
+ contact_info_private_mobile_phone: Series[String] = pa.Field(coerce=True, nullable=True, description="Private Mobile Phone", alias="contactInfo.privateMobilePhone")
34
+ contact_info_other_phone: Series[String] = pa.Field(coerce=True, nullable=True, description="Other Phone", alias="contactInfo.otherPhone")
35
+ partner_info_partner_prefix: Series[String] = pa.Field(coerce=True, nullable=True, description="Partner Prefix", alias="partnerInfo.partnerPrefix")
36
+ partner_info_partner_name: Series[String] = pa.Field(coerce=True, nullable=True, description="Partner Name", alias="partnerInfo.partnerName")
37
+ period_year: Series[pd.Int64Dtype] = pa.Field(coerce=True, description="Year", alias="period.year")
38
+ period_period: Series[pd.Int64Dtype] = pa.Field(coerce=True, description="Period", alias="period.period")
39
+ birth_info_birth_country: Series[String] = pa.Field(coerce=True, nullable=True, description="Birth Country", alias="birthInfo.birthCountry")
40
+ company_id: Series[String] = pa.Field(coerce=True, description="Company ID", alias="companyId")
41
+
42
+ class _Annotation:
43
+ primary_key = "employee_id"
44
+
45
+ # ---------------------------
46
+ # Upload Schemas
47
+ # ---------------------------
48
+ class BasicInfo(BaseModel):
49
+ employee_id: Optional[int] = Field(None, ge=1, example=98072, description="Employee Number", alias="employeeNumber")
50
+ first_name: Optional[str] = Field(None, max_length=50, example="John", description="First Name", alias="firstName")
51
+ first_name_in_full: Optional[str] = Field(None, max_length=100, example="John in Full", description="First Name In Full", alias="firstNameInFull")
52
+ prefix: Optional[str] = Field(None, max_length=50, example="van der", description="Prefix", alias="prefix")
53
+ initials: Optional[str] = Field(None, max_length=50, example="J.D.", description="Initials", alias="initials")
54
+ last_name: str = Field(..., max_length=100, example="Doe", description="Last Name", alias="lastName")
55
+ employee_type: Annotated[
56
+ str,
57
+ StringConstraints(
58
+ pattern=r'^(applicant|newHire|payroll|formerPayroll|external|formerExternal|rejectedApplicant)$',
59
+ strip_whitespace=True
60
+ )
61
+ ] = Field(..., example="payroll", description="Employee Type", alias="employeeType")
62
+
63
+ class BasicInfoUpdate(BaseModel):
64
+ employee_id: Optional[int] = Field(None, ge=1, example=98072, description="Employee Number", alias="employeeNumber")
65
+ first_name: Optional[str] = Field(None, max_length=50, example="John", description="First Name", alias="firstName")
66
+ first_name_in_full: Optional[str] = Field(None, max_length=100, example="John in Full", description="First Name In Full", alias="firstNameInFull")
67
+ prefix: Optional[str] = Field(None, max_length=50, example="van der", description="Prefix", alias="prefix")
68
+ initials: Optional[str] = Field(None, max_length=50, example="J.D.", description="Initials", alias="initials")
69
+ last_name: str = Field(..., max_length=100, example="Doe", description="Last Name", alias="lastName")
70
+
71
+ class BirthInfo(BaseModel):
72
+ birth_date: Optional[str] = Field(None, example="1980-02-27", description="Birth Date", alias="birthDate")
73
+ birth_country_code_iso: Optional[Annotated[
74
+ str,
75
+ StringConstraints(
76
+ pattern=r'^[A-Za-z]+$',
77
+ strip_whitespace=True,
78
+ min_length=2,
79
+ max_length=3
80
+ )
81
+ ]] = Field(None, example="NL", description="Birth Country Code ISO", alias="birthCountryCodeISO")
82
+ nationality: Optional[Annotated[
83
+ str,
84
+ StringConstraints(
85
+ pattern=r'^[A-Za-z]+$',
86
+ strip_whitespace=True,
87
+ min_length=2,
88
+ max_length=3
89
+ )
90
+ ]] = Field(None, example="PT", description="Nationality Code ISO", alias="nationalityCodeISO")
91
+ deceased_on: Optional[str] = Field(None, example="1980-02-27", description="Deceased On", alias="deceasedOn")
92
+ gender: Optional[Annotated[
93
+ str,
94
+ StringConstraints(
95
+ pattern=r'^(unspecified|male|female|unknown)$',
96
+ strip_whitespace=True
97
+ )
98
+ ]] = Field(None, example="male", description="Gender", alias="gender")
99
+
100
+ class ContactInfo(BaseModel):
101
+ email_private: Optional[str] = Field(None, max_length=100, example="doe@private.com", description="Private Email", alias="privateEmail")
102
+ email_work: Optional[str] = Field(None, max_length=100, example="doe@business.com", description="Business Email", alias="businessEmail")
103
+ phone_work: Optional[str] = Field(None, max_length=50, example="+351222222", description="Business Phone", alias="businessPhone")
104
+ mobile_work: Optional[str] = Field(None, max_length=50, example="+351222222", description="Business Mobile Phone", alias="businessMobilePhone")
105
+ private_phone: Optional[str] = Field(None, max_length=50, example="+351222222", description="Private Phone", alias="privatePhone")
106
+ private_mobile_phone: Optional[str] = Field(None, max_length=50, example="+351222222", description="Private Mobile Phone", alias="privateMobilePhone")
107
+ other_phone: Optional[str] = Field(None, max_length=50, example="+351222222", description="Other Phone", alias="otherPhone")
108
+
109
+ class PartnerInfo(BaseModel):
110
+ partner_prefix: Optional[str] = Field(None, max_length=50, example="Mstr", description="Partner Prefix", alias="partnerPrefix")
111
+ partner_name: Optional[str] = Field(None, max_length=100, example="Jane Doe", description="Partner Name", alias="partnerName")
112
+ ascription_code: Optional[int] = Field(None, ge=0, example=0, description="Ascription Code", alias="ascriptionCode")
113
+
114
+ class Period(BaseModel):
115
+ year: int = Field(..., ge=1900, le=2100, example=2021, description="Year", alias="year")
116
+ period: int = Field(..., ge=1, le=53, example=4, description="Period", alias="period")
117
+
118
+ class AdditionalEmployeeInfo(BaseModel):
119
+ in_service_date: str = Field(..., example="2019-08-24", description="In Service Date", alias="inServiceDate")
120
+ default_employee_template: Optional[str] = Field(None, description="Default Employee Template", alias="defaultEmployeeTemplate")
121
+
122
+ class CreateEmployeePersonalInfo(BaseModel):
123
+ basic_info: BasicInfo = Field(..., alias="basicInfo")
124
+ birth_info: BirthInfo = Field(..., alias="birthInfo")
125
+ contact_info: ContactInfo = Field(..., alias="contactInfo")
126
+ partner_info: PartnerInfo = Field(..., alias="partnerInfo")
127
+ period: Period = Field(..., alias="period")
128
+ created_at: Optional[str] = Field(None, example="2021-07-01T10:15:08Z", description="Created At", alias="createdAt")
129
+
130
+ class EmployeeCreate(BaseModel):
131
+ company_id: str = Field(..., description="Company identifier", alias="companyId")
132
+ personal_info: CreateEmployeePersonalInfo = Field(..., alias="personalInfo")
133
+ additional_employee_info: AdditionalEmployeeInfo = Field(..., alias="additionalEmployeeInfo")
134
+
135
+ class EmployeeUpdate(BaseModel):
136
+ employee_id: str = Field(..., description="Employee identifier", alias="employeeId")
137
+ basic_info: Optional[BasicInfoUpdate] = Field(None, alias="basicInfo")
138
+ birth_info: Optional[BirthInfo] = Field(None, alias="birthInfo")
139
+ contact_info: Optional[ContactInfo] = Field(None, alias="contactInfo")
140
+ partner_info: Optional[PartnerInfo] = Field(None, alias="partnerInfo")
141
+ period: Period = Field(..., alias="period")
142
+
143
+ class EmployeeDelete(BaseModel):
144
+ employee_id: str = Field(..., example="3054d4cf-b449-489d-8d2e-5dd30e5ab994", description="Employee ID", alias="employeeId")
145
+
146
+ class BsnGet(BrynQPanderaDataFrameModel):
147
+ employee_id: Series[String] = pa.Field(coerce=True, description="Employee ID", alias="employeeId")
148
+ social_security_number: Series[String] = pa.Field(coerce=True, description="Social Security Number", alias="BSN")
149
+ company_id: Series[String] = pa.Field(coerce=True, description="Company ID", alias="companyId")
150
+ created_at: Series[DateTime] = pa.Field(coerce=True, description="Created At", alias="createdAt")
151
+
152
+ class _Annotation:
153
+ primary_key = "employee_id"
@@ -0,0 +1,48 @@
1
+ import pandas as pd
2
+ import pandera as pa
3
+ from pandera import Bool
4
+ from pandera.typing import Series, String, Float, DateTime
5
+ import pandera.extensions as extensions
6
+ from brynq_sdk_functions import BrynQPanderaDataFrameModel
7
+
8
+ from typing import Optional
9
+ from pydantic import BaseModel, Field
10
+ from datetime import datetime
11
+
12
+ # ---------------------------
13
+ # Get Schemas
14
+ # ---------------------------
15
+ class EmploymentGet(BrynQPanderaDataFrameModel):
16
+ employee_id: Series[String] = pa.Field(coerce=True, description="Employee ID", alias="employeeId")
17
+ employment_id: Series[String] = pa.Field(coerce=True, description="Employment ID", alias="employmentId")
18
+ start_date: Series[DateTime] = pa.Field(coerce=True, description="Start Date Employment", alias="startDate")
19
+ end_date: Series[DateTime] = pa.Field(coerce=True, nullable=True, description="End Date Employment", alias="endDate")
20
+ end_contract_reason: Series[String] = pa.Field(coerce=True, nullable=True, description="End Contract Reason", alias="endContractReason")
21
+
22
+ class _Annotation:
23
+ primary_key = "employment_id"
24
+ foreign_keys = {
25
+ "employee_id": {
26
+ "parent_schema": "EmployeeSchema",
27
+ "parent_column": "employee_id",
28
+ "cardinality": "N:1"
29
+ }
30
+ }
31
+
32
+ # ---------------------------
33
+ # Upload Schemas
34
+ # ---------------------------
35
+ class EmploymentCreate(BaseModel):
36
+ employee_id: str = Field(..., description="Employee identifier", alias="employeeId")
37
+ start_date: datetime = Field(..., example="2021-06-07T07:59:11Z", description="Start Date Employment", alias="startDate")
38
+ seniority_date: Optional[datetime] = Field(None, example="2021-06-09T07:59:11Z", description="Seniority Date Employment", alias="seniorityDate")
39
+
40
+ class EmploymentUpdate(BaseModel):
41
+ employee_id: str = Field(..., description="Employee identifier", alias="employeeId")
42
+ employment_id: str = Field(..., example="a405f980-1c4c-42c1-8ddb-2d90c58da0b1", description="Employment ID", alias="employmentId")
43
+ seniority_date: Optional[datetime] = Field(None, example="2021-06-07T07:59:11Z", description="Seniority Date Employment", alias="seniorityDate")
44
+ end_of_service_date: Optional[datetime] = Field(None, example="2021-10-01T00:00:00Z", description="End of Service Date Employment", alias="endOfServiceDate")
45
+ end_of_contract_reason: Optional[int] = Field(None, ge=0, example=3, description="End of Contract Reason Employment", alias="endOfContractReason")
46
+
47
+ class EmploymentDelete(BaseModel):
48
+ employment_id: str = Field(..., example="a405f980-1c4c-42c1-8ddb-2d90c58da0b1", description="Employment ID", alias="employmentId")
@@ -0,0 +1,50 @@
1
+ from datetime import datetime
2
+
3
+ import pandas as pd
4
+ import pandera as pa
5
+ from pandera.typing import Series, String, Float, DateTime
6
+ import pandera.extensions as extensions
7
+ from brynq_sdk_functions import BrynQPanderaDataFrameModel
8
+
9
+ from typing import Optional
10
+ from pydantic import BaseModel, Field
11
+
12
+ # ---------------------------
13
+ # Get Schemas
14
+ # ---------------------------
15
+ class EmployeeFunctionGet(BrynQPanderaDataFrameModel):
16
+ employee_id: Series[pa.String] = pa.Field(coerce=True, description="Employee ID", alias="employeeId")
17
+ function_id: Series[pa.String] = pa.Field(coerce=True, description="Function ID", alias="functionId")
18
+ code: Series[pd.Int64Dtype] = pa.Field(coerce=True, description="Function Code", alias="code")
19
+ description: Series[pa.String] = pa.Field(coerce=True, description="Function Description", alias="description")
20
+ created_at: Series[datetime] = pa.Field(coerce=True, description="Function Created At", alias="createdAt")
21
+ period_period: Series[pd.Int64Dtype] = pa.Field(coerce=True, description="Period", alias="period.period")
22
+ period_year: Series[pd.Int64Dtype] = pa.Field(coerce=True, description="Year", alias="period.year")
23
+
24
+ class _Annotation:
25
+ primary_key = "function_id"
26
+ foreign_keys = {
27
+ "employee_id": {
28
+ "parent_schema": "EmployeeSchema",
29
+ "parent_column": "employee_id",
30
+ "cardinality": "N:1"
31
+ }
32
+ }
33
+
34
+ # ---------------------------
35
+ # Upload Schemas
36
+ # ---------------------------
37
+ class Period(BaseModel):
38
+ year: int = Field(..., ge=1900, le=2100, example=2021, description="Year", alias="year")
39
+ period: int = Field(..., ge=1, le=53, example=4, description="Period", alias="period")
40
+
41
+ class FunctionGet(BrynQPanderaDataFrameModel):
42
+ function_id: Series[pa.String] = pa.Field(coerce=True, description="Function ID", alias="functionId")
43
+ code: Series[pd.Int64Dtype] = pa.Field(coerce=True, description="Function Code", alias="code")
44
+ description: Series[pa.String] = pa.Field(coerce=True, description="Function Description", alias="description")
45
+ created_at: Series[datetime] = pa.Field(coerce=True, description="Function Created At", alias="createdAt")
46
+
47
+ class FunctionUpdate(BaseModel):
48
+ employee_id: str = Field(..., description="Employee identifier", alias="employeeId")
49
+ function_id: str = Field(..., example="5981", description="Function ID", alias="functionId")
50
+ period_details: Period = Field(..., alias="periodDetails")