brynq-sdk-meta4 1.0.1__py3-none-any.whl → 1.0.1.dev3__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_meta4/meta4.py +6 -6
- brynq_sdk_meta4/schemas/employee.py +34 -27
- {brynq_sdk_meta4-1.0.1.dist-info → brynq_sdk_meta4-1.0.1.dev3.dist-info}/METADATA +1 -1
- {brynq_sdk_meta4-1.0.1.dist-info → brynq_sdk_meta4-1.0.1.dev3.dist-info}/RECORD +6 -6
- {brynq_sdk_meta4-1.0.1.dist-info → brynq_sdk_meta4-1.0.1.dev3.dist-info}/WHEEL +1 -1
- {brynq_sdk_meta4-1.0.1.dist-info → brynq_sdk_meta4-1.0.1.dev3.dist-info}/top_level.txt +0 -0
brynq_sdk_meta4/meta4.py
CHANGED
|
@@ -25,11 +25,11 @@ class Meta4(BrynQ):
|
|
|
25
25
|
|
|
26
26
|
self.output_path = output_path
|
|
27
27
|
# SFTP client as a composition attribute
|
|
28
|
-
self.sftp = SFTP()
|
|
29
|
-
credentials = self.interfaces.credentials.get(system="meta-4", system_type=system_type)
|
|
30
|
-
credentials = credentials.get('data', credentials)
|
|
28
|
+
# self.sftp = SFTP()
|
|
29
|
+
# credentials = self.interfaces.credentials.get(system="meta-4", system_type=system_type)
|
|
30
|
+
# credentials = credentials.get('data', credentials)
|
|
31
31
|
|
|
32
|
-
self.sftp._set_credentials(credentials)
|
|
32
|
+
# self.sftp._set_credentials(credentials)
|
|
33
33
|
|
|
34
34
|
# Initialize entity classes
|
|
35
35
|
self.employees = Employees(self)
|
|
@@ -56,8 +56,8 @@ class Meta4(BrynQ):
|
|
|
56
56
|
})
|
|
57
57
|
|
|
58
58
|
# Print invalid data count
|
|
59
|
-
if invalid_data:
|
|
60
|
-
|
|
59
|
+
# if invalid_data:
|
|
60
|
+
# print(f" {len(invalid_data)} lines of {schema.__name__} data validation failed:")
|
|
61
61
|
|
|
62
62
|
# Convert to DataFrame
|
|
63
63
|
df = pd.DataFrame(valid_data)
|
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
from pydantic import BaseModel, Field, field_validator, model_validator
|
|
2
|
-
from typing import Optional, Literal
|
|
3
1
|
from datetime import datetime
|
|
2
|
+
from typing import Literal, Optional
|
|
3
|
+
|
|
4
|
+
from pydantic import BaseModel, Field, field_validator, model_validator
|
|
5
|
+
|
|
4
6
|
from .reference_enums import (
|
|
5
|
-
|
|
7
|
+
AdjustmentType,
|
|
8
|
+
ContractType,
|
|
9
|
+
DisabilityHRType,
|
|
6
10
|
DocumentType,
|
|
7
11
|
GenderType,
|
|
8
|
-
MaritalStatusType,
|
|
9
|
-
StreetType,
|
|
10
12
|
HoursType,
|
|
11
|
-
PartTimeType,
|
|
12
|
-
SSNumberType,
|
|
13
|
-
YesNoType,
|
|
14
|
-
SalaryType,
|
|
15
|
-
AdjustmentType,
|
|
16
|
-
PaymentType,
|
|
17
|
-
IRPFType,
|
|
18
13
|
IRPFStatusType,
|
|
19
|
-
|
|
14
|
+
IRPFType,
|
|
15
|
+
LaborRelationshipType,
|
|
20
16
|
ManagementType,
|
|
17
|
+
MaritalStatusType,
|
|
18
|
+
MovementType,
|
|
19
|
+
PartTimeType,
|
|
20
|
+
PaymentType,
|
|
21
21
|
PerceptionKeyType,
|
|
22
22
|
ReductionReasonType,
|
|
23
|
+
SalaryType,
|
|
24
|
+
SSNumberType,
|
|
25
|
+
StreetType,
|
|
26
|
+
SubstitutionCauseType,
|
|
23
27
|
TerminationReasonType,
|
|
24
28
|
UnemploymentCauseType,
|
|
25
|
-
|
|
26
|
-
LaborRelationshipType,
|
|
27
|
-
SubstitutionCauseType
|
|
29
|
+
YesNoType,
|
|
28
30
|
)
|
|
29
31
|
|
|
30
32
|
|
|
@@ -65,7 +67,7 @@ class EmployeeSchema(BaseModel):
|
|
|
65
67
|
street_type: Optional[StreetType] = Field(None, description="Tipo vía", example=StreetType.CALLE, alias="TIPO VÍA")
|
|
66
68
|
send_mail: Optional[Literal["0"]] = Field(None, description="Enviar correo", example="0", alias="ENVIAR CORREO")
|
|
67
69
|
employee_address: Optional[str] = Field(None, description="Dirección del empleado", example="Calle Mayor", alias="DIRECCIÓN DEL EMPLEADO")
|
|
68
|
-
street_number: Optional[
|
|
70
|
+
street_number: Optional[str] = Field(None, description="Número", example="123", alias="NÚMERO")
|
|
69
71
|
building: Optional[str] = Field(None, description="Bloque", example="A", alias="BLOQUE")
|
|
70
72
|
staircase: Optional[str] = Field(None, description="Escalera", example="1", alias="ESCALERA")
|
|
71
73
|
floor: Optional[str] = Field(None, description="Piso", example="2", alias="PISO")
|
|
@@ -79,6 +81,7 @@ class EmployeeSchema(BaseModel):
|
|
|
79
81
|
# Employment Information
|
|
80
82
|
company: Optional[str] = Field(None, description="Empresa", example="EMPRESA001", alias="EMPRESA")
|
|
81
83
|
job: Optional[str] = Field(None, description="Puesto", example="ANALISTA", alias="PUESTO")
|
|
84
|
+
job_id: Optional[str] = Field(None, description="ID Puesto", example="ANALISTA", alias="ID PUESTO")
|
|
82
85
|
position: Optional[str] = Field(None, description="Posición", example="", alias="POSICION")
|
|
83
86
|
organizational_unit: Optional[str] = Field(None, description="Unidad organizativa", example="IT", alias="UNIDAD ORGANIZATIVA")
|
|
84
87
|
work_location: Optional[str] = Field(None, description="Lugar trabajo", example="MADRID", alias="LUGAR TRABAJO")
|
|
@@ -100,7 +103,7 @@ class EmployeeSchema(BaseModel):
|
|
|
100
103
|
ss_agreement: Optional[str] = Field(None, description="Convenio S.S.", example="", alias="CONVENIO S.S.")
|
|
101
104
|
multi_employee_number: Optional[str] = Field(None, description="Número pluriempleado", example="", alias="NÚMERO PLURIEMPLEADO")
|
|
102
105
|
legal_contract: Optional[str] = Field(None, description="Contrato legal", example="", alias="CONTRATO LEGAL")
|
|
103
|
-
internal_contract: Optional[
|
|
106
|
+
internal_contract: Optional[str] = Field(None, description="Contrato interno", example=ContractType.REGULAR_INDEFINITE_FULL_TIME, alias="CONTRATO INTERNO")
|
|
104
107
|
contract_end_date: Optional[datetime] = Field(None, description="Fecha fin contrato", example="2024-12-31", alias="FECHA FIN CONTRATO")
|
|
105
108
|
labor_relationship: Optional[LaborRelationshipType] = Field(None, description="Relación laboral", example=LaborRelationshipType.HIGH_MANAGEMENT_PERSONNEL, alias="RELACIÓN LABORAL")
|
|
106
109
|
part_time_percentage: Optional[float] = Field(None, ge=0, le=100, description="% Jornada parcial", example=50.0, alias="% JORNADA PARCIAL")
|
|
@@ -125,6 +128,8 @@ class EmployeeSchema(BaseModel):
|
|
|
125
128
|
adjustment_type: Optional[AdjustmentType] = Field(None, description="Tipo de ajuste", example=AdjustmentType.WITH_ADJUSTMENT, alias="TIPO DE AJUSTE")
|
|
126
129
|
agreement: Optional[str] = Field(None, description="Convenio", example="CONV001", alias="CONVENIO")
|
|
127
130
|
category: Optional[str] = Field(None, description="Categoría", example="TECNICO", alias="CATEGORÍA")
|
|
131
|
+
id_category: Optional[str] = Field(None, description="ID Categoría", example="", alias="ID CATEGORIA")
|
|
132
|
+
id_agreement: Optional[str] = Field(None, description="ID Convenio", example="", alias="ID CONVENIO")
|
|
128
133
|
annual_gross: Optional[float] = Field(None, ge=0, description="Bruto anual", example=30000.0, alias="BRUTO ANUAL")
|
|
129
134
|
salary_type: Optional[SalaryType] = Field(None, description="Tipo salario", example=SalaryType.MONTHLY, alias="TIPO SALARIO")
|
|
130
135
|
seniority_date: Optional[datetime] = Field(None, description="Fecha antigüedad", example="2020-01-01", alias="FECHA ANTIGÜEDAD")
|
|
@@ -198,17 +203,19 @@ class EmployeeSchema(BaseModel):
|
|
|
198
203
|
|
|
199
204
|
elif self.movement_type == MovementType.ALTA:
|
|
200
205
|
# For ALTA (1), all basic employee information is mandatory
|
|
206
|
+
# removed: ['document_type', 'birth_country', 'document_number', 'ss_province', 'ss_number', 'ss_check_digit',
|
|
207
|
+
# 'second_surname', 'employee_type', 'category', 'salary_type', 'company_bank', 'adjustment_type', 'agreement', 'irpf_type',
|
|
208
|
+
# 'job',]
|
|
201
209
|
mandatory_fields_alta = [
|
|
202
|
-
'effective_date', 'person_id', 'first_surname',
|
|
203
|
-
'employee_name', '
|
|
204
|
-
'nationality', '
|
|
205
|
-
'employee_address', 'street_number', 'postal_code', 'company',
|
|
210
|
+
'effective_date', 'person_id', 'first_surname',
|
|
211
|
+
'employee_name', 'birth_date',
|
|
212
|
+
'nationality', 'gender', 'location_type', 'street_type',
|
|
213
|
+
'employee_address', 'street_number', 'postal_code', 'company',
|
|
206
214
|
'organizational_unit', 'work_location', 'cost_center', 'start_reason',
|
|
207
|
-
'
|
|
208
|
-
'
|
|
209
|
-
'
|
|
210
|
-
'
|
|
211
|
-
'company_bank', 'bank_branch', 'account_number', 'check_digit',
|
|
215
|
+
'has_ss_number', 'internal_contract', 'reduction_percentage',
|
|
216
|
+
'reduction_reason', 'additional_clause',
|
|
217
|
+
'irpf_status', 'payment_type',
|
|
218
|
+
'bank_branch', 'account_number', 'check_digit',
|
|
212
219
|
'management_type', 'perception_key'
|
|
213
220
|
]
|
|
214
221
|
|
|
@@ -2,13 +2,13 @@ brynq_sdk_meta4/__init__.py,sha256=TMcqIRDd60e7ElcgkKKH_YUxvb68Suoc_5gh2Krhd6I,2
|
|
|
2
2
|
brynq_sdk_meta4/cost_centers.py,sha256=tEyNkfwXTwP_9L2sPuRkEKN2BOuCIY0ceGyYURpHYU8,2755
|
|
3
3
|
brynq_sdk_meta4/employees.py,sha256=m910-Vgs65-lWgOLrFZL446bDsyKIRiyqY2EnotVIdE,4080
|
|
4
4
|
brynq_sdk_meta4/jobs.py,sha256=a_0HZiRdN5byylCJCOnkMMHu6SenEiAWuGs23jStHY4,3866
|
|
5
|
-
brynq_sdk_meta4/meta4.py,sha256
|
|
5
|
+
brynq_sdk_meta4/meta4.py,sha256=7FA_xVScr72B23AtzGe22emgxRFOY3eOjrzgjCkk9z4,5885
|
|
6
6
|
brynq_sdk_meta4/schemas/__init__.py,sha256=amkuQaBghg8JOYm6inq0tRY-XlbdlOovY8VmKzHnpNk,183
|
|
7
7
|
brynq_sdk_meta4/schemas/cost_center.py,sha256=UY6d2GizKe3Mw1zCeOjLeweHUBmRV_Me382NgsWos0A,1900
|
|
8
|
-
brynq_sdk_meta4/schemas/employee.py,sha256=
|
|
8
|
+
brynq_sdk_meta4/schemas/employee.py,sha256=n2v3XuWhxhv_sfu6tDWtXAhEC8ZplmVm3zTITmtTeNw,18299
|
|
9
9
|
brynq_sdk_meta4/schemas/job.py,sha256=-twiW5UPdgT9z1Jb7OvMmRCj4hwHSsDjVc6j_mD7Df0,2844
|
|
10
10
|
brynq_sdk_meta4/schemas/reference_enums.py,sha256=LiyBvRyEYAK_h4l22tnrugP5amFQpMHG3YT2853Xbo0,27534
|
|
11
|
-
brynq_sdk_meta4-1.0.1.dist-info/METADATA,sha256=
|
|
12
|
-
brynq_sdk_meta4-1.0.1.dist-info/WHEEL,sha256=
|
|
13
|
-
brynq_sdk_meta4-1.0.1.dist-info/top_level.txt,sha256=OvKQecCdbKTJ0I2OpmvHk8uKuDnLuj3Opt2iOA3IV8M,16
|
|
14
|
-
brynq_sdk_meta4-1.0.1.dist-info/RECORD,,
|
|
11
|
+
brynq_sdk_meta4-1.0.1.dev3.dist-info/METADATA,sha256=ngh4FDgR_SS5s0RkB084vBf5WnPtg6Ek6y_6OkYoSbE,435
|
|
12
|
+
brynq_sdk_meta4-1.0.1.dev3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
13
|
+
brynq_sdk_meta4-1.0.1.dev3.dist-info/top_level.txt,sha256=OvKQecCdbKTJ0I2OpmvHk8uKuDnLuj3Opt2iOA3IV8M,16
|
|
14
|
+
brynq_sdk_meta4-1.0.1.dev3.dist-info/RECORD,,
|
|
File without changes
|