redesing product lists
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user