redesing product lists

This commit is contained in:
2025-05-28 11:01:42 +02:00
parent 330124837f
commit eb3ae05425
12 changed files with 1569 additions and 809 deletions

View File

@@ -117,6 +117,7 @@ class ProductInEvent(BaseModel):
product_id: int
amount: float = Field(..., gt=0)
price: float = Field(..., ge=0) # Price at the time of this shopping event (allow free items)
discount: bool = False # Whether this product was purchased with a discount
class ProductWithEventData(BaseModel):
id: int
@@ -128,6 +129,7 @@ class ProductWithEventData(BaseModel):
weight_unit: str
amount: float # Amount purchased in this event
price: float # Price at the time of this event
discount: bool # Whether this product was purchased with a discount
class Config:
from_attributes = True