brynq-sdk-nmbrs 2.3.1__py3-none-any.whl → 2.3.2.dev0__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.
- brynq_sdk_nmbrs/__init__.py +104 -84
- brynq_sdk_nmbrs/address.py +82 -2
- brynq_sdk_nmbrs/children.py +96 -61
- brynq_sdk_nmbrs/companies.py +45 -1
- brynq_sdk_nmbrs/costcenter.py +53 -8
- brynq_sdk_nmbrs/costunit.py +16 -4
- brynq_sdk_nmbrs/debtors.py +76 -2
- brynq_sdk_nmbrs/department.py +149 -28
- brynq_sdk_nmbrs/document.py +50 -0
- brynq_sdk_nmbrs/employee_wage_tax_settings.py +113 -0
- brynq_sdk_nmbrs/employees.py +119 -24
- brynq_sdk_nmbrs/employment.py +12 -4
- brynq_sdk_nmbrs/function.py +128 -2
- brynq_sdk_nmbrs/leave.py +105 -8
- brynq_sdk_nmbrs/salaries.py +78 -3
- brynq_sdk_nmbrs/schedules.py +77 -3
- brynq_sdk_nmbrs/schemas/address.py +30 -5
- brynq_sdk_nmbrs/schemas/bank.py +0 -2
- brynq_sdk_nmbrs/schemas/children.py +67 -0
- brynq_sdk_nmbrs/schemas/company.py +16 -0
- brynq_sdk_nmbrs/schemas/contracts.py +25 -11
- brynq_sdk_nmbrs/schemas/costcenter.py +57 -18
- brynq_sdk_nmbrs/schemas/costunit.py +0 -2
- brynq_sdk_nmbrs/schemas/days.py +0 -2
- brynq_sdk_nmbrs/schemas/debtor.py +23 -1
- brynq_sdk_nmbrs/schemas/department.py +41 -7
- brynq_sdk_nmbrs/schemas/document.py +13 -0
- brynq_sdk_nmbrs/schemas/employees.py +44 -38
- brynq_sdk_nmbrs/schemas/employment.py +10 -10
- brynq_sdk_nmbrs/schemas/function.py +34 -7
- brynq_sdk_nmbrs/schemas/hours.py +0 -4
- brynq_sdk_nmbrs/schemas/leave.py +12 -1
- brynq_sdk_nmbrs/schemas/manager.py +0 -3
- brynq_sdk_nmbrs/schemas/salary.py +37 -12
- brynq_sdk_nmbrs/schemas/schedules.py +49 -1
- brynq_sdk_nmbrs/schemas/social_insurance.py +39 -6
- brynq_sdk_nmbrs/schemas/wage_tax.py +68 -8
- brynq_sdk_nmbrs/schemas/wage_tax_settings.py +76 -0
- brynq_sdk_nmbrs/schemas/wagecomponents.py +0 -4
- brynq_sdk_nmbrs/social_insurance.py +81 -3
- brynq_sdk_nmbrs/wage_tax.py +105 -4
- {brynq_sdk_nmbrs-2.3.1.dist-info → brynq_sdk_nmbrs-2.3.2.dev0.dist-info}/METADATA +1 -1
- brynq_sdk_nmbrs-2.3.2.dev0.dist-info/RECORD +55 -0
- {brynq_sdk_nmbrs-2.3.1.dist-info → brynq_sdk_nmbrs-2.3.2.dev0.dist-info}/WHEEL +1 -1
- brynq_sdk_nmbrs-2.3.1.dist-info/RECORD +0 -50
- {brynq_sdk_nmbrs-2.3.1.dist-info → brynq_sdk_nmbrs-2.3.2.dev0.dist-info}/top_level.txt +0 -0
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import math
|
|
2
|
+
from typing import Annotated, Optional
|
|
3
|
+
|
|
2
4
|
import pandas as pd
|
|
3
5
|
import pandera as pa
|
|
4
|
-
from pandera.typing import Series, String, DateTime
|
|
5
6
|
import pandera.extensions as extensions
|
|
6
|
-
from
|
|
7
|
-
from typing import Optional, Annotated
|
|
7
|
+
from pandera.typing import DateTime, Series, String
|
|
8
8
|
from pydantic import BaseModel, Field, StringConstraints
|
|
9
9
|
|
|
10
|
+
from brynq_sdk_functions import BrynQPanderaDataFrameModel
|
|
11
|
+
|
|
12
|
+
|
|
10
13
|
# ---------------------------
|
|
11
14
|
# Get Schemas
|
|
12
15
|
# ---------------------------
|
|
@@ -14,29 +17,30 @@ class EmployeeGet(BrynQPanderaDataFrameModel):
|
|
|
14
17
|
employee_id: Series[String] = pa.Field(coerce=True, description="Employee ID", alias="employeeId")
|
|
15
18
|
personal_info_id: Series[String] = pa.Field(coerce=True, description="Personal Info ID", alias="personalInfoId")
|
|
16
19
|
created_at: Series[DateTime] = pa.Field(coerce=True, description="Employee Created At", alias="createdAt", nullable=True)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
20
|
+
employee_number: Series[pd.Int64Dtype] = pa.Field(coerce=True, description="Employee Number", alias="basicInfo.employeeNumber")
|
|
21
|
+
first_name: Series[String] = pa.Field(coerce=True, nullable=True, description="First Name", alias="basicInfo.firstName")
|
|
22
|
+
first_name_in_full: Series[String] = pa.Field(coerce=True, nullable=True, description="First Name In Full", alias="basicInfo.firstNameInFull")
|
|
23
|
+
prefix: Series[String] = pa.Field(coerce=True, nullable=True, description="Prefix", alias="basicInfo.prefix")
|
|
24
|
+
initials: Series[String] = pa.Field(coerce=True, nullable=True, description="Initials", alias="basicInfo.initials")
|
|
25
|
+
last_name: Series[String] = pa.Field(coerce=True, description="Last Name", alias="basicInfo.lastName")
|
|
26
|
+
employee_type: Series[String] = pa.Field(coerce=True, description="Employee Type", alias="basicInfo.employeeType")
|
|
27
|
+
birth_date: Series[DateTime] = pa.Field(coerce=True, description="Birth Date", alias="birthInfo.birthDate")
|
|
28
|
+
birth_country_code_iso: Optional[Series[String]] = pa.Field(coerce=True, nullable=True, description="Birth Country Code ISO", alias="birthInfo.birthCountry")
|
|
29
|
+
birth_country: Optional[Series[String]] = pa.Field(coerce=True, nullable=True, description="Birth Country Code ISO", alias="birthInfo.birthCountry.codeISO")
|
|
30
|
+
birth_country_description: Optional[Series[String]] = pa.Field(coerce=True, nullable=True, description="Birth Country Code ISO", alias="birthInfo.birthCountry.description")
|
|
31
|
+
nationality_code_iso: Series[String] = pa.Field(coerce=True, nullable=True, description="Nationality Code ISO", alias="birthInfo.nationality.codeISO")
|
|
32
|
+
gender: Series[String] = pa.Field(coerce=True, nullable=True, description="Gender", alias="birthInfo.gender")
|
|
33
|
+
private_email: Series[String] = pa.Field(coerce=True, nullable=True, description="Private Email", alias="contactInfo.privateEmail")
|
|
34
|
+
business_email: Series[String] = pa.Field(coerce=True, nullable=True, description="Business Email", alias="contactInfo.businessEmail")
|
|
35
|
+
business_phone: Series[String] = pa.Field(coerce=True, nullable=True, description="Business Phone", alias="contactInfo.businessPhone")
|
|
36
|
+
business_mobile_phone: Series[String] = pa.Field(coerce=True, nullable=True, description="Business Mobile Phone", alias="contactInfo.businessMobilePhone")
|
|
37
|
+
private_phone: Series[String] = pa.Field(coerce=True, nullable=True, description="Private Phone", alias="contactInfo.privatePhone")
|
|
38
|
+
private_mobile_phone: Series[String] = pa.Field(coerce=True, nullable=True, description="Private Mobile Phone", alias="contactInfo.privateMobilePhone")
|
|
39
|
+
other_phone: Series[String] = pa.Field(coerce=True, nullable=True, description="Other Phone", alias="contactInfo.otherPhone")
|
|
40
|
+
partner_prefix: Series[String] = pa.Field(coerce=True, nullable=True, description="Partner Prefix", alias="partnerInfo.partnerPrefix")
|
|
41
|
+
partner_name: Series[String] = pa.Field(coerce=True, nullable=True, description="Partner Name", alias="partnerInfo.partnerName")
|
|
37
42
|
period_year: Series[pd.Int64Dtype] = pa.Field(coerce=True, description="Year", alias="period.year")
|
|
38
43
|
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
44
|
company_id: Series[String] = pa.Field(coerce=True, description="Company ID", alias="companyId")
|
|
41
45
|
|
|
42
46
|
class _Annotation:
|
|
@@ -46,7 +50,7 @@ class EmployeeGet(BrynQPanderaDataFrameModel):
|
|
|
46
50
|
# Upload Schemas
|
|
47
51
|
# ---------------------------
|
|
48
52
|
class BasicInfo(BaseModel):
|
|
49
|
-
|
|
53
|
+
employee_number: Optional[int] = Field(None, ge=1, example=98072, description="Employee Number", alias="employeeNumber")
|
|
50
54
|
first_name: Optional[str] = Field(None, max_length=50, example="John", description="First Name", alias="firstName")
|
|
51
55
|
first_name_in_full: Optional[str] = Field(None, max_length=100, example="John in Full", description="First Name In Full", alias="firstNameInFull")
|
|
52
56
|
prefix: Optional[str] = Field(None, max_length=50, example="van der", description="Prefix", alias="prefix")
|
|
@@ -61,7 +65,7 @@ class BasicInfo(BaseModel):
|
|
|
61
65
|
] = Field(..., example="payroll", description="Employee Type", alias="employeeType")
|
|
62
66
|
|
|
63
67
|
class BasicInfoUpdate(BaseModel):
|
|
64
|
-
|
|
68
|
+
employee_number: Optional[int] = Field(None, ge=1, example=98072, description="Employee Number", alias="employeeNumber")
|
|
65
69
|
first_name: Optional[str] = Field(None, max_length=50, example="John", description="First Name", alias="firstName")
|
|
66
70
|
first_name_in_full: Optional[str] = Field(None, max_length=100, example="John in Full", description="First Name In Full", alias="firstNameInFull")
|
|
67
71
|
prefix: Optional[str] = Field(None, max_length=50, example="van der", description="Prefix", alias="prefix")
|
|
@@ -79,7 +83,7 @@ class BirthInfo(BaseModel):
|
|
|
79
83
|
max_length=3
|
|
80
84
|
)
|
|
81
85
|
]] = Field(None, example="NL", description="Birth Country Code ISO", alias="birthCountryCodeISO")
|
|
82
|
-
|
|
86
|
+
nationality_code_iso: Optional[Annotated[
|
|
83
87
|
str,
|
|
84
88
|
StringConstraints(
|
|
85
89
|
pattern=r'^[A-Za-z]+$',
|
|
@@ -92,16 +96,16 @@ class BirthInfo(BaseModel):
|
|
|
92
96
|
gender: Optional[Annotated[
|
|
93
97
|
str,
|
|
94
98
|
StringConstraints(
|
|
95
|
-
pattern=r'^(unspecified|male|female|unknown)$',
|
|
99
|
+
pattern=r'^(|unspecified|male|female|unknown)$',
|
|
96
100
|
strip_whitespace=True
|
|
97
101
|
)
|
|
98
102
|
]] = Field(None, example="male", description="Gender", alias="gender")
|
|
99
103
|
|
|
100
104
|
class ContactInfo(BaseModel):
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
+
private_email: Optional[str] = Field(None, max_length=100, example="doe@private.com", description="Private Email", alias="privateEmail")
|
|
106
|
+
business_email: Optional[str] = Field(None, max_length=100, example="doe@business.com", description="Business Email", alias="businessEmail")
|
|
107
|
+
business_phone: Optional[str] = Field(None, max_length=50, example="+351222222", description="Business Phone", alias="businessPhone")
|
|
108
|
+
business_mobile_phone: Optional[str] = Field(None, max_length=50, example="+351222222", description="Business Mobile Phone", alias="businessMobilePhone")
|
|
105
109
|
private_phone: Optional[str] = Field(None, max_length=50, example="+351222222", description="Private Phone", alias="privatePhone")
|
|
106
110
|
private_mobile_phone: Optional[str] = Field(None, max_length=50, example="+351222222", description="Private Mobile Phone", alias="privateMobilePhone")
|
|
107
111
|
other_phone: Optional[str] = Field(None, max_length=50, example="+351222222", description="Other Phone", alias="otherPhone")
|
|
@@ -112,12 +116,12 @@ class PartnerInfo(BaseModel):
|
|
|
112
116
|
ascription_code: Optional[int] = Field(None, ge=0, example=0, description="Ascription Code", alias="ascriptionCode")
|
|
113
117
|
|
|
114
118
|
class Period(BaseModel):
|
|
115
|
-
|
|
116
|
-
|
|
119
|
+
period_year: int = Field(..., ge=1900, le=2100, example=2021, description="Year", alias="year")
|
|
120
|
+
period_period: int = Field(..., ge=1, le=53, example=4, description="Period", alias="period")
|
|
117
121
|
|
|
118
122
|
class AdditionalEmployeeInfo(BaseModel):
|
|
119
|
-
in_service_date: str = Field(
|
|
120
|
-
default_employee_template: Optional[str] = Field(None, description="Default
|
|
123
|
+
in_service_date: Optional[str] = Field(None, example="2019-08-24", description="In Service Date", alias="inServiceDate")
|
|
124
|
+
default_employee_template: Optional[str] = Field(None, description="Default employee template unique identifier to be only used for employee's of type Payroll", alias="defaultEmployeeTemplate")
|
|
121
125
|
|
|
122
126
|
class CreateEmployeePersonalInfo(BaseModel):
|
|
123
127
|
basic_info: BasicInfo = Field(..., alias="basicInfo")
|
|
@@ -128,12 +132,10 @@ class CreateEmployeePersonalInfo(BaseModel):
|
|
|
128
132
|
created_at: Optional[str] = Field(None, example="2021-07-01T10:15:08Z", description="Created At", alias="createdAt")
|
|
129
133
|
|
|
130
134
|
class EmployeeCreate(BaseModel):
|
|
131
|
-
company_id: str = Field(..., description="Company identifier", alias="companyId")
|
|
132
135
|
personal_info: CreateEmployeePersonalInfo = Field(..., alias="personalInfo")
|
|
133
136
|
additional_employee_info: AdditionalEmployeeInfo = Field(..., alias="additionalEmployeeInfo")
|
|
134
137
|
|
|
135
138
|
class EmployeeUpdate(BaseModel):
|
|
136
|
-
employee_id: str = Field(..., description="Employee identifier", alias="employeeId")
|
|
137
139
|
basic_info: Optional[BasicInfoUpdate] = Field(None, alias="basicInfo")
|
|
138
140
|
birth_info: Optional[BirthInfo] = Field(None, alias="birthInfo")
|
|
139
141
|
contact_info: Optional[ContactInfo] = Field(None, alias="contactInfo")
|
|
@@ -151,3 +153,7 @@ class BsnGet(BrynQPanderaDataFrameModel):
|
|
|
151
153
|
|
|
152
154
|
class _Annotation:
|
|
153
155
|
primary_key = "employee_id"
|
|
156
|
+
|
|
157
|
+
class DefaultEmployeeTemplates(BrynQPanderaDataFrameModel):
|
|
158
|
+
default_employee_template: Series[String] = pa.Field(coerce=True, description="UID of the default employee tempalte", alias="defaultEmployeeTemplateId")
|
|
159
|
+
description: Series[String] = pa.Field(coerce=True, description="The description of the default employee template ")
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
from typing import Optional
|
|
3
|
+
|
|
1
4
|
import pandas as pd
|
|
2
5
|
import pandera as pa
|
|
3
|
-
from pandera import Bool
|
|
4
|
-
from pandera.typing import Series, String, Float, DateTime
|
|
5
6
|
import pandera.extensions as extensions
|
|
7
|
+
from pandera import Bool
|
|
8
|
+
from pandera.typing import DateTime, Float, Series, String
|
|
9
|
+
from pydantic import BaseModel, Field
|
|
10
|
+
|
|
6
11
|
from brynq_sdk_functions import BrynQPanderaDataFrameModel
|
|
7
12
|
|
|
8
|
-
from typing import Optional
|
|
9
|
-
from pydantic import BaseModel, Field
|
|
10
|
-
from datetime import datetime
|
|
11
13
|
|
|
12
14
|
# ---------------------------
|
|
13
15
|
# Get Schemas
|
|
@@ -33,16 +35,14 @@ class EmploymentGet(BrynQPanderaDataFrameModel):
|
|
|
33
35
|
# Upload Schemas
|
|
34
36
|
# ---------------------------
|
|
35
37
|
class EmploymentCreate(BaseModel):
|
|
36
|
-
employee_id: str = Field(..., description="Employee identifier", alias="employeeId")
|
|
37
38
|
start_date: datetime = Field(..., example="2021-06-07T07:59:11Z", description="Start Date Employment", alias="startDate")
|
|
38
39
|
seniority_date: Optional[datetime] = Field(None, example="2021-06-09T07:59:11Z", description="Seniority Date Employment", alias="seniorityDate")
|
|
39
40
|
|
|
40
41
|
class EmploymentUpdate(BaseModel):
|
|
41
|
-
employee_id: str = Field(..., description="Employee identifier", alias="employeeId")
|
|
42
42
|
employment_id: str = Field(..., example="a405f980-1c4c-42c1-8ddb-2d90c58da0b1", description="Employment ID", alias="employmentId")
|
|
43
43
|
seniority_date: Optional[datetime] = Field(None, example="2021-06-07T07:59:11Z", description="Seniority Date Employment", alias="seniorityDate")
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
end_date: Optional[datetime] = Field(None, example="2021-10-01T00:00:00Z", description="End of Service Date Employment", alias="endOfServiceDate")
|
|
45
|
+
end_contract_reason: Optional[int] = Field(None, ge=0, example=3, description="End of Contract Reason Employment", alias="endOfContractReason")
|
|
46
46
|
|
|
47
47
|
class EmploymentDelete(BaseModel):
|
|
48
|
-
employment_id: str = Field(..., example="a405f980-1c4c-42c1-8ddb-2d90c58da0b1", description="Employment ID", alias="employmentId")
|
|
48
|
+
employment_id: str = Field(..., example="a405f980-1c4c-42c1-8ddb-2d90c58da0b1", description="Employment ID", alias="employmentId")
|
|
@@ -1,13 +1,14 @@
|
|
|
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
6
|
import pandera.extensions as extensions
|
|
7
|
+
from pandera.typing import DateTime, Float, Series, String
|
|
8
|
+
from pydantic import BaseModel, Field
|
|
9
|
+
|
|
7
10
|
from brynq_sdk_functions import BrynQPanderaDataFrameModel
|
|
8
11
|
|
|
9
|
-
from typing import Optional
|
|
10
|
-
from pydantic import BaseModel, Field
|
|
11
12
|
|
|
12
13
|
# ---------------------------
|
|
13
14
|
# Get Schemas
|
|
@@ -35,16 +36,42 @@ class EmployeeFunctionGet(BrynQPanderaDataFrameModel):
|
|
|
35
36
|
# Upload Schemas
|
|
36
37
|
# ---------------------------
|
|
37
38
|
class Period(BaseModel):
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
period_year: int = Field(..., ge=1900, le=2100, example=2021, description="Year", alias="year")
|
|
40
|
+
period_period: int = Field(..., ge=1, le=53, example=4, description="Period", alias="period")
|
|
40
41
|
|
|
41
42
|
class FunctionGet(BrynQPanderaDataFrameModel):
|
|
42
43
|
function_id: Series[pa.String] = pa.Field(coerce=True, description="Function ID", alias="functionId")
|
|
43
44
|
code: Series[pd.Int64Dtype] = pa.Field(coerce=True, description="Function Code", alias="code")
|
|
44
45
|
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
46
|
|
|
47
47
|
class FunctionUpdate(BaseModel):
|
|
48
|
-
employee_id: str = Field(..., description="Employee identifier", alias="employeeId")
|
|
49
48
|
function_id: str = Field(..., example="5981", description="Function ID", alias="functionId")
|
|
50
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
|
brynq_sdk_nmbrs/schemas/hours.py
CHANGED
|
@@ -76,7 +76,6 @@ 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")
|
|
80
79
|
hour_code: int = Field(..., ge=1, example=2100, description="Hour Code", alias="hourCode")
|
|
81
80
|
number_of_hours: float = Field(..., ge=0, le=1000, example=40, description="Hours", alias="hours")
|
|
82
81
|
cost_center_id: Optional[str] = Field(None, example="aa506564-d1db-4fa8-83dc-d68db4cfcd82", description="Cost Center ID", alias="costCenterId")
|
|
@@ -87,7 +86,6 @@ class FixedHoursCreate(BaseModel):
|
|
|
87
86
|
period_details: Optional[PeriodPost] = None
|
|
88
87
|
|
|
89
88
|
class FixedHoursUpdate(BaseModel):
|
|
90
|
-
employee_id: str = Field(..., description="Employee identifier", alias="employeeId")
|
|
91
89
|
hour_component_id: str = Field(..., example="ddaae291-47fa-4c67-bb2f-de0e5da9e8a1", description="Hour Component ID", alias="hourComponentId")
|
|
92
90
|
hour_code: Optional[int] = Field(None, ge=1, example=2100, description="Hour Code", alias="hourCode")
|
|
93
91
|
number_of_hours: Optional[float] = Field(None, ge=0, le=1000, example=40, description="Hours", alias="hours")
|
|
@@ -99,7 +97,6 @@ class FixedHoursUpdate(BaseModel):
|
|
|
99
97
|
period_details: Optional[PeriodPost] = None
|
|
100
98
|
|
|
101
99
|
class VariableHoursCreate(BaseModel):
|
|
102
|
-
employee_id: str = Field(..., description="Employee identifier", alias="employeeId")
|
|
103
100
|
hour_code: int = Field(..., ge=1, example=2100, description="Hour Code", alias="hourCode")
|
|
104
101
|
number_of_hours: float = Field(..., ge=0, le=1000, example=3.5, description="Hours", alias="hours")
|
|
105
102
|
cost_center_id: Optional[str] = Field(None, example="aa506564-d1db-4fa8-83dc-d68db4cfcd82", description="Cost Center ID", alias="costCenterId")
|
|
@@ -108,7 +105,6 @@ class VariableHoursCreate(BaseModel):
|
|
|
108
105
|
period_details: Optional[PeriodPost] = Field(None, example="Period details", description="Period details", alias="periodDetails")
|
|
109
106
|
|
|
110
107
|
class VariableHoursUpdate(BaseModel):
|
|
111
|
-
employee_id: str = Field(..., description="Employee identifier", alias="employeeId")
|
|
112
108
|
hour_component_id: str = Field(..., example="49a69eda-252e-4ccb-a220-38ea90511d4f", description="Hour Component ID", alias="hourComponentId")
|
|
113
109
|
hour_code: Optional[int] = Field(None, ge=1, example=2100, description="Hour Code", alias="hourCode")
|
|
114
110
|
number_of_hours: Optional[float] = Field(None, ge=0, le=1000, example=45.5, description="Hours", alias="hours")
|
brynq_sdk_nmbrs/schemas/leave.py
CHANGED
|
@@ -33,7 +33,6 @@ class LeaveGet(BrynQPanderaDataFrameModel):
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
class LeaveCreate(BaseModel):
|
|
36
|
-
employee_id: str = Field(..., description="Employee identifier", alias="employeeId")
|
|
37
36
|
leave_group_id: str = Field(..., example="49a69eda-252e-4ccb-a220-38ea90511d4f", description="Leave Group ID", alias="leaveGroupId")
|
|
38
37
|
start_date: datetime = Field(..., example="2025-01-01", description="Leave Start Date", alias="startDate")
|
|
39
38
|
end_date: datetime = Field(..., example="2025-01-02", description="Leave End Date", alias="endDate")
|
|
@@ -47,6 +46,18 @@ class LeaveDelete(BaseModel):
|
|
|
47
46
|
leave_request_id: str = Field(..., example="49a69eda-252e-4ccb-a220-38ea90511d4f", description="Leave Request ID", alias="leaveRequestId")
|
|
48
47
|
|
|
49
48
|
|
|
49
|
+
class LeaveUpdate(BaseModel):
|
|
50
|
+
"""Schema for updating leave via SOAP API."""
|
|
51
|
+
employee_id: int = Field(..., example=12345, description="Employee ID", alias="employeeId")
|
|
52
|
+
leave_id: int = Field(..., example=67890, description="Leave ID", alias="leaveId")
|
|
53
|
+
start_date: datetime = Field(..., example="2025-01-01T00:00:00", description="Leave Start Date", alias="startDate")
|
|
54
|
+
end_date: datetime = Field(..., example="2025-01-02T00:00:00", description="Leave End Date", alias="endDate")
|
|
55
|
+
description: Optional[str] = Field(None, example="Vacation leave", description="Description", alias="description")
|
|
56
|
+
|
|
57
|
+
class Config:
|
|
58
|
+
populate_by_name = True
|
|
59
|
+
|
|
60
|
+
|
|
50
61
|
class LeaveBalanceGet(BrynQPanderaDataFrameModel):
|
|
51
62
|
employee_id: Series[String] = pa.Field(coerce=True, description="Employee ID", alias="employeeId")
|
|
52
63
|
leave_group_id: Series[String] = pa.Field(coerce=True, nullable=True, description="Leave Group ID", alias="leaveGroupId")
|
|
@@ -102,7 +102,6 @@ class Period(BaseModel):
|
|
|
102
102
|
period: int = Field(..., ge=1, le=53, example=4, description="Period", alias="period")
|
|
103
103
|
|
|
104
104
|
class ManagerCreate(BaseModel):
|
|
105
|
-
debtor_id: str = Field(..., description="Debtor identifier", alias="debtorId")
|
|
106
105
|
number: int = Field(..., ge=1, example=1, description="Manager number", alias="number")
|
|
107
106
|
first_name: str = Field(..., max_length=100, example="John", description="Manager first name", alias="firstName")
|
|
108
107
|
last_name: str = Field(..., max_length=100, example="Doe", description="Manager last name", alias="lastName")
|
|
@@ -113,7 +112,6 @@ class ManagerCreate(BaseModel):
|
|
|
113
112
|
email: Optional[str] = Field(None, max_length=100, example="john.doe@company.com", description="Manager email", alias="email")
|
|
114
113
|
|
|
115
114
|
class ManagerUpdate(BaseModel):
|
|
116
|
-
debtor_id: str = Field(..., description="Debtor identifier", alias="debtorId")
|
|
117
115
|
manager_id: str = Field(..., example="2f6aa11c-504a-49a1-903b-e15e79965702", description="Manager ID", alias="managerId")
|
|
118
116
|
period_details: Period = Field(..., alias="periodDetails")
|
|
119
117
|
|
|
@@ -121,6 +119,5 @@ class ManagerDelete(BaseModel):
|
|
|
121
119
|
manager_id: str = Field(..., example="2f6aa11c-504a-49a1-903b-e15e79965702", description="Manager ID", alias="managerId")
|
|
122
120
|
|
|
123
121
|
class UpdateEmployeeManager(BaseModel):
|
|
124
|
-
employee_id: str = Field(..., description="Employee identifier", alias="employeeId")
|
|
125
122
|
manager_id: str = Field(..., example="2f6aa11c-504a-49a1-903b-e15e79965702", description="Manager ID", alias="managerId")
|
|
126
123
|
period_details: Period = Field(..., alias="periodDetails")
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import math
|
|
2
|
+
from datetime import datetime
|
|
3
|
+
from typing import Annotated, Optional
|
|
4
|
+
|
|
2
5
|
import pandas as pd
|
|
3
6
|
import pandera as pa
|
|
4
|
-
from pandera import Bool
|
|
5
|
-
from pandera.typing import Series, String, Float, DateTime
|
|
6
7
|
import pandera.extensions as extensions
|
|
8
|
+
from pandera import Bool
|
|
9
|
+
from pandera.typing import DateTime, Float, Series, String
|
|
10
|
+
from pydantic import BaseModel, Field, StringConstraints, model_serializer
|
|
11
|
+
|
|
7
12
|
from brynq_sdk_functions import BrynQPanderaDataFrameModel
|
|
8
13
|
|
|
9
|
-
from typing import Optional, Annotated
|
|
10
|
-
from pydantic import BaseModel, Field, StringConstraints
|
|
11
|
-
from datetime import datetime
|
|
12
14
|
|
|
13
15
|
# ---------------------------
|
|
14
16
|
# Get Schemas
|
|
@@ -16,7 +18,7 @@ from datetime import datetime
|
|
|
16
18
|
class SalaryGet(BrynQPanderaDataFrameModel):
|
|
17
19
|
employee_id: Series[String] = pa.Field(coerce=True, description="Employee ID", alias="employeeId")
|
|
18
20
|
salary_id: Series[String] = pa.Field(coerce=True, description="Salary ID", alias="salaryId")
|
|
19
|
-
|
|
21
|
+
start_date_salary: Series[DateTime] = pa.Field(coerce=True, description="Start Date", alias="startDate")
|
|
20
22
|
salary_type: Series[String] = pa.Field(
|
|
21
23
|
coerce=True,
|
|
22
24
|
isin=[
|
|
@@ -32,7 +34,7 @@ class SalaryGet(BrynQPanderaDataFrameModel):
|
|
|
32
34
|
description="Salary Type",
|
|
33
35
|
alias="type"
|
|
34
36
|
)
|
|
35
|
-
|
|
37
|
+
salary_amount: Series[Float] = pa.Field(coerce=True, nullable=True, description="Value", alias="value")
|
|
36
38
|
created_at: Series[DateTime] = pa.Field(coerce=True, description="Created At", alias="createdAt")
|
|
37
39
|
|
|
38
40
|
class _Annotation:
|
|
@@ -54,7 +56,6 @@ class SalaryTableUpdate(BaseModel):
|
|
|
54
56
|
step_id: Optional[str] = Field(None, example="c9c6feef-cd69-4773-8602-f70fa3b561e4", description="Step ID", alias="stepId")
|
|
55
57
|
|
|
56
58
|
class SalaryCreate(BaseModel):
|
|
57
|
-
employee_id: str = Field(..., description="Employee identifier", alias="employeeId")
|
|
58
59
|
start_date_salary: datetime = Field(..., example="2021-08-01T00:00:00Z", description="Start Date", alias="startDate")
|
|
59
60
|
salary_type: Optional[Annotated[
|
|
60
61
|
str,
|
|
@@ -64,10 +65,34 @@ class SalaryCreate(BaseModel):
|
|
|
64
65
|
)
|
|
65
66
|
]] = Field(None, example="grossFulltimeSalary", description="Salary Type", alias="type")
|
|
66
67
|
salary_amount: Optional[float] = Field(None, ge=0, example=3480.95, description="Value", alias="value")
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
salary_table_update: Optional[SalaryTableUpdate] = Field(default=None, description="Salary Table Update", alias="salaryTable")
|
|
69
|
+
|
|
70
|
+
@model_serializer(mode='wrap')
|
|
71
|
+
def serialize_model(self, serializer, info):
|
|
72
|
+
data = serializer(self)
|
|
73
|
+
# Exclude salaryTable if it exists but all its nested fields are None
|
|
74
|
+
if 'salaryTable' in data and data['salaryTable'] is not None:
|
|
75
|
+
if isinstance(data['salaryTable'], dict) and all(v is None for v in data['salaryTable'].values()):
|
|
76
|
+
data.pop('salaryTable')
|
|
77
|
+
return data
|
|
78
|
+
|
|
79
|
+
class Config:
|
|
80
|
+
populate_by_name = True
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
class SalaryUpdate(BaseModel):
|
|
84
|
+
"""Schema for updating salary via SOAP API (Salary_UpdateCurrent)."""
|
|
85
|
+
employee_id: int = Field(..., example=12345, description="Employee ID", alias="employeeId")
|
|
86
|
+
salary_value: float = Field(..., ge=0, example=5000.00, description="Salary value (gross amount)", alias="salaryValue")
|
|
87
|
+
salary_type: str = Field(
|
|
88
|
+
"Bruto_Salaris_Fulltime",
|
|
89
|
+
example="Bruto_Salaris_Fulltime",
|
|
90
|
+
description="Salary type enum: Bruto_Salaris_Fulltime, Bruto_Salaris_Parttime, Bruto_Uurloon, etc.",
|
|
91
|
+
alias="salaryType"
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
class Config:
|
|
95
|
+
populate_by_name = True
|
|
71
96
|
|
|
72
97
|
class SalaryTableGet(BrynQPanderaDataFrameModel):
|
|
73
98
|
code: Series[String] = pa.Field(coerce=True, description="Salary Code", alias="Code")
|
|
@@ -60,7 +60,6 @@ class ScheduleCreate(BaseModel):
|
|
|
60
60
|
"""
|
|
61
61
|
Pydantic model for creating a new schedule
|
|
62
62
|
"""
|
|
63
|
-
employee_id: str = Field(..., description="Employee identifier", alias="employeeId")
|
|
64
63
|
start_date_schedule: datetime = Field(..., description="Start date of the schedule", example="2021-01-01T09:29:18Z", alias="startDate")
|
|
65
64
|
hours_per_week: Optional[float] = Field(None, description="Hours per week", example=40, alias="hoursPerWeek")
|
|
66
65
|
week1: Optional[ScheduleHours] = Field(None, description="Week 1 schedule hours", alias="week1")
|
|
@@ -94,3 +93,52 @@ class ScheduleCreate(BaseModel):
|
|
|
94
93
|
}
|
|
95
94
|
}
|
|
96
95
|
}
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
class ScheduleUpdate(BaseModel):
|
|
99
|
+
"""
|
|
100
|
+
Pydantic model for updating a schedule via SOAP API
|
|
101
|
+
"""
|
|
102
|
+
employee_id: int = Field(..., example=12345, description="Employee ID", alias="employeeId")
|
|
103
|
+
start_date: datetime = Field(..., example="2025-01-01T00:00:00", description="Start date of the schedule", alias="startDate")
|
|
104
|
+
parttime_percentage: float = Field(..., ge=0, le=100, example=100.0, description="Part-time percentage", alias="parttimePercentage")
|
|
105
|
+
company_rooster_nr: Optional[int] = Field(0, example=0, description="Company Rooster Number (schedule template)", alias="companyRoosterNr")
|
|
106
|
+
hours_monday: Optional[float] = Field(0, ge=0, le=24, example=8.0, description="Hours Monday", alias="hoursMonday")
|
|
107
|
+
hours_tuesday: Optional[float] = Field(0, ge=0, le=24, example=8.0, description="Hours Tuesday", alias="hoursTuesday")
|
|
108
|
+
hours_wednesday: Optional[float] = Field(0, ge=0, le=24, example=8.0, description="Hours Wednesday", alias="hoursWednesday")
|
|
109
|
+
hours_thursday: Optional[float] = Field(0, ge=0, le=24, example=8.0, description="Hours Thursday", alias="hoursThursday")
|
|
110
|
+
hours_friday: Optional[float] = Field(0, ge=0, le=24, example=8.0, description="Hours Friday", alias="hoursFriday")
|
|
111
|
+
hours_saturday: Optional[float] = Field(0, ge=0, le=24, example=0.0, description="Hours Saturday", alias="hoursSaturday")
|
|
112
|
+
hours_sunday: Optional[float] = Field(0, ge=0, le=24, example=0.0, description="Hours Sunday", alias="hoursSunday")
|
|
113
|
+
hours_monday2: Optional[float] = Field(0, ge=0, le=24, example=8.0, description="Hours Monday Week 2", alias="hoursMonday2")
|
|
114
|
+
hours_tuesday2: Optional[float] = Field(0, ge=0, le=24, example=8.0, description="Hours Tuesday Week 2", alias="hoursTuesday2")
|
|
115
|
+
hours_wednesday2: Optional[float] = Field(0, ge=0, le=24, example=8.0, description="Hours Wednesday Week 2", alias="hoursWednesday2")
|
|
116
|
+
hours_thursday2: Optional[float] = Field(0, ge=0, le=24, example=8.0, description="Hours Thursday Week 2", alias="hoursThursday2")
|
|
117
|
+
hours_friday2: Optional[float] = Field(0, ge=0, le=24, example=8.0, description="Hours Friday Week 2", alias="hoursFriday2")
|
|
118
|
+
hours_saturday2: Optional[float] = Field(0, ge=0, le=24, example=0.0, description="Hours Saturday Week 2", alias="hoursSaturday2")
|
|
119
|
+
hours_sunday2: Optional[float] = Field(0, ge=0, le=24, example=0.0, description="Hours Sunday Week 2", alias="hoursSunday2")
|
|
120
|
+
|
|
121
|
+
def to_soap_schedule(self, soap_client):
|
|
122
|
+
"""Convert to SOAP Schedule object"""
|
|
123
|
+
ScheduleType = soap_client.get_type('ns0:Schedule')
|
|
124
|
+
return ScheduleType(
|
|
125
|
+
StartDate=self.start_date,
|
|
126
|
+
ParttimePercentage=self.parttime_percentage,
|
|
127
|
+
HoursMonday=self.hours_monday or 0,
|
|
128
|
+
HoursTuesday=self.hours_tuesday or 0,
|
|
129
|
+
HoursWednesday=self.hours_wednesday or 0,
|
|
130
|
+
HoursThursday=self.hours_thursday or 0,
|
|
131
|
+
HoursFriday=self.hours_friday or 0,
|
|
132
|
+
HoursSaturday=self.hours_saturday or 0,
|
|
133
|
+
HoursSunday=self.hours_sunday or 0,
|
|
134
|
+
HoursMonday2=self.hours_monday2 or 0,
|
|
135
|
+
HoursTuesday2=self.hours_tuesday2 or 0,
|
|
136
|
+
HoursWednesday2=self.hours_wednesday2 or 0,
|
|
137
|
+
HoursThursday2=self.hours_thursday2 or 0,
|
|
138
|
+
HoursFriday2=self.hours_friday2 or 0,
|
|
139
|
+
HoursSaturday2=self.hours_saturday2 or 0,
|
|
140
|
+
HoursSunday2=self.hours_sunday2 or 0
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
class Config:
|
|
144
|
+
populate_by_name = True
|
|
@@ -1,14 +1,47 @@
|
|
|
1
|
-
import math
|
|
2
1
|
import pandas as pd
|
|
3
2
|
import pandera as pa
|
|
4
3
|
from pandera import Bool
|
|
5
|
-
from pandera.typing import Series, String,
|
|
6
|
-
import pandera.extensions as extensions
|
|
4
|
+
from pandera.typing import Series, String, DateTime
|
|
7
5
|
from brynq_sdk_functions import BrynQPanderaDataFrameModel
|
|
8
|
-
from typing import Optional
|
|
9
|
-
from pydantic import BaseModel, Field
|
|
10
|
-
from datetime import datetime
|
|
6
|
+
from typing import Optional
|
|
7
|
+
from pydantic import BaseModel, Field
|
|
11
8
|
|
|
9
|
+
# ---------------------------
|
|
10
|
+
# Get Schemas
|
|
11
|
+
# ---------------------------
|
|
12
|
+
class SocialInsuranceGet(BrynQPanderaDataFrameModel):
|
|
13
|
+
employee_id: Series[String] = pa.Field(coerce=True, description="Employee ID", alias="employee_id")
|
|
14
|
+
id: Series[String] = pa.Field(coerce=True, description="SVW Settings ID", alias="Id")
|
|
15
|
+
creation_date: Series[DateTime] = pa.Field(coerce=True, nullable=True, description="Creation Date", alias="CreationDate")
|
|
16
|
+
start_period: Series[pd.Int64Dtype] = pa.Field(coerce=True, nullable=True, description="Start Period", alias="StartPeriod")
|
|
17
|
+
start_year: Series[pd.Int64Dtype] = pa.Field(coerce=True, nullable=True, description="Start Year", alias="StartYear")
|
|
18
|
+
influence_obliged_insurance: Series[Bool] = pa.Field(coerce=True, nullable=True, description="Whether employee influences obligatory insurance status", alias="InfluenceObligedInsurance")
|
|
19
|
+
wage_cost_benefit: Series[Bool] = pa.Field(coerce=True, nullable=True, description="Eligible for wage cost subsidy (LKV - Loonkostenvoordeel)", alias="WageCostBenefit")
|
|
20
|
+
cao: Series[String] = pa.Field(coerce=True, nullable=True, description="Collectieve Arbeidsovereenkomst (Collective Labor Agreement)", alias="CAO")
|
|
21
|
+
wao_wia: Series[Bool] = pa.Field(coerce=True, nullable=True, description="Disability Insurance (WAO/WIA - Wet Arbeidsongeschiktheid)", alias="Wao_Wia")
|
|
22
|
+
ww: Series[Bool] = pa.Field(coerce=True, nullable=True, description="Unemployment Insurance (WW - Werkloosheidswet)", alias="Ww")
|
|
23
|
+
zw: Series[Bool] = pa.Field(coerce=True, nullable=True, description="Sickness Benefits (ZW - Ziektewet)", alias="Zw")
|
|
24
|
+
income_related_contribution_zvw: Series[Bool] = pa.Field(coerce=True, nullable=True, description="Income Related Health Insurance Contribution (ZVW - Zorgverzekeringswet)", alias="IncomeRelatedContributionZvw")
|
|
25
|
+
code_zvw: Series[String] = pa.Field(coerce=True, nullable=True, description="Health Insurance Code (ZVW)", alias="CodeZvw")
|
|
26
|
+
risk_group: Series[String] = pa.Field(coerce=True, nullable=True, description="Risk Group for premium calculation", alias="RiskGroup")
|
|
27
|
+
sector: Series[String] = pa.Field(coerce=True, nullable=True, description="Industry Sector code", alias="Sector")
|
|
28
|
+
employment_type: Series[pd.Int64Dtype] = pa.Field(coerce=True, nullable=True, description="Employment Type", alias="EmploymentType")
|
|
29
|
+
phase_classification: Series[pd.Int64Dtype] = pa.Field(coerce=True, nullable=True, description="Phase Classification", alias="PhaseClassification")
|
|
30
|
+
employment_sequence_tax_id: Series[pd.Int64Dtype] = pa.Field(coerce=True, nullable=True, description="Employment Sequence Tax ID", alias="EmploymentSequenceTaxId")
|
|
31
|
+
|
|
32
|
+
class _Annotation:
|
|
33
|
+
primary_key = "id"
|
|
34
|
+
foreign_keys = {
|
|
35
|
+
"employee_id": {
|
|
36
|
+
"parent_schema": "EmployeeSchema",
|
|
37
|
+
"parent_column": "employee_id",
|
|
38
|
+
"cardinality": "N:1"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
# ---------------------------
|
|
43
|
+
# Upload Schemas
|
|
44
|
+
# ---------------------------
|
|
12
45
|
class SocialInsuranceUpdate(BaseModel):
|
|
13
46
|
employee_id: int = Field(None, example="1234567890", description="Employee ID", alias="EmployeeId")
|
|
14
47
|
influence_obliged_insurance: Optional[bool] = Field(None, example="1234567890", description="Influence Obliged Insurance", alias="InfluenceObligedInsurance")
|