Add employee importer for CORE -> Rattail, and CORE cashier auth handler

This commit is contained in:
Lance Edgar 2023-10-01 19:40:46 -05:00
parent fd5d3142ed
commit 117442f8db
9 changed files with 255 additions and 1 deletions

View file

@ -65,6 +65,41 @@ class CorePerson(model.Base):
CorePerson.make_proxy(model.Person, '_corepos', 'corepos_customer_id')
class CoreEmployee(model.Base):
"""
CORE-specific extensions to :class:`~rattail:rattail.db.model.Employee`
"""
__tablename__ = 'corepos_employee'
__table_args__ = (
sa.ForeignKeyConstraint(['uuid'], ['employee.uuid'],
name='corepos_employee_fk_employee'),
)
__versioned__ = {}
uuid = model.uuid_column(default=None)
employee = orm.relationship(
model.Employee,
doc="""
Reference to the actual employee record, which this one extends.
""",
backref=orm.backref(
'_corepos',
uselist=False,
cascade='all, delete-orphan',
doc="""
Reference to the CORE-POS extension record for this employee.
"""))
corepos_number = sa.Column(sa.Integer(), nullable=True, doc="""
``employees.emp_no`` value for this employee, within CORE-POS.
""")
def __str__(self):
return str(self.employee)
CoreEmployee.make_proxy(model.Employee, '_corepos', 'corepos_number')
class CoreCustomer(model.Base):
"""
CORE-specific extensions to :class:`rattail:rattail.db.model.Customer`.