v1.2 scaffold
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
from datetime import datetime
|
||||
|
||||
from sqlalchemy import Boolean, DateTime, Float, String
|
||||
from sqlalchemy.orm import Mapped, mapped_column
|
||||
|
||||
from app.db.session import Base
|
||||
|
||||
|
||||
class ProcessCostRule(Base):
|
||||
__tablename__ = "process_cost_rules"
|
||||
|
||||
id: Mapped[int] = mapped_column(primary_key=True)
|
||||
process_name: Mapped[str] = mapped_column(String(64), unique=True)
|
||||
grading_cost: Mapped[float] = mapped_column(Float, default=0.0)
|
||||
bagging_cost: Mapped[float] = mapped_column(Float, default=0.0)
|
||||
cracking_cost: Mapped[float] = mapped_column(Float, default=0.0)
|
||||
created_at: Mapped[datetime] = mapped_column(DateTime, default=datetime.utcnow)
|
||||
|
||||
|
||||
class PackagingCostRule(Base):
|
||||
__tablename__ = "packaging_cost_rules"
|
||||
|
||||
id: Mapped[int] = mapped_column(primary_key=True)
|
||||
sale_type: Mapped[str] = mapped_column(String(64))
|
||||
unit_of_measure: Mapped[str] = mapped_column(String(64))
|
||||
own_bag: Mapped[bool] = mapped_column(Boolean, default=False)
|
||||
bag_cost: Mapped[float] = mapped_column(Float, default=0.0)
|
||||
created_at: Mapped[datetime] = mapped_column(DateTime, default=datetime.utcnow)
|
||||
|
||||
|
||||
class FreightCostRule(Base):
|
||||
__tablename__ = "freight_cost_rules"
|
||||
|
||||
id: Mapped[int] = mapped_column(primary_key=True)
|
||||
sale_type: Mapped[str] = mapped_column(String(64))
|
||||
unit_of_measure: Mapped[str] = mapped_column(String(64))
|
||||
cost_per_unit: Mapped[float] = mapped_column(Float, default=0.0)
|
||||
created_at: Mapped[datetime] = mapped_column(DateTime, default=datetime.utcnow)
|
||||
Reference in New Issue
Block a user