Customer discount with prefill discount in sales.
This commit is contained in:
@ -2,7 +2,7 @@ import logging
|
||||
|
||||
from alembic import context
|
||||
from barker.core.config import settings
|
||||
from barker.models.user import User
|
||||
from barker.db.base import User
|
||||
from sqlalchemy import create_engine, pool
|
||||
|
||||
|
||||
|
||||
@ -277,6 +277,23 @@ def upgrade():
|
||||
sa.PrimaryKeyConstraint("id", name=op.f("pk_sale_categories")),
|
||||
sa.UniqueConstraint("name", name=op.f("uq_sale_categories_name")),
|
||||
)
|
||||
op.create_table(
|
||||
"customer_discount",
|
||||
sa.Column("id", postgresql.UUID(as_uuid=True), server_default=sa.text("gen_random_uuid()"), nullable=False),
|
||||
sa.Column("customer_id", postgresql.UUID(as_uuid=True), nullable=False),
|
||||
sa.Column("sale_category_id", postgresql.UUID(as_uuid=True), nullable=False),
|
||||
sa.Column("discount", sa.Numeric(precision=15, scale=5), nullable=False),
|
||||
sa.ForeignKeyConstraint(
|
||||
["customer_id"], ["customers.id"], name=op.f("fk_customer_discount_customer_id_customers")
|
||||
),
|
||||
sa.ForeignKeyConstraint(
|
||||
["sale_category_id"],
|
||||
["sale_categories.id"],
|
||||
name=op.f("fk_customer_discount_sale_category_id_sale_categories"),
|
||||
),
|
||||
sa.PrimaryKeyConstraint("id", name=op.f("pk_customer_discount")),
|
||||
sa.UniqueConstraint("customer_id", "sale_category_id", name=op.f("uq_customer_discount_customer_id")),
|
||||
)
|
||||
op.create_table(
|
||||
"section_printers",
|
||||
sa.Column("id", postgresql.UUID(as_uuid=True), server_default=sa.text("gen_random_uuid()"), nullable=False),
|
||||
@ -535,6 +552,7 @@ def upgrade():
|
||||
)
|
||||
|
||||
op.execute(Permission.__table__.insert().values(id="5b66c6f6-003a-4ef8-ba28-49b8ff1ac33c", name="Printers"))
|
||||
op.execute(Permission.__table__.insert().values(id="7c54039e-0ca3-45ca-a6e0-4d55a8bb10b0", name="Settings"))
|
||||
op.execute(Permission.__table__.insert().values(id="7a04ba63-5d08-4078-9051-a6d91cce3e48", name="Section Printers"))
|
||||
op.execute(Permission.__table__.insert().values(id="5f6110ba-2d3a-41cb-9597-1157774f10cb", name="Add Devices"))
|
||||
op.execute(
|
||||
@ -628,6 +646,13 @@ def upgrade():
|
||||
data={"Text": "Call: 0172-4026666, 8054923853, 8054923856"},
|
||||
)
|
||||
)
|
||||
op.execute(
|
||||
DbSetting.__table__.insert().values(
|
||||
id="fa3d415c-c770-4d7c-8705-90f4be302587",
|
||||
name="Prefill Customer Discount",
|
||||
data={"Value": "true"},
|
||||
)
|
||||
)
|
||||
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
Reference in New Issue
Block a user