Add CustomerShopper.corepos_customer_id and refactor importers

removes phone/email support for now..also change how we handle
default/empty values for member start/end date..
This commit is contained in:
Lance Edgar 2023-06-10 14:35:08 -05:00
parent 86a8e2d241
commit 660637522d
7 changed files with 150 additions and 37 deletions

View file

@ -136,6 +136,7 @@ class CustomerImporter(FromCOREPOSAPI, corepos_importing.model.CustomerImporter)
key = 'corepos_card_number'
supported_fields = [
'corepos_card_number',
'corepos_account_id',
'number',
'name',
# 'address_street',
@ -171,6 +172,7 @@ class CustomerImporter(FromCOREPOSAPI, corepos_importing.model.CustomerImporter)
return {
'corepos_card_number': card_number,
'corepos_account_id': int(customer['customerAccountID']),
'number': card_number,
'name': normalize_full_name(customer['firstName'],
customer['lastName']),
@ -183,7 +185,7 @@ class CustomerImporter(FromCOREPOSAPI, corepos_importing.model.CustomerImporter)
}
class CustomerShopperImporter(FromCOREPOSAPI, importing.model.CustomerShopperImporter):
class CustomerShopperImporter(FromCOREPOSAPI, corepos_importing.model.CustomerShopperImporter):
"""
Importer for customer shopper data from CORE POS API.
"""
@ -191,6 +193,7 @@ class CustomerShopperImporter(FromCOREPOSAPI, importing.model.CustomerShopperImp
supported_fields = [
'customer_uuid',
'shopper_number',
'corepos_customer_id',
'first_name',
'last_name',
'display_name',
@ -281,6 +284,7 @@ class CustomerShopperImporter(FromCOREPOSAPI, importing.model.CustomerShopperImp
data = {
'customer_uuid': customer.uuid,
'shopper_number': shopper['shopper_number'],
'corepos_customer_id': int(shopper['customerID']),
'first_name': shopper['firstName'],
'last_name': shopper['lastName'],

View file

@ -64,6 +64,15 @@ class CustomerImporter(importing.model.CustomerImporter):
}
class CustomerShopperImporter(importing.model.CustomerShopperImporter):
extensions = {
'_corepos': [
'corepos_customer_id',
],
}
class MemberImporter(importing.model.MemberImporter):
extensions = {