Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
DE-2543 Hibob - Deprecation of employees endpoint - Create "employee_…
Browse files Browse the repository at this point in the history
…search" schema (#56)

* WIP

* Functional

* Added base columns

* Added new schema

* Created final schema

* Changed schema reference
  • Loading branch information
SBurwash authored Jan 3, 2024
1 parent e0fa188 commit 7477b88
Show file tree
Hide file tree
Showing 2 changed files with 179 additions and 1 deletion.
175 changes: 175 additions & 0 deletions tap_hibob/schemas/EmployeesSearch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
from singer_sdk import typing as th # JSON Schema typing helpers

schema = th.PropertiesList(
th.Property("id", th.StringType),
th.Property("companyId", th.IntegerType),
th.Property("email", th.StringType),
th.Property("fullName", th.StringType),
th.Property("firstName", th.StringType),
th.Property("surname", th.StringType),
th.Property("displayName", th.StringType),
th.Property("creationDateTime", th.DateTimeType),
th.Property(
"internal",
th.ObjectType(
th.Property("terminationReason", th.StringType),
th.Property("probationEndDate", th.StringType),
th.Property("terminationDate", th.StringType),
),
),
th.Property(
"work",
th.ObjectType(
th.Property(
"customColumns",
th.ObjectType(
th.Property("column_1655996461265", th.StringType),
th.Property("column_1644862416222", th.ArrayType(th.StringType)),
th.Property("column_1644861659664", th.ArrayType(th.StringType)),
),
),
th.Property(
"custom",
th.ObjectType(
th.Property("field_1651169416679", th.StringType),
),
),
th.Property("department", th.StringType),
th.Property("isManager", th.BooleanType),
th.Property("title", th.StringType),
th.Property("site", th.StringType),
),
),
th.Property(
"payroll",
th.ObjectType(
th.Property(
"employment",
th.ObjectType(
th.Property("type", th.StringType),
th.Property("contract", th.StringType),
),
),
),
),
th.Property(
"personal",
th.ObjectType(
th.Property("pronouns", th.StringType),
),
),
th.Property(
"humanReadable",
th.ObjectType(
th.Property("id", th.StringType),
th.Property("companyId", th.StringType),
th.Property("email", th.StringType),
th.Property("fullName", th.StringType),
th.Property("firstName", th.StringType),
th.Property("surname", th.StringType),
th.Property("displayName", th.StringType),
th.Property("creationDateTime", th.StringType),
th.Property("avatarurl", th.StringType),
th.Property("secondname", th.StringType),
th.Property(
"work",
th.ObjectType(
th.Property("department", th.StringType),
th.Property("isManager", th.StringType),
th.Property("title", th.StringType),
th.Property("site", th.StringType),
th.Property(
"customColumns",
th.ObjectType(
th.Property("column_1664478354663", th.StringType),
th.Property("column_1655996461265", th.StringType),
th.Property("column_1644862416222", th.StringType),
th.Property("column_1644861659664", th.StringType),
),
),
th.Property(
"custom",
th.ObjectType(
th.Property("field_1651169416679", th.StringType),
),
),
),
),
th.Property(
"internal",
th.ObjectType(
th.Property("terminationReason", th.StringType),
th.Property("probationEndDate", th.StringType),
th.Property("terminationDate", th.StringType),
),
),
th.Property(
"personal",
th.ObjectType(
th.Property("pronouns", th.StringType),
),
),
th.Property(
"payroll",
th.ObjectType(
th.Property(
"employment",
th.ObjectType(
th.Property("type", th.StringType),
th.Property("contract", th.StringType),
),
),
),
),
),
),
th.Property("/work/site", th.ObjectType(th.Property("value", th.StringType))),
th.Property("/work/title", th.ObjectType(th.Property("value", th.StringType))),
th.Property("/work/isManager", th.ObjectType(th.Property("value", th.BooleanType))),
th.Property(
"/work/custom/field_1651169416679",
th.ObjectType(th.Property("value", th.StringType)),
),
th.Property(
"/work/customColumns/column_1644862416222",
th.ObjectType(th.Property("value", th.ArrayType(th.StringType))),
),
th.Property(
"/work/customColumns/column_1644861659664",
th.ObjectType(th.Property("value", th.ArrayType(th.StringType))),
),
th.Property("/work/department", th.ObjectType(th.Property("value", th.StringType))),
th.Property("/root/fullName", th.ObjectType(th.Property("value", th.StringType))),
th.Property(
"/root/creationDateTime", th.ObjectType(th.Property("value", th.DateTimeType))
),
th.Property("/root/email", th.ObjectType(th.Property("value", th.StringType))),
th.Property("/root/firstName", th.ObjectType(th.Property("value", th.StringType))),
th.Property("/root/surname", th.ObjectType(th.Property("value", th.StringType))),
th.Property("/root/companyId", th.ObjectType(th.Property("value", th.IntegerType))),
th.Property(
"/root/displayName", th.ObjectType(th.Property("value", th.StringType))
),
th.Property(
"/payroll/employment/type", th.ObjectType(th.Property("value", th.StringType))
),
th.Property(
"/payroll/employment/contract",
th.ObjectType(th.Property("value", th.StringType)),
),
th.Property(
"/internal/terminationDate",
th.ObjectType(th.Property("value", th.DateTimeType)),
),
th.Property(
"/internal/probationEndDate", th.ObjectType(th.Property("value", th.StringType))
),
th.Property(
"/internal/terminationReason",
th.ObjectType(th.Property("value", th.StringType)),
),
th.Property(
"/personal/pronouns",
th.ObjectType(th.Property("value", th.StringType)),
),
).to_dict()
5 changes: 4 additions & 1 deletion tap_hibob/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
CompanyFields,
EmployeeEmploymentHistory,
Employees,
EmployeesSearch,
EmployeeTimeOff,
EmployeePayroll,
EmployeeWorkHistory
Expand Down Expand Up @@ -64,7 +65,7 @@ class EmployeesSearchStream(HibobStream):
replication_method = "INCREMENTAL"
replication_key = "creationDateTime"
rest_method = "POST"
schema = Employees.schema
schema = EmployeesSearch.schema

def prepare_request_payload(
self, context: Optional[dict], next_page_token: Optional[Any]
Expand All @@ -76,6 +77,7 @@ def prepare_request_payload(
return {
"fields":[
"/root/displayName",
"/root/companyId",
"/root/firstName",
"/root/fullName",
"/root/surname",
Expand All @@ -90,6 +92,7 @@ def prepare_request_payload(
"/work/title",
"/work/site",
"/work/department",
"/work/isManager",
"/internal/terminationReason",
"/internal/probationEndDate",
"/internal/terminationDate"
Expand Down

0 comments on commit 7477b88

Please sign in to comment.