brynq-sdk-nmbrs 2.3.3.dev0__py3-none-any.whl → 2.4.5__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 (51) hide show
  1. brynq_sdk_nmbrs/__init__.py +95 -91
  2. brynq_sdk_nmbrs/absence.py +1 -4
  3. brynq_sdk_nmbrs/address.py +5 -81
  4. brynq_sdk_nmbrs/bank.py +1 -2
  5. brynq_sdk_nmbrs/companies.py +130 -39
  6. brynq_sdk_nmbrs/contract.py +0 -1
  7. brynq_sdk_nmbrs/days.py +1 -1
  8. brynq_sdk_nmbrs/debtors.py +53 -65
  9. brynq_sdk_nmbrs/department.py +23 -111
  10. brynq_sdk_nmbrs/document.py +195 -4
  11. brynq_sdk_nmbrs/employee_wage_tax_settings.py +13 -5
  12. brynq_sdk_nmbrs/employees.py +55 -21
  13. brynq_sdk_nmbrs/employment.py +0 -2
  14. brynq_sdk_nmbrs/extra_fields.py +126 -0
  15. brynq_sdk_nmbrs/function.py +35 -97
  16. brynq_sdk_nmbrs/leave.py +53 -58
  17. brynq_sdk_nmbrs/manager.py +51 -35
  18. brynq_sdk_nmbrs/salaries.py +48 -65
  19. brynq_sdk_nmbrs/salary_tables.py +1 -4
  20. brynq_sdk_nmbrs/schedules.py +5 -78
  21. brynq_sdk_nmbrs/schemas/absence.py +26 -16
  22. brynq_sdk_nmbrs/schemas/address.py +2 -29
  23. brynq_sdk_nmbrs/schemas/children.py +0 -2
  24. brynq_sdk_nmbrs/schemas/contracts.py +7 -6
  25. brynq_sdk_nmbrs/schemas/costcenter.py +2 -2
  26. brynq_sdk_nmbrs/schemas/costunit.py +2 -0
  27. brynq_sdk_nmbrs/schemas/days.py +13 -11
  28. brynq_sdk_nmbrs/schemas/debtor.py +6 -28
  29. brynq_sdk_nmbrs/schemas/department.py +5 -39
  30. brynq_sdk_nmbrs/schemas/document.py +0 -2
  31. brynq_sdk_nmbrs/schemas/employee_wage_tax_settings.py +75 -0
  32. brynq_sdk_nmbrs/schemas/employees.py +2 -0
  33. brynq_sdk_nmbrs/schemas/extra_fields.py +56 -0
  34. brynq_sdk_nmbrs/schemas/function.py +5 -32
  35. brynq_sdk_nmbrs/schemas/hours.py +5 -1
  36. brynq_sdk_nmbrs/schemas/leave.py +17 -6
  37. brynq_sdk_nmbrs/schemas/manager.py +16 -24
  38. brynq_sdk_nmbrs/schemas/salary.py +11 -1
  39. brynq_sdk_nmbrs/schemas/schedules.py +2 -54
  40. brynq_sdk_nmbrs/schemas/svw_settings.py +116 -0
  41. brynq_sdk_nmbrs/schemas/wage_tax.py +53 -21
  42. brynq_sdk_nmbrs/schemas/wagecomponents.py +6 -9
  43. brynq_sdk_nmbrs/svw_settings.py +213 -0
  44. brynq_sdk_nmbrs/wage_tax.py +120 -11
  45. {brynq_sdk_nmbrs-2.3.3.dev0.dist-info → brynq_sdk_nmbrs-2.4.5.dist-info}/METADATA +1 -1
  46. brynq_sdk_nmbrs-2.4.5.dist-info/RECORD +58 -0
  47. {brynq_sdk_nmbrs-2.3.3.dev0.dist-info → brynq_sdk_nmbrs-2.4.5.dist-info}/WHEEL +1 -1
  48. brynq_sdk_nmbrs/schemas/social_insurance.py +0 -73
  49. brynq_sdk_nmbrs/social_insurance.py +0 -130
  50. brynq_sdk_nmbrs-2.3.3.dev0.dist-info/RECORD +0 -55
  51. {brynq_sdk_nmbrs-2.3.3.dev0.dist-info → brynq_sdk_nmbrs-2.4.5.dist-info}/top_level.txt +0 -0
@@ -1,10 +1,6 @@
1
- from datetime import datetime
2
- from typing import Optional
3
-
4
1
  import pandas as pd
5
2
  import pandera as pa
6
- import pandera.extensions as extensions
7
- from pandera.typing import DateTime, Float, Series, String
3
+ from pandera.typing import DateTime, Series, String
8
4
  from pydantic import BaseModel, Field
9
5
 
10
6
  from brynq_sdk_functions import BrynQPanderaDataFrameModel
@@ -44,7 +40,10 @@ class DepartmentGet(BrynQPanderaDataFrameModel):
44
40
  code: Series[String] = pa.Field(coerce=True, description="Department Code", alias="code")
45
41
  description: Series[String] = pa.Field(coerce=True, description="Department Description", alias="description")
46
42
  created_at: Series[DateTime] = pa.Field(coerce=True, description="Created At", alias="createdAt")
47
- managers: Series[String] = pa.Field(coerce=True, description="List of managers", alias="managers")
43
+ managers: Series[String] = pa.Field(coerce=True, nullable=True, description="List of managers", alias="managers")
44
+
45
+ class _Annotation:
46
+ primary_key = "department_id"
48
47
 
49
48
  class DepartmentCreate(BaseModel):
50
49
  code: int = Field(..., ge=1, example=2, description="Department Code", alias="code")
@@ -56,36 +55,3 @@ class EmployeeDepartmentUpdate(BaseModel):
56
55
 
57
56
  class Config:
58
57
  primary_key = "departmentId"
59
-
60
-
61
- # ---------------------------
62
- # SOAP Schemas (DebtorService)
63
- # ---------------------------
64
- class DepartmentMasterCreate(BaseModel):
65
- """Schema for creating a master department via SOAP API."""
66
- debtor_id: int = Field(..., description="Debtor ID", alias="debtorId", example=34548)
67
- code: int = Field(..., ge=1, description="Department Code", alias="code", example=101)
68
- description: str = Field(..., min_length=1, max_length=200, description="Department Description", alias="description", example="Engineering")
69
-
70
- class Config:
71
- populate_by_name = True
72
-
73
-
74
- class DepartmentMasterUpdate(BaseModel):
75
- """Schema for updating a master department via SOAP API."""
76
- debtor_id: int = Field(..., description="Debtor ID", alias="debtorId", example=34548)
77
- department_id: int = Field(..., description="Department ID", alias="departmentId", example=12345)
78
- code: int = Field(..., ge=1, description="Department Code", alias="code", example=101)
79
- description: str = Field(..., min_length=1, max_length=200, description="Department Description", alias="description", example="Engineering Updated")
80
-
81
- class Config:
82
- populate_by_name = True
83
-
84
-
85
- class DepartmentMasterDelete(BaseModel):
86
- """Schema for deleting a master department via SOAP API."""
87
- debtor_id: int = Field(..., description="Debtor ID", alias="debtorId", example=34548)
88
- department_id: int = Field(..., description="Department ID to delete", alias="departmentId", example=12345)
89
-
90
- class Config:
91
- populate_by_name = True
@@ -4,10 +4,8 @@ from typing import Optional
4
4
 
5
5
  class DocumentUpload(BaseModel):
6
6
  """Schema for uploading a document to an employee via SOAP API."""
7
- employee_id: int = Field(..., description="Employee ID", alias="employeeId", example=276967)
8
7
  document_name: str = Field(..., description="Document name (with extension)", alias="documentName", example="contract.pdf")
9
8
  document_type_guid: str = Field(..., description="Document type GUID", alias="documentTypeGuid", example="00000000-0000-0000-0000-000000000000")
10
9
 
11
10
  class Config:
12
11
  populate_by_name = True
13
-
@@ -0,0 +1,75 @@
1
+ from typing import Literal, Optional
2
+
3
+ import pandas as pd
4
+ import pandera as pa
5
+ from pydantic import BaseModel, ConfigDict, Field
6
+
7
+ from brynq_sdk_functions import BrynQPanderaDataFrameModel
8
+
9
+
10
+ # ---------------------------
11
+ # Get Schemas - Employee Wage Tax Settings
12
+ # ---------------------------
13
+ class EmployeeWageTaxSettingsGet(BrynQPanderaDataFrameModel):
14
+ """Schema for validating employee wage tax settings data."""
15
+ employee_id: pd.StringDtype = pa.Field(coerce=True, description="Employee ID", alias="employeeId")
16
+ wage_tax_settings_id: pd.StringDtype = pa.Field(coerce=True, nullable=True, description="Wage tax settings ID", alias="wageTaxSettingsId")
17
+ wage_tax: pd.BooleanDtype = pa.Field(coerce=True, nullable=True, description="Wage tax", alias="wageTax")
18
+ wage_tax_rebate: pd.BooleanDtype = pa.Field(coerce=True, nullable=True, description="Wage tax rebate (Loonheffingskorting)", alias="wageTaxRebate")
19
+ single_elderly_discount: pd.BooleanDtype = pa.Field(coerce=True, nullable=True, description="Single elderly discount", alias="singleElderlyDiscount")
20
+ color_table: pd.StringDtype = pa.Field(coerce=True, nullable=True, description="Color table (White/Green)", alias="colorTable")
21
+ period_table: pd.StringDtype = pa.Field(coerce=True, nullable=True, description="Period table (Month/Week/4Week/Day)", alias="periodTable")
22
+ income_type: pd.StringDtype = pa.Field(coerce=True, nullable=True, description="Income type", alias="incomeType")
23
+ special_annual_salary_rate: pd.Float64Dtype = pa.Field(coerce=True, nullable=True, description="Special annual salary rate (Loonheffing BT)", alias="specialAnnualSalaryRate")
24
+ special_table: pd.StringDtype = pa.Field(coerce=True, nullable=True, description="Special table", alias="specialTable")
25
+ different_special_rate: pd.StringDtype = pa.Field(coerce=True, nullable=True, description="Different special rate (Afwijkend Bijzonder tarief %)", alias="differentSpecialRate")
26
+ period_year: pd.Int64Dtype = pa.Field(coerce=True, nullable=True, description="Period year", alias="period.year")
27
+ period_period: pd.Int64Dtype = pa.Field(coerce=True, nullable=True, description="Period", alias="period.period")
28
+ created_at: str = pa.Field(coerce=True, nullable=True, description="Created at", alias="createdAt")
29
+
30
+ class _Annotation:
31
+ primary_key = "wage_tax_settings_id"
32
+ foreign_keys = {
33
+ "employee_id": {
34
+ "parent_schema": "EmployeeSchema",
35
+ "parent_column": "employee_id",
36
+ "cardinality": "1:N"
37
+ }
38
+ }
39
+
40
+
41
+ # ---------------------------
42
+ # Create/Update Schemas
43
+ # ---------------------------
44
+ class Period(BaseModel):
45
+ """Period model for specifying year and period."""
46
+ model_config = ConfigDict(populate_by_name=True)
47
+
48
+ year: int = Field(..., ge=1900, le=2100, example=2021, description="Year", alias="year")
49
+ period: int = Field(..., ge=1, le=53, example=4, description="Period", alias="period")
50
+
51
+
52
+ class Calc30PercentRuling(BaseModel):
53
+ """30 percent ruling settings."""
54
+ model_config = ConfigDict(populate_by_name=True)
55
+
56
+ cal_30_percent_ruling: Optional[str] = Field(None, example="None", description="30% ruling type", alias="Cal30PercentRuling")
57
+ end_period: Optional[int] = Field(None, ge=1, le=53, example=12, description="End period", alias="endPeriod")
58
+ end_year: Optional[int] = Field(None, ge=1900, le=2100, example=2025, description="End year", alias="endYear")
59
+
60
+
61
+ class EmployeeWageTaxSettingsCreate(BaseModel):
62
+ """Schema for creating employee wage tax settings."""
63
+ model_config = ConfigDict(populate_by_name=True)
64
+
65
+ wage_tax: bool = Field(..., example=True, description="Wage tax", alias="wageTax")
66
+ wage_tax_rebate: bool = Field(..., example=True, description="Wage tax rebate (Loonheffingskorting)", alias="wageTaxRebate")
67
+ single_elderly_discount: bool = Field(..., example=False, description="Single elderly discount", alias="singleElderlyDiscount")
68
+ color_table: Literal["White", "Green"] = Field(..., example="White", description="Color table", alias="colorTable")
69
+ period_table: Literal["Month", "Week", "4Week", "Day"] = Field(..., example="Month", description="Period table", alias="periodTable")
70
+ income_type: str = Field(..., example="11", description="Income type", alias="incomeType")
71
+ special_annual_salary_rate: Optional[float] = Field(None, example=0.0, description="Special annual salary rate (Loonheffing BT)", alias="specialAnnualSalaryRate")
72
+ special_table: str = Field(..., example="None", description="Special table", alias="specialTable")
73
+ different_special_rate: Optional[float] = Field(None, example=0.0, description="Different special rate (Afwijkend Bijzonder tarief %)", alias="differentSpecialRate")
74
+ calc_30_percent_ruling: Optional[Calc30PercentRuling] = Field(None, example={"Cal30PercentRuling": "None", "endPeriod": 12, "endYear": 2025}, description="30% ruling settings", alias="Calc30PercentRuling")
75
+ period: Period = Field(..., example={"year": 2021, "period": 4}, description="Period to apply settings")
@@ -132,10 +132,12 @@ class CreateEmployeePersonalInfo(BaseModel):
132
132
  created_at: Optional[str] = Field(None, example="2021-07-01T10:15:08Z", description="Created At", alias="createdAt")
133
133
 
134
134
  class EmployeeCreate(BaseModel):
135
+ company_id: str = Field(..., description="Company identifier", alias="companyId")
135
136
  personal_info: CreateEmployeePersonalInfo = Field(..., alias="personalInfo")
136
137
  additional_employee_info: AdditionalEmployeeInfo = Field(..., alias="additionalEmployeeInfo")
137
138
 
138
139
  class EmployeeUpdate(BaseModel):
140
+ employee_id: str = Field(..., description="Employee identifier", alias="employeeId")
139
141
  basic_info: Optional[BasicInfoUpdate] = Field(None, alias="basicInfo")
140
142
  birth_info: Optional[BirthInfo] = Field(None, alias="birthInfo")
141
143
  contact_info: Optional[ContactInfo] = Field(None, alias="contactInfo")
@@ -0,0 +1,56 @@
1
+ import pandas as pd
2
+ import pandera as pa
3
+ from brynq_sdk_functions import BrynQPanderaDataFrameModel
4
+
5
+
6
+ # ---------------------------
7
+ # Get Schemas - Company Extra Field Settings
8
+ # ---------------------------
9
+ class ExtraFieldSettingsGet(BrynQPanderaDataFrameModel):
10
+ """Schema for validating company extra field settings data."""
11
+ extra_field_id: pd.StringDtype = pa.Field(coerce=True, description="Extra field ID", alias="extraFieldId")
12
+ name: pd.StringDtype = pa.Field(coerce=True, nullable=True, description="Extra field name", alias="name")
13
+ extra_field_type: pd.StringDtype = pa.Field(
14
+ coerce=True,
15
+ nullable=True,
16
+ isin=["text", "decimal", "number", "date", "yesNo", "textDate"],
17
+ description="Extra field type",
18
+ alias="extraFieldType"
19
+ )
20
+
21
+ class _Annotation:
22
+ primary_key = "extra_field_id"
23
+
24
+
25
+ # ---------------------------
26
+ # Get Schemas - Employee Extra Fields
27
+ # ---------------------------
28
+ class EmployeeExtraFieldsGet(BrynQPanderaDataFrameModel):
29
+ """Schema for validating employee extra fields data."""
30
+ employee_id: pd.StringDtype = pa.Field(coerce=True, description="Employee ID", alias="employeeId")
31
+ extra_field_id: pd.StringDtype = pa.Field(coerce=True, nullable=True, description="Extra field ID", alias="extraField.extraFieldId")
32
+ extra_field_name: pd.StringDtype = pa.Field(coerce=True, nullable=True, description="Extra field name", alias="extraField.name")
33
+ extra_field_type: pd.StringDtype = pa.Field(
34
+ coerce=True,
35
+ nullable=True,
36
+ isin=["text", "decimal", "number", "date", "yesNo", "textDate"],
37
+ description="Extra field type",
38
+ alias="extraField.extraFieldType"
39
+ )
40
+ value: pd.StringDtype = pa.Field(coerce=True, nullable=True, description="Field value", alias="value")
41
+ start_date: str = pa.Field(coerce=True, nullable=True, description="Start date", alias="startDate")
42
+
43
+ class _Annotation:
44
+ primary_key = "extra_field_id"
45
+ foreign_keys = {
46
+ "employee_id": {
47
+ "parent_schema": "EmployeeSchema",
48
+ "parent_column": "employee_id",
49
+ "cardinality": "1:N"
50
+ },
51
+ "extra_field_id": {
52
+ "parent_schema": "ExtraFieldSettingsGet",
53
+ "parent_column": "extra_field_id",
54
+ "cardinality": "N:1"
55
+ }
56
+ }
@@ -1,10 +1,8 @@
1
1
  from datetime import datetime
2
- from typing import Optional
3
2
 
4
3
  import pandas as pd
5
4
  import pandera as pa
6
- import pandera.extensions as extensions
7
- from pandera.typing import DateTime, Float, Series, String
5
+ from pandera.typing import Series
8
6
  from pydantic import BaseModel, Field
9
7
 
10
8
  from brynq_sdk_functions import BrynQPanderaDataFrameModel
@@ -44,34 +42,9 @@ class FunctionGet(BrynQPanderaDataFrameModel):
44
42
  code: Series[pd.Int64Dtype] = pa.Field(coerce=True, description="Function Code", alias="code")
45
43
  description: Series[pa.String] = pa.Field(coerce=True, description="Function Description", alias="description")
46
44
 
45
+ class _Annotation:
46
+ primary_key = "function_id"
47
+
47
48
  class FunctionUpdate(BaseModel):
48
49
  function_id: str = Field(..., example="5981", description="Function ID", alias="functionId")
49
- period_details: Period = Field(..., alias="periodDetails")
50
-
51
-
52
- # SOAP Schemas for DebtorService Functions
53
- class FunctionCreate(BaseModel):
54
- """Schema for creating a master function via SOAP API."""
55
- code: int = Field(..., example=101, description="Function Code", alias="code")
56
- description: str = Field(..., example="Software Developer", description="Function Description", alias="description")
57
-
58
- class Config:
59
- populate_by_name = True
60
-
61
-
62
- class FunctionDelete(BaseModel):
63
- """Schema for deleting a master function via SOAP API."""
64
- function_id: int = Field(..., example=12345, description="Function ID to delete", alias="functionId")
65
-
66
- class Config:
67
- populate_by_name = True
68
-
69
-
70
- class FunctionMasterUpdate(BaseModel):
71
- """Schema for updating a master function via SOAP API."""
72
- function_id: int = Field(..., example=12345, description="Function ID", alias="functionId")
73
- code: int = Field(..., example=101, description="Function Code", alias="code")
74
- description: str = Field(..., example="Senior Software Developer", description="Function Description", alias="description")
75
-
76
- class Config:
77
- populate_by_name = True
50
+ period_details: Period = Field(..., example={"year": 2021, "period": 4}, description="Period details", alias="periodDetails")
@@ -76,6 +76,7 @@ class PeriodPost(BaseModel):
76
76
  unprotected_mode: Optional[bool] = Field(None, example=False, description="Unprotected Mode", alias="unprotectedMode")
77
77
 
78
78
  class FixedHoursCreate(BaseModel):
79
+ employee_id: str = Field(..., description="Employee identifier", alias="employeeId")
79
80
  hour_code: int = Field(..., ge=1, example=2100, description="Hour Code", alias="hourCode")
80
81
  number_of_hours: float = Field(..., ge=0, le=1000, example=40, description="Hours", alias="hours")
81
82
  cost_center_id: Optional[str] = Field(None, example="aa506564-d1db-4fa8-83dc-d68db4cfcd82", description="Cost Center ID", alias="costCenterId")
@@ -86,6 +87,7 @@ class FixedHoursCreate(BaseModel):
86
87
  period_details: Optional[PeriodPost] = None
87
88
 
88
89
  class FixedHoursUpdate(BaseModel):
90
+ employee_id: str = Field(..., description="Employee identifier", alias="employeeId")
89
91
  hour_component_id: str = Field(..., example="ddaae291-47fa-4c67-bb2f-de0e5da9e8a1", description="Hour Component ID", alias="hourComponentId")
90
92
  hour_code: Optional[int] = Field(None, ge=1, example=2100, description="Hour Code", alias="hourCode")
91
93
  number_of_hours: Optional[float] = Field(None, ge=0, le=1000, example=40, description="Hours", alias="hours")
@@ -97,14 +99,16 @@ class FixedHoursUpdate(BaseModel):
97
99
  period_details: Optional[PeriodPost] = None
98
100
 
99
101
  class VariableHoursCreate(BaseModel):
102
+ employee_id: str = Field(..., example="3054d4cf-b449-489d-8d2e-5dd30e5ab994", description="Employee identifier", alias="employeeId")
100
103
  hour_code: int = Field(..., ge=1, example=2100, description="Hour Code", alias="hourCode")
101
104
  number_of_hours: float = Field(..., ge=0, le=1000, example=3.5, description="Hours", alias="hours")
102
105
  cost_center_id: Optional[str] = Field(None, example="aa506564-d1db-4fa8-83dc-d68db4cfcd82", description="Cost Center ID", alias="costCenterId")
103
106
  cost_unit_id: Optional[str] = Field(None, example="d8ac6afb-2ac6-43bf-9880-2d382cdace43", description="Cost Unit ID", alias="costUnitId")
104
107
  comment: Optional[str] = Field(None, example="Shift hours", description="Comment", alias="comment")
105
- period_details: Optional[PeriodPost] = Field(None, example="Period details", description="Period details", alias="periodDetails")
108
+ period_details: Optional[PeriodPost] = Field(None, example={"period": {"year": 2025, "period": 1}, "unprotectedMode": False}, description="Period details", alias="periodDetails")
106
109
 
107
110
  class VariableHoursUpdate(BaseModel):
111
+ employee_id: str = Field(..., description="Employee identifier", alias="employeeId")
108
112
  hour_component_id: str = Field(..., example="49a69eda-252e-4ccb-a220-38ea90511d4f", description="Hour Component ID", alias="hourComponentId")
109
113
  hour_code: Optional[int] = Field(None, ge=1, example=2100, description="Hour Code", alias="hourCode")
110
114
  number_of_hours: Optional[float] = Field(None, ge=0, le=1000, example=45.5, description="Hours", alias="hours")
@@ -1,12 +1,14 @@
1
+ from datetime import datetime
2
+ from enum import Enum
3
+ from typing import Annotated, Optional
4
+
1
5
  import pandas as pd
2
6
  import pandera as pa
3
- from pandera.typing import Series, String, Float, DateTime
4
7
  import pandera.extensions as extensions
5
- from brynq_sdk_functions import BrynQPanderaDataFrameModel
6
- from typing import Optional, Annotated
8
+ from pandera.typing import DateTime, Float, Series, String
7
9
  from pydantic import BaseModel, Field, StringConstraints
8
- from enum import Enum
9
- from datetime import datetime
10
+
11
+ from brynq_sdk_functions import BrynQPanderaDataFrameModel
10
12
 
11
13
 
12
14
  class LeaveGet(BrynQPanderaDataFrameModel):
@@ -48,7 +50,6 @@ class LeaveDelete(BaseModel):
48
50
 
49
51
  class LeaveUpdate(BaseModel):
50
52
  """Schema for updating leave via SOAP API."""
51
- employee_id: int = Field(..., example=12345, description="Employee ID", alias="employeeId")
52
53
  leave_id: int = Field(..., example=67890, description="Leave ID", alias="leaveId")
53
54
  start_date: datetime = Field(..., example="2025-01-01T00:00:00", description="Leave Start Date", alias="startDate")
54
55
  end_date: datetime = Field(..., example="2025-01-02T00:00:00", description="Leave End Date", alias="endDate")
@@ -62,3 +63,13 @@ class LeaveBalanceGet(BrynQPanderaDataFrameModel):
62
63
  employee_id: Series[String] = pa.Field(coerce=True, description="Employee ID", alias="employeeId")
63
64
  leave_group_id: Series[String] = pa.Field(coerce=True, nullable=True, description="Leave Group ID", alias="leaveGroupId")
64
65
  balance: Series[Float] = pa.Field(coerce=True, nullable=True, description="Leave Balance", alias="leaveBalance")
66
+
67
+ class _Annotation:
68
+ primary_key = "employee_id"
69
+ foreign_keys = {
70
+ "leave_group_id": {
71
+ "parent_schema": "LeaveGroupGet",
72
+ "parent_column": "leave_group_id",
73
+ "cardinality": "N:1"
74
+ }
75
+ }
@@ -1,13 +1,13 @@
1
1
  from datetime import datetime
2
+ from typing import Optional
2
3
 
3
4
  import pandas as pd
4
5
  import pandera as pa
5
- from pandera.typing import Series, String, Float, DateTime
6
- import pandera.extensions as extensions
6
+ from pandera.typing import Series
7
+ from pydantic import BaseModel, ConfigDict, Field
8
+
7
9
  from brynq_sdk_functions import BrynQPanderaDataFrameModel
8
10
 
9
- from typing import Optional
10
- from pydantic import BaseModel, Field
11
11
 
12
12
  # ---------------------------
13
13
  # Get Schemas
@@ -46,25 +46,10 @@ class ManagerBasicGet(BrynQPanderaDataFrameModel):
46
46
  class EmployeeManagerGet(BrynQPanderaDataFrameModel):
47
47
  employee_id: Series[pa.String] = pa.Field(coerce=True, description="Employee ID", alias="employeeId")
48
48
  manager_id: Series[pa.String] = pa.Field(coerce=True, description="Manager ID", alias="managerId")
49
- number: Series[pd.Int64Dtype] = pa.Field(coerce=True, description="Manager number", alias="number")
50
- first_name: Series[pa.String] = pa.Field(coerce=True, description="Manager first name", alias="firstName")
51
- last_name: Series[pa.String] = pa.Field(coerce=True, description="Manager last name", alias="lastName")
52
- gender: Series[pa.String] = pa.Field(coerce=True, nullable=True, description="Manager gender", alias="gender")
53
- phone_number: Series[pa.String] = pa.Field(coerce=True, nullable=True, description="Manager phone number", alias="phoneNumber")
54
- cellphone: Series[pa.String] = pa.Field(coerce=True, nullable=True, description="Manager cellphone", alias="cellphone")
55
- fax: Series[pa.String] = pa.Field(coerce=True, nullable=True, description="Manager fax", alias="fax")
56
- email: Series[pa.String] = pa.Field(coerce=True, nullable=True, description="Manager email", alias="email")
49
+ manager_first_name: Series[pa.String] = pa.Field(coerce=True, description="Manager first name", alias="firstName")
50
+ manager_last_name: Series[pa.String] = pa.Field(coerce=True, description="Manager last name", alias="lastName")
51
+ manager_email: Series[pa.String] = pa.Field(coerce=True, nullable=True, description="Manager email", alias="email")
57
52
  created_at: Series[datetime] = pa.Field(coerce=True, description="Manager created at", alias="createdAt")
58
- period_period: Series[pd.Int64Dtype] = pa.Field(coerce=True, description="Period", alias="period.period")
59
- period_year: Series[pd.Int64Dtype] = pa.Field(coerce=True, description="Year", alias="period.year")
60
- department_id: Series[pa.String] = pa.Field(coerce=True, nullable=True, description="Department ID", alias="department.departmentId")
61
- department_code: Series[pd.Int64Dtype] = pa.Field(coerce=True, nullable=True, description="Department Code", alias="department.code")
62
- department_description: Series[pa.String] = pa.Field(coerce=True, nullable=True, description="Department Description", alias="department.description")
63
- department_created_at: Series[datetime] = pa.Field(coerce=True, nullable=True, description="Department Created At", alias="department.createdAt")
64
- function_id: Series[pa.String] = pa.Field(coerce=True, nullable=True, description="Function ID", alias="function.functionId")
65
- function_code: Series[pd.Int64Dtype] = pa.Field(coerce=True, nullable=True, description="Function Code", alias="function.code")
66
- function_description: Series[pa.String] = pa.Field(coerce=True, nullable=True, description="Function Description", alias="function.description")
67
- function_created_at: Series[datetime] = pa.Field(coerce=True, nullable=True, description="Function Created At", alias="function.createdAt")
68
53
 
69
54
  class _Annotation:
70
55
  primary_key = "manager_id"
@@ -98,10 +83,13 @@ class ManagerHistoricBasicGet(BrynQPanderaDataFrameModel):
98
83
  # Upload Schemas
99
84
  # ---------------------------
100
85
  class Period(BaseModel):
86
+ model_config = ConfigDict(populate_by_name=True)
101
87
  year: int = Field(..., ge=1900, le=2100, example=2021, description="Year", alias="year")
102
88
  period: int = Field(..., ge=1, le=53, example=4, description="Period", alias="period")
103
89
 
104
90
  class ManagerCreate(BaseModel):
91
+ model_config = ConfigDict(populate_by_name=True)
92
+ debtor_id: str = Field(..., description="Debtor identifier", alias="debtorId")
105
93
  number: int = Field(..., ge=1, example=1, description="Manager number", alias="number")
106
94
  first_name: str = Field(..., max_length=100, example="John", description="Manager first name", alias="firstName")
107
95
  last_name: str = Field(..., max_length=100, example="Doe", description="Manager last name", alias="lastName")
@@ -112,12 +100,16 @@ class ManagerCreate(BaseModel):
112
100
  email: Optional[str] = Field(None, max_length=100, example="john.doe@company.com", description="Manager email", alias="email")
113
101
 
114
102
  class ManagerUpdate(BaseModel):
103
+ model_config = ConfigDict(populate_by_name=True)
104
+ debtor_id: str = Field(..., example="a1b2c3d4-e5f6-7890-abcd-ef1234567890", description="Debtor identifier", alias="debtorId")
115
105
  manager_id: str = Field(..., example="2f6aa11c-504a-49a1-903b-e15e79965702", description="Manager ID", alias="managerId")
116
- period_details: Period = Field(..., alias="periodDetails")
106
+ period_details: Period = Field(..., example={"year": 2021, "period": 4}, description="Period details", alias="periodDetails")
117
107
 
118
108
  class ManagerDelete(BaseModel):
109
+ model_config = ConfigDict(populate_by_name=True)
119
110
  manager_id: str = Field(..., example="2f6aa11c-504a-49a1-903b-e15e79965702", description="Manager ID", alias="managerId")
120
111
 
121
112
  class UpdateEmployeeManager(BaseModel):
113
+ model_config = ConfigDict(populate_by_name=True)
122
114
  manager_id: str = Field(..., example="2f6aa11c-504a-49a1-903b-e15e79965702", description="Manager ID", alias="managerId")
123
- period_details: Period = Field(..., alias="periodDetails")
115
+ period_details: Period = Field(..., example={"year": 2021, "period": 4}, description="Period details", alias="periodDetails")
@@ -29,7 +29,8 @@ class SalaryGet(BrynQPanderaDataFrameModel):
29
29
  "netParttimeSalaryExclWageComp",
30
30
  "netHourlyWageExclWageComp",
31
31
  "netHourlyWageInclWageComp",
32
- "employerCosts"
32
+ "employerCosts",
33
+ "0"
33
34
  ],
34
35
  description="Salary Type",
35
36
  alias="type"
@@ -100,6 +101,9 @@ class SalaryTableGet(BrynQPanderaDataFrameModel):
100
101
  guid_salary_table: Series[String] = pa.Field(coerce=True, description="GUID Salary table", alias="GuidSalaryTable")
101
102
  company_id: Series[String] = pa.Field(coerce=True, description="Company ID", alias="companyId")
102
103
 
104
+ class _Annotation:
105
+ primary_key = "guid_salary_table"
106
+
103
107
  class SalaryScalesGet(BrynQPanderaDataFrameModel):
104
108
  scale: Series[String] = pa.Field(coerce=True, description="Salary Scale", alias="Scale")
105
109
  description: Series[String] = pa.Field(coerce=True, description="Salary Scale Description", alias="SchaalDescription")
@@ -109,9 +113,15 @@ class SalaryScalesGet(BrynQPanderaDataFrameModel):
109
113
  guid_salary_table_scale: Series[String] = pa.Field(coerce=True, description="GUID Salary table scale", alias="GuidSalaryTableScale")
110
114
  company_id: Series[String] = pa.Field(coerce=True, description="Company ID", alias="companyId")
111
115
 
116
+ class _Annotation:
117
+ primary_key = "guid_salary_table_scale"
118
+
112
119
  class SalaryStepsGet(BrynQPanderaDataFrameModel):
113
120
  step: Series[String] = pa.Field(coerce=True, description="Salary Step", alias="Step")
114
121
  step_description: Series[String] = pa.Field(coerce=True, description="Salary Step Description", alias="StepDescription")
115
122
  step_value: Series[String] = pa.Field(coerce=True, description="Salary Step Value", alias="StepValue")
116
123
  guid_salary_table_step: Series[String] = pa.Field(coerce=True, description="GUID Salary Step table", alias="GuidSalaryTableStep")
117
124
  company_id: Series[String] = pa.Field(coerce=True, description="Company ID", alias="companyId")
125
+
126
+ class _Annotation:
127
+ primary_key = "guid_salary_table_step"
@@ -1,11 +1,8 @@
1
1
  from datetime import datetime
2
- from typing import Any, Dict, Optional
2
+ from typing import Optional
3
3
 
4
- import pandas as pd
5
4
  import pandera as pa
6
- import pandera.extensions as extensions
7
- from pandera import Bool, Int
8
- from pandera.typing import DateTime, Float, Series, String
5
+ from pandera.typing import Float, Series, String
9
6
  from pydantic import BaseModel, Field
10
7
 
11
8
  from brynq_sdk_functions import BrynQPanderaDataFrameModel
@@ -109,52 +106,3 @@ class ScheduleCreate(BaseModel):
109
106
  }
110
107
  }
111
108
  }
112
-
113
-
114
- class ScheduleUpdate(BaseModel):
115
- """
116
- Pydantic model for updating a schedule via SOAP API
117
- """
118
- employee_id: int = Field(..., example=12345, description="Employee ID", alias="employeeId")
119
- start_date: datetime = Field(..., example="2025-01-01T00:00:00", description="Start date of the schedule", alias="startDate")
120
- parttime_percentage: float = Field(..., ge=0, le=100, example=100.0, description="Part-time percentage", alias="parttimePercentage")
121
- company_rooster_nr: Optional[int] = Field(0, example=0, description="Company Rooster Number (schedule template)", alias="companyRoosterNr")
122
- hours_monday: Optional[float] = Field(0, ge=0, le=24, example=8.0, description="Hours Monday", alias="hoursMonday")
123
- hours_tuesday: Optional[float] = Field(0, ge=0, le=24, example=8.0, description="Hours Tuesday", alias="hoursTuesday")
124
- hours_wednesday: Optional[float] = Field(0, ge=0, le=24, example=8.0, description="Hours Wednesday", alias="hoursWednesday")
125
- hours_thursday: Optional[float] = Field(0, ge=0, le=24, example=8.0, description="Hours Thursday", alias="hoursThursday")
126
- hours_friday: Optional[float] = Field(0, ge=0, le=24, example=8.0, description="Hours Friday", alias="hoursFriday")
127
- hours_saturday: Optional[float] = Field(0, ge=0, le=24, example=0.0, description="Hours Saturday", alias="hoursSaturday")
128
- hours_sunday: Optional[float] = Field(0, ge=0, le=24, example=0.0, description="Hours Sunday", alias="hoursSunday")
129
- hours_monday2: Optional[float] = Field(0, ge=0, le=24, example=8.0, description="Hours Monday Week 2", alias="hoursMonday2")
130
- hours_tuesday2: Optional[float] = Field(0, ge=0, le=24, example=8.0, description="Hours Tuesday Week 2", alias="hoursTuesday2")
131
- hours_wednesday2: Optional[float] = Field(0, ge=0, le=24, example=8.0, description="Hours Wednesday Week 2", alias="hoursWednesday2")
132
- hours_thursday2: Optional[float] = Field(0, ge=0, le=24, example=8.0, description="Hours Thursday Week 2", alias="hoursThursday2")
133
- hours_friday2: Optional[float] = Field(0, ge=0, le=24, example=8.0, description="Hours Friday Week 2", alias="hoursFriday2")
134
- hours_saturday2: Optional[float] = Field(0, ge=0, le=24, example=0.0, description="Hours Saturday Week 2", alias="hoursSaturday2")
135
- hours_sunday2: Optional[float] = Field(0, ge=0, le=24, example=0.0, description="Hours Sunday Week 2", alias="hoursSunday2")
136
-
137
- def to_soap_schedule(self, soap_client):
138
- """Convert to SOAP Schedule object"""
139
- ScheduleType = soap_client.get_type('ns0:Schedule')
140
- return ScheduleType(
141
- StartDate=self.start_date,
142
- ParttimePercentage=self.parttime_percentage,
143
- HoursMonday=self.hours_monday or 0,
144
- HoursTuesday=self.hours_tuesday or 0,
145
- HoursWednesday=self.hours_wednesday or 0,
146
- HoursThursday=self.hours_thursday or 0,
147
- HoursFriday=self.hours_friday or 0,
148
- HoursSaturday=self.hours_saturday or 0,
149
- HoursSunday=self.hours_sunday or 0,
150
- HoursMonday2=self.hours_monday2 or 0,
151
- HoursTuesday2=self.hours_tuesday2 or 0,
152
- HoursWednesday2=self.hours_wednesday2 or 0,
153
- HoursThursday2=self.hours_thursday2 or 0,
154
- HoursFriday2=self.hours_friday2 or 0,
155
- HoursSaturday2=self.hours_saturday2 or 0,
156
- HoursSunday2=self.hours_sunday2 or 0
157
- )
158
-
159
- class Config:
160
- populate_by_name = True