brands-in-shops feature implemented
This commit is contained in:
@@ -20,6 +20,28 @@ class Brand(BrandBase):
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
# BrandInShop schemas
|
||||
class BrandInShopBase(BaseModel):
|
||||
shop_id: int
|
||||
brand_id: int
|
||||
|
||||
class BrandInShopCreate(BrandInShopBase):
|
||||
pass
|
||||
|
||||
class BrandInShopUpdate(BaseModel):
|
||||
shop_id: Optional[int] = None
|
||||
brand_id: Optional[int] = None
|
||||
|
||||
class BrandInShop(BrandInShopBase):
|
||||
id: int
|
||||
created_at: datetime
|
||||
updated_at: Optional[datetime] = None
|
||||
shop: "Shop"
|
||||
brand: "Brand"
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
# Grocery Category schemas
|
||||
class GroceryCategoryBase(BaseModel):
|
||||
name: str
|
||||
@@ -168,4 +190,7 @@ class ShopStats(BaseModel):
|
||||
shop_name: str
|
||||
total_spent: float
|
||||
visit_count: int
|
||||
avg_per_visit: float
|
||||
avg_per_visit: float
|
||||
|
||||
# Update forward references
|
||||
BrandInShop.model_rebuild()
|
||||
Reference in New Issue
Block a user