From 6ecfbf4e1a669afb2fd91c49e6a14df0ccca5cc3 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 30 Mar 2020 12:00:52 -0500 Subject: [PATCH] Add `ScaleItem` model --- corepos/db/office_op/model.py | 59 +++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/corepos/db/office_op/model.py b/corepos/db/office_op/model.py index 8cc34ea..7e19da0 100644 --- a/corepos/db/office_op/model.py +++ b/corepos/db/office_op/model.py @@ -467,6 +467,65 @@ class VendorItem(Base): modified = sa.Column(sa.DateTime(), nullable=True) +class ScaleItem(Base): + """ + Represents deli scale info for a given item. + """ + __tablename__ = 'scaleItems' + + plu = sa.Column(sa.String(length=13), primary_key=True, nullable=False) + product = orm.relationship( + Product, + primaryjoin=Product.upc == plu, + foreign_keys=[plu], + doc=""" + Reference to the :class:`Product` to which this record applies. + """, + backref=orm.backref( + 'scale_item', + uselist=False, + doc=""" + Reference to the :class:`ScaleItem` record for this product. + """)) + + price = sa.Column(sa.Numeric(precision=10, scale=2), nullable=True) + + item_description = sa.Column('itemdesc', sa.String(length=100), nullable=True) + + exception_price = sa.Column('exceptionprice', sa.Numeric(precision=10, scale=2), nullable=True) + + exception_price = sa.Column('exceptionprice', sa.Numeric(precision=10, scale=2), nullable=True) + + weight = sa.Column(sa.SmallInteger(), nullable=True, default=0) + + by_count = sa.Column('bycount', sa.Boolean(), nullable=True, default=False) + + tare = sa.Column(sa.Float(), nullable=True, default=0) + + shelf_life = sa.Column('shelflife', sa.SmallInteger(), nullable=True, default=0) + + net_weight = sa.Column('netWeight', sa.SmallInteger(), nullable=True, default=0) + + text = sa.Column(sa.Text(), nullable=True) + + reporting_class = sa.Column('reportingClass', sa.String(length=6), nullable=True) + + label = sa.Column(sa.Integer(), nullable=True) + + graphics = sa.Column(sa.Integer(), nullable=True) + + modified = sa.Column(sa.DateTime(), nullable=True) + + # TODO: this was not in some older DBs + # linked_plu = sa.Column('linkedPLU', sa.String(length=13), nullable=True) + + # TODO: this was not in some older DBs + # mosa_statement = sa.Column('mosaStatement', sa.Boolean(), nullable=True, default=False) + + # TODO: this was not in some older DBs + # origin_text = sa.Column('originText', sa.String(length=100), nullable=True) + + class Employee(Base): """ Represents an employee within the organization.