feat: add common base class for dtransactions
and similar models
more work to be done here i'm sure, but this should hopefully be a conservative change in the right direction
This commit is contained in:
parent
d21346bbff
commit
97fb0b28cb
6 changed files with 239 additions and 108 deletions
|
@ -2,7 +2,7 @@
|
|||
################################################################################
|
||||
#
|
||||
# pyCOREPOS -- Python Interface to CORE POS
|
||||
# Copyright © 2018-2024 Lance Edgar
|
||||
# Copyright © 2018-2025 Lance Edgar
|
||||
#
|
||||
# This file is part of pyCOREPOS.
|
||||
#
|
||||
|
@ -24,9 +24,11 @@
|
|||
CORE Office "arch" data model
|
||||
"""
|
||||
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy import orm
|
||||
|
||||
from corepos.db.office_trans.model import DTransactionBase, DLogBase
|
||||
from corepos.db.common import trans as common
|
||||
from corepos.db.office_trans.model import DTransactionBase
|
||||
|
||||
|
||||
Base = orm.declarative_base()
|
||||
|
@ -34,7 +36,7 @@ Base = orm.declarative_base()
|
|||
|
||||
class BigArchive(DTransactionBase, Base):
|
||||
"""
|
||||
Represents a record from ``bigArchive`` table.
|
||||
Data model for ``bigArchive`` table.
|
||||
"""
|
||||
__tablename__ = 'bigArchive'
|
||||
|
||||
|
@ -43,8 +45,19 @@ class BigArchive(DTransactionBase, Base):
|
|||
TransactionDetail = BigArchive
|
||||
|
||||
|
||||
class DLogBase(common.TransactionDetailBase):
|
||||
"""
|
||||
Base class for ``dlogBig`` and similar models.
|
||||
"""
|
||||
store_row_id = sa.Column(sa.Integer(), primary_key=True, nullable=False)
|
||||
|
||||
store_id = sa.Column(sa.Integer(), nullable=True, default=0)
|
||||
pos_row_id = sa.Column(sa.Integer(), nullable=True)
|
||||
date_time = sa.Column('tdate', sa.DateTime(), nullable=True)
|
||||
|
||||
|
||||
class DLogBig(DLogBase, Base):
|
||||
"""
|
||||
Represents a record from ``dlogBig`` view.
|
||||
Data model for ``dlogBig`` view.
|
||||
"""
|
||||
__tablename__ = 'dlogBig'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue