
This API provides endpoints for: - Product and inventory management - Customer management - Order processing - Payment processing with Stripe integration - User authentication generated with BackendIM... (backend.im)
31 lines
596 B
Python
31 lines
596 B
Python
from typing import Optional
|
|
from datetime import datetime
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class InventoryBase(BaseModel):
|
|
product_id: int
|
|
quantity: int
|
|
location: Optional[str] = None
|
|
last_restock_date: Optional[datetime] = None
|
|
|
|
|
|
class InventoryCreate(InventoryBase):
|
|
pass
|
|
|
|
|
|
class InventoryUpdate(BaseModel):
|
|
quantity: Optional[int] = None
|
|
location: Optional[str] = None
|
|
last_restock_date: Optional[datetime] = None
|
|
|
|
|
|
class InventoryInDBBase(InventoryBase):
|
|
id: int
|
|
|
|
class Config:
|
|
orm_mode = True
|
|
|
|
|
|
class Inventory(InventoryInDBBase):
|
|
pass |