feat(loyalty): multi-select categories on transactions
Some checks failed
Some checks failed
Switch from single category_id to category_ids JSON array on transactions. Sellers can now select multiple categories (e.g., Men + Accessories) when entering stamp/points transactions. - Migration loyalty_009: drop category_id FK, add category_ids JSON - Schemas: category_id → category_ids (list[int] | None) - Services: stamp_service + points_service accept category_ids - Terminal UI: pills are now multi-select (toggle on/off) - Transaction response: category_names (list[str]) resolved from IDs - Recent transactions table: new Category column showing comma- separated names Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -188,8 +188,8 @@ class TransactionResponse(BaseModel):
|
||||
order_reference: str | None = None
|
||||
reward_id: str | None = None
|
||||
reward_description: str | None = None
|
||||
category_id: int | None = None
|
||||
category_name: str | None = None
|
||||
category_ids: list[int] | None = None
|
||||
category_names: list[str] | None = None
|
||||
notes: str | None = None
|
||||
|
||||
# Customer
|
||||
|
||||
@@ -47,10 +47,10 @@ class PointsEarnRequest(BaseModel):
|
||||
description="Staff PIN for verification",
|
||||
)
|
||||
|
||||
# Category (what was sold)
|
||||
category_id: int | None = Field(
|
||||
# Categories (what was sold — multi-select)
|
||||
category_ids: list[int] | None = Field(
|
||||
None,
|
||||
description="Transaction category ID (e.g., Men, Women, Accessories)",
|
||||
description="Transaction category IDs",
|
||||
)
|
||||
|
||||
# Optional metadata
|
||||
|
||||
@@ -37,10 +37,10 @@ class StampRequest(BaseModel):
|
||||
description="Staff PIN for verification",
|
||||
)
|
||||
|
||||
# Category (what was sold)
|
||||
category_id: int | None = Field(
|
||||
# Categories (what was sold — multi-select)
|
||||
category_ids: list[int] | None = Field(
|
||||
None,
|
||||
description="Transaction category ID (e.g., Men, Women, Accessories)",
|
||||
description="Transaction category IDs",
|
||||
)
|
||||
|
||||
# Optional metadata
|
||||
|
||||
Reference in New Issue
Block a user