diff --git a/rattail_corepos/importing/corepos/api.py b/rattail_corepos/importing/corepos/api.py index 241dd5c..80e276c 100644 --- a/rattail_corepos/importing/corepos/api.py +++ b/rattail_corepos/importing/corepos/api.py @@ -485,6 +485,7 @@ class MemberImporter(FromCOREPOSAPI, importing.model.MemberImporter): 'number', 'id', 'customer_uuid', + 'person_uuid', 'joined', 'withdrew', ] @@ -526,6 +527,12 @@ class MemberImporter(FromCOREPOSAPI, importing.model.MemberImporter): member['cardNo'], member) return + person = customer.first_person() + if not person: + log.warning("Rattail person not found for cardNo %s: %s", + member['cardNo'], member) + return + if member['memberStatus'] in self.non_member_status_codes: log.debug("skipping non-member %s with status '%s': %s", member['memberStatus'], member['cardNo'], member) @@ -551,6 +558,7 @@ class MemberImporter(FromCOREPOSAPI, importing.model.MemberImporter): 'number': int(member['cardNo']), 'id': str(member['customerAccountID']), 'customer_uuid': customer.uuid, + 'person_uuid': person.uuid, 'joined': joined, 'withdrew': withdrew, }