feat: add accessory models and box_item item_type column

Add FinishedGoodsAccessory and AccessoryType ORM models for the
accessory module. Add item_type column to FinishedGoodsBoxItem to
distinguish between products and accessories in boxing records.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Misaka
2026-05-24 17:30:00 +08:00
parent 9edbde7a63
commit fdea0870f3
2 changed files with 47 additions and 0 deletions

View File

@@ -58,6 +58,9 @@ class FinishedGoodsBoxItem(Base):
box_id: Mapped[int] = mapped_column(BigInteger, nullable=False)
zongpai_no: Mapped[str] = mapped_column(String(64), nullable=False)
quantity: Mapped[float | None] = mapped_column(Numeric(18, 3), nullable=True)
item_type: Mapped[str] = mapped_column(
String(16), nullable=False, default="product", server_default="product"
)
created_at: Mapped[datetime] = mapped_column(
DateTime,
nullable=False,