new init
This commit is contained in:
28
apps/backend/app/schemas/product.py
Normal file
28
apps/backend/app/schemas/product.py
Normal file
@@ -0,0 +1,28 @@
|
||||
from pydantic import BaseModel
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
|
||||
class ProductBase(BaseModel):
|
||||
name: str
|
||||
price_cents: int # Verkaufspreis (falls genutzt)
|
||||
purchase_price_cents: int = 0 # 🆕 EK je Einheit (Cent)
|
||||
pack_size: int = 1 # 🆕 6, 12, 24 ...
|
||||
supplier_number: Optional[str] = None
|
||||
volume_ml: Optional[int] = None
|
||||
category: Optional[str] = None
|
||||
stock: int = 0 # Default sinnvoller
|
||||
is_active: bool = True # Default sinnvoller
|
||||
|
||||
class ProductCreate(ProductBase):
|
||||
pass
|
||||
|
||||
class ProductUpdate(ProductBase):
|
||||
pass
|
||||
|
||||
class ProductOut(ProductBase):
|
||||
id: int
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
Reference in New Issue
Block a user