brynq-sdk-sage-100-france 1.1.0__tar.gz

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 (42) hide show
  1. brynq_sdk_sage_100_france-1.1.0/PKG-INFO +10 -0
  2. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/__init__.py +1 -0
  3. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/absence.py +35 -0
  4. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/address.py +38 -0
  5. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/bank_info.py +40 -0
  6. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/company.py +42 -0
  7. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/contract.py +37 -0
  8. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/department.py +36 -0
  9. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/employee.py +201 -0
  10. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/employee_insurance.py +40 -0
  11. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/family.py +38 -0
  12. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/insurance.py +39 -0
  13. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/leave.py +35 -0
  14. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/position.py +38 -0
  15. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/sage_100_france.py +234 -0
  16. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/salary.py +41 -0
  17. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/schemas/__init__.py +36 -0
  18. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/schemas/absence.py +41 -0
  19. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/schemas/address.py +49 -0
  20. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/schemas/bank_info.py +59 -0
  21. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/schemas/company.py +45 -0
  22. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/schemas/contract.py +64 -0
  23. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/schemas/department.py +31 -0
  24. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/schemas/employee.py +276 -0
  25. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/schemas/employee_insurance.py +52 -0
  26. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/schemas/family.py +47 -0
  27. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/schemas/insurance.py +37 -0
  28. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/schemas/leave.py +37 -0
  29. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/schemas/position.py +41 -0
  30. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/schemas/salary.py +318 -0
  31. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/schemas/service.py +31 -0
  32. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/schemas/work.py +178 -0
  33. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/service.py +35 -0
  34. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france/work.py +49 -0
  35. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france.egg-info/PKG-INFO +10 -0
  36. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france.egg-info/SOURCES.txt +40 -0
  37. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france.egg-info/dependency_links.txt +1 -0
  38. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france.egg-info/not-zip-safe +1 -0
  39. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france.egg-info/requires.txt +1 -0
  40. brynq_sdk_sage_100_france-1.1.0/brynq_sdk_sage_100_france.egg-info/top_level.txt +1 -0
  41. brynq_sdk_sage_100_france-1.1.0/setup.cfg +4 -0
  42. brynq_sdk_sage_100_france-1.1.0/setup.py +16 -0
@@ -0,0 +1,10 @@
1
+ Metadata-Version: 1.0
2
+ Name: brynq_sdk_sage_100_france
3
+ Version: 1.1.0
4
+ Summary: Sage 100 France wrapper from BrynQ
5
+ Home-page: UNKNOWN
6
+ Author: BrynQ
7
+ Author-email: support@brynq.com
8
+ License: BrynQ License
9
+ Description: Sage 100 France wrapper from BrynQ
10
+ Platform: UNKNOWN
@@ -0,0 +1 @@
1
+ from .sage_100_france import Sage100France
@@ -0,0 +1,35 @@
1
+ import pandas as pd
2
+ from .schemas.absence import AbsenceSchema
3
+ from brynq_sdk_functions import Functions
4
+
5
+ class Absence:
6
+ """Class for interacting with Sage 100 France absence endpoints"""
7
+
8
+ # Get column names from schema
9
+ COLUMN_NAMES = list(AbsenceSchema.to_schema().columns.keys())
10
+
11
+ def __init__(self, sage_100_france):
12
+ """Initialize Absence class
13
+
14
+ Args:
15
+ sage_100_france: Parent Sage 100 France instance for authentication and configuration
16
+ """
17
+ self.sage_100_france = sage_100_france
18
+ self.db_table = "T_MOTIFDABSENCE"
19
+
20
+ def get(self):
21
+ """Get all absence records
22
+
23
+ Returns:
24
+ pandas.DataFrame: DataFrame containing absence data with schema validation
25
+ """
26
+ absence = self.sage_100_france.get(table_name=self.db_table, columns=self.COLUMN_NAMES)
27
+ try:
28
+ df = pd.DataFrame(absence)
29
+ if not df.empty:
30
+ df.columns = self.COLUMN_NAMES
31
+ valid_data, invalid_data = Functions.validate_data(df, AbsenceSchema)
32
+ return valid_data, invalid_data
33
+ return df
34
+ except Exception as e:
35
+ raise ValueError(f"There was an error processing the Absence data: {e}")
@@ -0,0 +1,38 @@
1
+ import pandas as pd
2
+ from .schemas.address import AddressSchema
3
+ from brynq_sdk_functions import Functions
4
+
5
+ class Address:
6
+ """Class for interacting with Sage 100 France address history endpoints"""
7
+
8
+ # Get column names from schema
9
+ COLUMN_NAMES = list(AddressSchema.to_schema().columns.keys())
10
+
11
+ def __init__(self, sage_100_france):
12
+ """Initialize Address class
13
+
14
+ Args:
15
+ sage_100_france: Parent Sage 100 France instance for authentication and configuration
16
+ """
17
+ self.sage_100_france = sage_100_france
18
+ self.db_table = "T_HST_ADRESSE"
19
+
20
+ def get(self):
21
+ """Get all address history records
22
+
23
+ Returns:
24
+ pandas.DataFrame: DataFrame containing address history data with schema validation
25
+
26
+ Raises:
27
+ ValueError: If there is an error processing the address data
28
+ """
29
+ address = self.sage_100_france.get(table_name=self.db_table, columns=self.COLUMN_NAMES)
30
+ try:
31
+ df = pd.DataFrame(address)
32
+ if not df.empty:
33
+ df.columns = self.COLUMN_NAMES
34
+ valid_data, invalid_data = Functions.validate_data(df, AddressSchema)
35
+ return valid_data, invalid_data
36
+ return df
37
+ except Exception as e:
38
+ raise ValueError(f"There was an error processing the Address data: {e}")
@@ -0,0 +1,40 @@
1
+ import pandas as pd
2
+ from brynq_sdk_functions import Functions
3
+
4
+ from .schemas.bank_info import BankInfoSchema
5
+
6
+
7
+ class BankInfo:
8
+ """Class for interacting with Sage 100 France bank information endpoints"""
9
+
10
+ # Get column names from schema
11
+ COLUMN_NAMES = list(BankInfoSchema.to_schema().columns.keys())
12
+
13
+ def __init__(self, sage_100_france):
14
+ """Initialize BankInfo class
15
+
16
+ Args:
17
+ sage_100_france: Parent Sage 100 France instance for authentication and configuration
18
+ """
19
+ self.sage_100_france = sage_100_france
20
+ self.db_table = "T_INFOBANQUE"
21
+
22
+ def get(self):
23
+ """Get all bank information records
24
+
25
+ Returns:
26
+ pandas.DataFrame: DataFrame containing bank information data with schema validation
27
+
28
+ Raises:
29
+ ValueError: If there is an error processing the bank information data
30
+ """
31
+ bank_info = self.sage_100_france.get(table_name=self.db_table, columns=self.COLUMN_NAMES)
32
+ try:
33
+ df = pd.DataFrame(bank_info)
34
+ if not df.empty:
35
+ df.columns = self.COLUMN_NAMES
36
+ valid_data, invalid_data = Functions.validate_data(df, BankInfoSchema)
37
+ return valid_data, invalid_data
38
+ return df
39
+ except Exception as e:
40
+ raise ValueError(f"There was an error processing the Bank Info data: {e}")
@@ -0,0 +1,42 @@
1
+ import pandas as pd
2
+ import pandera as pa
3
+ from pandera.typing import Series
4
+ from typing import Union, List, Dict, Any
5
+ from .schemas.company import CompanySchema
6
+ from brynq_sdk_functions import Functions
7
+
8
+ class Company:
9
+ """Class for interacting with Sage 100 France company endpoints"""
10
+
11
+ # Get column names from schema
12
+ COLUMN_NAMES = list(CompanySchema.to_schema().columns.keys())
13
+
14
+ def __init__(self, sage_100_france):
15
+ """Initialize Company class
16
+
17
+ Args:
18
+ sage_100_france: Parent Sage 100 France instance for authentication and configuration
19
+ """
20
+ self.sage_100_france = sage_100_france
21
+ self.db_table = "T_SOCIETE"
22
+
23
+ def get(self):
24
+ """Get company information
25
+
26
+ Returns:
27
+ pandas.DataFrame: DataFrame containing company data with schema validation
28
+
29
+ Raises:
30
+ ValueError: If there is an error processing the company data
31
+ """
32
+ company = self.sage_100_france.get(table_name=self.db_table, columns=self.COLUMN_NAMES)
33
+ try:
34
+ df = pd.DataFrame(company)
35
+ if not df.empty:
36
+ df.columns = self.COLUMN_NAMES
37
+ valid_data, invalid_data = Functions.validate_data(df, CompanySchema)
38
+ return valid_data, invalid_data
39
+ return df
40
+ except Exception as e:
41
+ raise ValueError(f"There was an error processing the Company data: {e}")
42
+
@@ -0,0 +1,37 @@
1
+ import pandas as pd
2
+ from .schemas.contract import ContractSchema
3
+ from brynq_sdk_functions import Functions
4
+
5
+ class Contract:
6
+ """Class for interacting with Sage 100 France contract endpoints"""
7
+
8
+ # Get column names from schema
9
+ COLUMN_NAMES = list(ContractSchema.to_schema().columns.keys())
10
+
11
+ def __init__(self, sage_100_france):
12
+ """Initialize Contract class
13
+
14
+ Args:
15
+ sage_100_france: Parent Sage 100 France instance for authentication and configuration
16
+ """
17
+ self.sage_100_france = sage_100_france
18
+ self.db_table = "T_HST_CONTRAT"
19
+
20
+ def get(self):
21
+ """Get all contract records
22
+
23
+ Returns:
24
+ pandas.DataFrame: DataFrame containing contract data with schema validation
25
+
26
+ Raises:
27
+ ValueError: If there is an error processing the contract data
28
+ """
29
+ contract = self.sage_100_france.get(table_name=self.db_table, columns=self.COLUMN_NAMES)
30
+ try:
31
+ df = pd.DataFrame(contract)
32
+ if not df.empty:
33
+ df.columns = self.COLUMN_NAMES
34
+ valid_data, = Functions.validate_data(df, ContractSchema)
35
+ return valid_data
36
+ except Exception as e:
37
+ raise ValueError(f"There was an error processing the Contract data: {e}")
@@ -0,0 +1,36 @@
1
+ import pandas as pd
2
+ from typing import Union, List, Dict, Any
3
+ from .schemas.department import DepartmentSchema
4
+ from brynq_sdk_functions import Functions
5
+
6
+ class Department:
7
+ """Class for interacting with Sage 100 France department endpoints"""
8
+
9
+ # Get column names from schema
10
+ COLUMN_NAMES = list(DepartmentSchema.to_schema().columns.keys())
11
+
12
+ def __init__(self, sage_100_france):
13
+ """Initialize Department class
14
+
15
+ Args:
16
+ sage_100_france: Parent Sage 100 France instance for authentication and configuration
17
+ """
18
+ self.sage_100_france = sage_100_france
19
+ self.db_table = "T_DEPARTEMENT"
20
+
21
+ def get(self):
22
+ """Get all department records
23
+
24
+ Returns:
25
+ pandas.DataFrame: DataFrame containing department data with schema validation
26
+ """
27
+ department = self.sage_100_france.get(table_name=self.db_table, columns=self.COLUMN_NAMES)
28
+ try:
29
+ df = pd.DataFrame(department)
30
+ if not df.empty:
31
+ df.columns = self.COLUMN_NAMES
32
+ valid_data, invalid_data = Functions.validate_data(df, DepartmentSchema)
33
+ return valid_data, invalid_data
34
+ except Exception as e:
35
+ raise ValueError(f"There was an error processing the Department data: {e}")
36
+
@@ -0,0 +1,201 @@
1
+ import pandas as pd
2
+ from typing import Union, List, Dict, Any
3
+ from brynq_sdk_functions import Functions
4
+ from .schemas.employee import EmployeeSchema
5
+ from .schemas.employee import PersonnelRecordTimePageSchema
6
+ from .schemas.employee import RegistrationSchema
7
+ from .schemas.employee import CivilStatusSchema
8
+ from .schemas.employee import DadsUSchema
9
+ from .work import Work
10
+ from .employee_insurance import EmployeeInsurance
11
+ class Employee:
12
+ """Class for interacting with Sage 100 France employee endpoints"""
13
+
14
+ # Get column names from schema
15
+ COLUMN_NAMES = list(EmployeeSchema.to_schema().columns.keys())
16
+
17
+ def __init__(self, sage_100_france):
18
+ """Initialize Employees class
19
+
20
+ Args:
21
+ sage_100_france: Parent Sage 100 France instance for authentication and configuration
22
+ """
23
+ self.sage_100_france = sage_100_france
24
+ self.work = Work(self)
25
+ self.insurance = EmployeeInsurance(self)
26
+ self.db_table = "T_CONTACT"
27
+
28
+
29
+
30
+ def get(self):
31
+ """Get all employees
32
+
33
+ Returns:
34
+ pandas.DataFrame: DataFrame containing employee data with schema validation
35
+
36
+ Raises:
37
+ ValueError: If there is an error processing the employee data
38
+ """
39
+ employee = self.sage_100_france.get(table_name=self.db_table, columns=self.COLUMN_NAMES)
40
+ try:
41
+ df = pd.DataFrame(employee)
42
+ if not df.empty:
43
+ df.columns = self.COLUMN_NAMES
44
+ valid_data, invalid_data = Functions.validate_data(df, EmployeeSchema)
45
+ return valid_data, invalid_data
46
+ return df
47
+ except Exception as e:
48
+ raise ValueError(f"There was an error processing the Employee data: {e}")
49
+
50
+ def import_registration_data(self, df: pd.DataFrame):
51
+ """
52
+ Import registration data
53
+
54
+ Args:
55
+ df: DataFrame to import
56
+ """
57
+ # Add unique_code automatically - it's always "01" for Registration
58
+ df = df.copy()
59
+ df['unique_code'] = "01"
60
+
61
+ valid_data = RegistrationSchema(df)
62
+
63
+ rows = self.sage_100_france.prepare_formatted_rows(df=valid_data, schema=RegistrationSchema)
64
+
65
+ self.sage_100_france.add_rows_to_buffer(rows)
66
+
67
+ def _generate_child_field_specs(self, max_children: int) -> dict:
68
+ """
69
+ Generate field specifications for child data dynamically.
70
+
71
+ Args:
72
+ max_children: Maximum number of children to support
73
+
74
+ Returns:
75
+ Dictionary with child field specifications
76
+ """
77
+ child_specs = {}
78
+
79
+ # Starting position for first child (after number_of_children field)
80
+ base_position = 364
81
+
82
+ for child_num in range(1, max_children + 1):
83
+ # Each child takes 62 positions (2+20+30+8+1+1)
84
+ child_base_pos = base_position + ((child_num - 1) * 62)
85
+
86
+ child_specs.update({
87
+ f'child_{child_num}_number': {'position': child_base_pos, 'length': 2},
88
+ f'child_{child_num}_first_name': {'position': child_base_pos + 2, 'length': 20},
89
+ f'child_{child_num}_last_name': {'position': child_base_pos + 22, 'length': 30},
90
+ f'child_{child_num}_birth_date': {'position': child_base_pos + 52, 'length': 8},
91
+ f'child_{child_num}_gender': {'position': child_base_pos + 60, 'length': 1},
92
+ f'child_{child_num}_dependent': {'position': child_base_pos + 61, 'length': 1},
93
+ })
94
+
95
+ return child_specs
96
+
97
+ def _fill_missing_child_data(self, df: pd.DataFrame, max_children: int = 100) -> pd.DataFrame:
98
+ """
99
+ Fill missing child data with default values for up to max_children.
100
+
101
+ For each child that doesn't exist in the data, fill with:
102
+ - child_X_number: 0
103
+ - child_X_first_name: ""
104
+ - child_X_last_name: ""
105
+ - child_X_birth_date: ""
106
+ - child_X_gender: 0
107
+ - child_X_dependent: 0
108
+
109
+ Args:
110
+ df: DataFrame with child data
111
+ max_children: Maximum number of children to support
112
+
113
+ Returns:
114
+ DataFrame with all child fields filled
115
+ """
116
+ df = df.copy()
117
+
118
+ # Define default values for missing child data
119
+ child_defaults = {
120
+ 'number': 0, # Numeric field
121
+ 'first_name': "",
122
+ 'last_name': "",
123
+ 'birth_date': "",
124
+ 'gender': 0, # Numeric field (0 = not specified)
125
+ 'dependent': 0 # Numeric field (0 = not dependent)
126
+ }
127
+
128
+ # Collect all missing columns and their default values
129
+ missing_columns = {}
130
+
131
+ # Check for missing child columns (1 to max_children)
132
+ for child_num in range(1, max_children + 1):
133
+ for field, default_value in child_defaults.items():
134
+ column_name = f"child_{child_num}_{field}"
135
+ if column_name not in df.columns:
136
+ # Column doesn't exist, add to missing columns
137
+ missing_columns[column_name] = [default_value] * len(df)
138
+ else:
139
+ # Column exists but may have NaN values, fill them
140
+ df[column_name] = df[column_name].fillna(default_value)
141
+
142
+ # Add all missing columns at once using pd.concat for better performance
143
+ if missing_columns:
144
+ missing_df = pd.DataFrame(missing_columns, index=df.index)
145
+ df = pd.concat([df, missing_df], axis=1)
146
+
147
+ return df
148
+
149
+ def import_civil_status_data(self, df: pd.DataFrame):
150
+ """
151
+ Import civil status data
152
+
153
+ Args:
154
+ df: DataFrame to import
155
+ """
156
+ # Add unique_code automatically - it's always "02" for Civil Status
157
+ df = df.copy()
158
+ df['unique_code'] = "02"
159
+
160
+ df = self._fill_missing_child_data(df, max_children=99)
161
+
162
+ valid_data = CivilStatusSchema(df)
163
+
164
+ rows = self.sage_100_france.prepare_formatted_rows(df=valid_data, schema=CivilStatusSchema)
165
+
166
+ self.sage_100_france.add_rows_to_buffer(rows)
167
+
168
+ def import_time_page_data(self, df: pd.DataFrame):
169
+ """
170
+ Import time page data
171
+
172
+ Args:
173
+ df: DataFrame to import
174
+ """
175
+ # Add unique_code automatically - it's always "GT" for Time Page
176
+ df = df.copy()
177
+ df['unique_code'] = "GT"
178
+
179
+ valid_data = PersonnelRecordTimePageSchema(df)
180
+
181
+ rows = self.sage_100_france.prepare_formatted_rows(df=valid_data, schema=PersonnelRecordTimePageSchema)
182
+
183
+ self.sage_100_france.add_rows_to_buffer(rows)
184
+
185
+ def import_dads_u_data(self, df: pd.DataFrame):
186
+ """
187
+ Import DADS-U (Données DADS-U) data
188
+
189
+ Args:
190
+ df: DataFrame to import
191
+ """
192
+ # Add unique_code automatically - it's always "DU" for DADS-U
193
+ df = df.copy()
194
+ df['unique_code'] = "DU"
195
+
196
+ valid_data = DadsUSchema(df)
197
+
198
+ rows = self.sage_100_france.prepare_formatted_rows(df=valid_data, schema=DadsUSchema)
199
+
200
+ self.sage_100_france.add_rows_to_buffer(rows)
201
+
@@ -0,0 +1,40 @@
1
+ import pandas as pd
2
+ from typing import Union, List, Dict, Any
3
+ from .schemas.employee_insurance import EmployeeInsuranceSchema
4
+ from brynq_sdk_functions import Functions
5
+
6
+ class EmployeeInsurance:
7
+ """Class for interacting with Sage 100 France employee insurance affiliations"""
8
+
9
+ # Get column names from schema
10
+ COLUMN_NAMES = list(EmployeeInsuranceSchema.to_schema().columns.keys())
11
+
12
+ def __init__(self, employee):
13
+ """Initialize EmployeeInsurance class
14
+
15
+ Args:
16
+ sage_100_france: Parent Sage 100 France instance for authentication and configuration
17
+ """
18
+ self.employee = employee
19
+ self.db_table = "T_SALARIE_CONTRAT_SOCIAL"
20
+
21
+ def get(self):
22
+ """Get all employee insurance affiliation records
23
+
24
+ Returns:
25
+ pandas.DataFrame: DataFrame containing employee insurance data with schema validation
26
+
27
+ Raises:
28
+ ValueError: If there is an error processing the employee insurance data
29
+ """
30
+ employee_insurance = self.employee.sage_100_france.get(table_name=self.db_table, columns=self.COLUMN_NAMES)
31
+ try:
32
+ df = pd.DataFrame(employee_insurance)
33
+ if not df.empty:
34
+ df.columns = self.COLUMN_NAMES
35
+ valid_data, invalid_data = Functions.validate_data(df, EmployeeInsuranceSchema)
36
+ return valid_data, invalid_data
37
+ return df
38
+ except Exception as e:
39
+ raise ValueError(f"There was an error processing the Employee Insurance data: {e}")
40
+
@@ -0,0 +1,38 @@
1
+ import pandas as pd
2
+ from .schemas.family import FamilySchema
3
+ from brynq_sdk_functions import Functions
4
+
5
+ class Family:
6
+ """Class for interacting with Sage 100 France family history endpoints"""
7
+
8
+ # Get column names from schema
9
+ COLUMN_NAMES = list(FamilySchema.to_schema().columns.keys())
10
+
11
+ def __init__(self, sage_100_france):
12
+ """Initialize Family class
13
+
14
+ Args:
15
+ sage_100_france: Parent Sage 100 France instance for authentication and configuration
16
+ """
17
+ self.sage_100_france = sage_100_france
18
+ self.db_table = "T_HST_FAMILLE"
19
+
20
+ def get(self):
21
+ """Get all family history records
22
+
23
+ Returns:
24
+ pandas.DataFrame: DataFrame containing family history data with schema validation
25
+
26
+ Raises:
27
+ ValueError: If there is an error processing the family data
28
+ """
29
+ family = self.sage_100_france.get(table_name=self.db_table, columns=self.COLUMN_NAMES)
30
+ try:
31
+ df = pd.DataFrame(family)
32
+ if not df.empty:
33
+ df.columns = self.COLUMN_NAMES
34
+ valid_data, invalid_Data = Functions.validate_data(df, FamilySchema)
35
+ return valid_data, invalid_Data
36
+ return df
37
+ except Exception as e:
38
+ raise ValueError(f"There was an error processing the Family data: {e}")
@@ -0,0 +1,39 @@
1
+ import pandas as pd
2
+ from typing import Union, List, Dict, Any
3
+ from .schemas.insurance import InsuranceSchema
4
+ from brynq_sdk_functions import Functions
5
+
6
+ class Insurance:
7
+ """Class for interacting with Sage 100 France insurance endpoints"""
8
+
9
+ # Get column names from schema
10
+ COLUMN_NAMES = list(InsuranceSchema.to_schema().columns.keys())
11
+
12
+ def __init__(self, sage_100_france):
13
+ """Initialize Insurance class
14
+
15
+ Args:
16
+ sage_100_france: Parent Sage 100 France instance for authentication and configuration
17
+ """
18
+ self.sage_100_france = sage_100_france
19
+ self.db_table = "T_CONTRAT_SOCIAL"
20
+
21
+ def get(self):
22
+ """Get all insurance records
23
+
24
+ Returns:
25
+ pandas.DataFrame: DataFrame containing insurance data with schema validation
26
+
27
+ Raises:
28
+ ValueError: If there is an error processing the insurance data
29
+ """
30
+ insurance = self.sage_100_france.get(table_name=self.db_table, columns=self.COLUMN_NAMES)
31
+ try:
32
+ df = pd.DataFrame(insurance)
33
+ if not df.empty:
34
+ df.columns = self.COLUMN_NAMES
35
+ valid_data, invalid_data = Functions.validate_data(df, InsuranceSchema)
36
+ return valid_data, invalid_data
37
+ return df
38
+ except Exception as e:
39
+ raise ValueError(f"There was an error processing the Insrance data: {e}")
@@ -0,0 +1,35 @@
1
+ import pandas as pd
2
+ from .schemas.leave import LeaveSchema
3
+ from brynq_sdk_functions import Functions
4
+
5
+ class Leave:
6
+ """Class for interacting with Sage 100 France leave history endpoints"""
7
+
8
+ # Get column names from schema
9
+ COLUMN_NAMES = list(LeaveSchema.to_schema().columns.keys())
10
+
11
+ def __init__(self, sage_100_france):
12
+ """Initialize Leave class
13
+
14
+ Args:
15
+ sage_100_france: Parent Sage 100 France instance for authentication and configuration
16
+ """
17
+ self.sage_100_france = sage_100_france
18
+ self.db_table = "T_HST_CONGE"
19
+
20
+ def get(self):
21
+ """Get all leave history records
22
+
23
+ Returns:
24
+ pandas.DataFrame: DataFrame containing leave history data with schema validation
25
+ """
26
+ leave = self.sage_100_france.get(table_name=self.db_table, columns=self.COLUMN_NAMES)
27
+ try:
28
+ df = pd.DataFrame(leave)
29
+ if not df.empty:
30
+ df.columns = self.COLUMN_NAMES
31
+ valid_data, invalid_data = Functions.validate_data(df, LeaveSchema)
32
+ return valid_data, invalid_data
33
+ return df
34
+ except Exception as e:
35
+ raise ValueError(f"There was an error processing the Leave data: {e}")
@@ -0,0 +1,38 @@
1
+ import pandas as pd
2
+ from .schemas.position import PositionSchema
3
+ from brynq_sdk_functions import Functions
4
+
5
+ class Position:
6
+ """Class for interacting with Sage 100 France position endpoints"""
7
+
8
+ # Get column names from schema
9
+ COLUMN_NAMES = list(PositionSchema.to_schema().columns.keys())
10
+
11
+ def __init__(self, sage_100_france):
12
+ """Initialize Position class
13
+
14
+ Args:
15
+ sage_100_france: Parent Sage 100 France instance for authentication and configuration
16
+ """
17
+ self.sage_100_france = sage_100_france
18
+ self.db_table = "T_POSTES"
19
+
20
+ def get(self):
21
+ """Get all position records
22
+
23
+ Returns:
24
+ pandas.DataFrame: DataFrame containing position data with schema validation
25
+
26
+ Raises:
27
+ ValueError: If there is an error processing the position data
28
+ """
29
+ position = self.sage_100_france.get(table_name=self.db_table, columns=self.COLUMN_NAMES)
30
+ try:
31
+ df = pd.DataFrame(position)
32
+ if not df.empty:
33
+ df.columns = self.COLUMN_NAMES
34
+ valid_data, invalid_data = Functions.validate_data(df, PositionSchema)
35
+ return valid_data, invalid_data
36
+ return df
37
+ except Exception as e:
38
+ raise ValueError(f"There was an error processing the Position data: {e}")