Make card_number more central for CORE API -> Rattail importers

let's track that as (effectively) `Customer.corepos_card_number` and
use that when possible for importer key
This commit is contained in:
Lance Edgar 2023-06-05 20:45:45 -05:00
parent c1276c998a
commit bfc52a6fb3
6 changed files with 179 additions and 65 deletions

View file

@ -2,7 +2,7 @@
################################################################################
#
# Rattail -- Retail Software Framework
# Copyright © 2010-2020 Lance Edgar
# Copyright © 2010-2023 Lance Edgar
#
# This file is part of Rattail.
#
@ -90,14 +90,19 @@ class CoreCustomer(model.Base):
Reference to the CORE-POS extension record for this customer.
"""))
corepos_account_id = sa.Column(sa.Integer(), nullable=False, doc="""
corepos_account_id = sa.Column(sa.Integer(), nullable=True, doc="""
``Customers.customerAccountID`` value for this customer, within CORE-POS.
""")
corepos_card_number = sa.Column(sa.Integer(), nullable=True, doc="""
``custdata.CardNo`` value for this customer, within CORE-POS.
""")
def __str__(self):
return str(self.customer)
CoreCustomer.make_proxy(model.Customer, '_corepos', 'corepos_account_id')
CoreCustomer.make_proxy(model.Customer, '_corepos', 'corepos_card_number')
class CoreMember(model.Base):