fix: add Employee support for CORE API -> Rattail import/datasync
This commit is contained in:
parent
4752409a45
commit
1b04b4097c
3 changed files with 60 additions and 0 deletions
|
@ -78,6 +78,14 @@ class FromCOREAPIToRattail(DataSyncImportConsumer):
|
|||
self.process_change(session, self.importers['Member'],
|
||||
host_object=member)
|
||||
|
||||
# sync all Employee-related changes
|
||||
types = [
|
||||
'Employee',
|
||||
]
|
||||
for change in [c for c in changes if c.payload_type in types]:
|
||||
# normal logic works fine here
|
||||
self.invoke_importer(session, change)
|
||||
|
||||
# sync all "product meta" changes
|
||||
types = [
|
||||
'Department',
|
||||
|
@ -118,6 +126,8 @@ class FromCOREAPIToRattail(DataSyncImportConsumer):
|
|||
def get_host_object(self, session, change):
|
||||
if change.payload_type == 'Member':
|
||||
return self.api.get_member(change.payload_key)
|
||||
if change.payload_type == 'Employee':
|
||||
return self.api.get_employee(change.payload_key)
|
||||
if change.payload_type == 'Department':
|
||||
return self.api.get_department(change.payload_key)
|
||||
if change.payload_type == 'Subdepartment':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue