fix: add more enums for batch discount type, editor UI

also fix column type for editor UI
This commit is contained in:
Lance Edgar 2025-01-14 20:20:41 -06:00
parent e37cf88cd9
commit ab56a35acc
2 changed files with 22 additions and 3 deletions

View file

@ -1646,7 +1646,7 @@ class BatchType(Base):
special_order_eligible = sa.Column('specialOrderEligible', sa.Boolean(), nullable=True, default=True) special_order_eligible = sa.Column('specialOrderEligible', sa.Boolean(), nullable=True, default=True)
editor_ui = sa.Column('editorUI', sa.Boolean(), nullable=True, default=True) editor_ui = sa.Column('editorUI', sa.SmallInteger(), nullable=True, default=True)
allow_single_store = sa.Column('allowSingleStore', sa.Boolean(), nullable=True, default=False) allow_single_store = sa.Column('allowSingleStore', sa.Boolean(), nullable=True, default=False)

View file

@ -34,14 +34,33 @@ class CoreDbType(str, Enum):
office_arch = 'office_arch' office_arch = 'office_arch'
BATCH_DISCOUNT_TYPE_TRACKING = -1
BATCH_DISCOUNT_TYPE_PRICE_CHANGE = 0 BATCH_DISCOUNT_TYPE_PRICE_CHANGE = 0
BATCH_DISCOUNT_TYPE_SALE_EVERYONE = 1 BATCH_DISCOUNT_TYPE_SALE_EVERYONE = 1
BATCH_DISCOUNT_TYPE_SALE_RESTRICTED = 2 BATCH_DISCOUNT_TYPE_SALE_RESTRICTED = 2
BATCH_DISCOUNT_TYPE_SLIDING_PERCENT = 3
BATCH_DISCOUNT_TYPE_SLIDING_AMOUNT = 5
BATCH_DISCOUNT_TYPE = OrderedDict([ BATCH_DISCOUNT_TYPE = OrderedDict([
(BATCH_DISCOUNT_TYPE_PRICE_CHANGE, "Price Change"), (BATCH_DISCOUNT_TYPE_PRICE_CHANGE, "None (Change regular price)"),
(BATCH_DISCOUNT_TYPE_SALE_EVERYONE, "Sale for everyone"), (BATCH_DISCOUNT_TYPE_SALE_EVERYONE, "Sale for everyone"),
(BATCH_DISCOUNT_TYPE_SALE_RESTRICTED, "Member/Owner only sale"), (BATCH_DISCOUNT_TYPE_SALE_RESTRICTED, "Sale for Members"),
(BATCH_DISCOUNT_TYPE_SLIDING_PERCENT, "Sliding % Off for Members"),
(BATCH_DISCOUNT_TYPE_SLIDING_AMOUNT, "Sliding $ Off for Members"),
(BATCH_DISCOUNT_TYPE_TRACKING, "Tracking (does not change any prices)"),
])
BATCH_EDITOR_UI_STANDARD = 1
BATCH_EDITOR_UI_PAIRED_SALE = 2
BATCH_EDITOR_UI_PARTIAL = 3
BATCH_EDITOR_UI_TRACKING = 4
BATCH_EDITOR_UI = OrderedDict([
(BATCH_EDITOR_UI_STANDARD, "Standard"),
(BATCH_EDITOR_UI_PAIRED_SALE, "Paired Sale"),
(BATCH_EDITOR_UI_PARTIAL, "Partial"),
(BATCH_EDITOR_UI_TRACKING, "Tracking"),
]) ])