Files
geMoldInsight/src/api/inventory/schemas/product_schemas.py
T

34 lines
671 B
Python
Raw Normal View History

2026-03-08 22:58:25 +08:00
from pydantic import BaseModel
from typing import Optional
from datetime import datetime
class ProductCreate(BaseModel):
sku: str
name: str
description: Optional[str] = None
category: Optional[str] = None
unit: str = "件"
cost_price: float = 0
sale_price: float = 0
min_stock: int = 0
max_stock: int = 1000
class ProductResponse(BaseModel):
id: int
sku: str
name: str
description: Optional[str]
category: Optional[str]
unit: str
cost_price: float
sale_price: float
min_stock: int
max_stock: int
is_active: bool
created_at: datetime
class Config:
from_attributes = True