49c813778b
- Restructure table models - Remove React/Next.js frontend (in favor of HTMX)
42 lines
810 B
Python
42 lines
810 B
Python
"""
|
|
Custom validation schema
|
|
"""
|
|
from sqlmodel import SQLModel
|
|
from typing import Optional
|
|
|
|
|
|
class ClientCreate(SQLModel):
|
|
tin_number: int
|
|
names: str
|
|
phone_number: str
|
|
|
|
|
|
class ClientUpdate(SQLModel):
|
|
tin_number: Optional[int] = None
|
|
names: Optional[str] = None
|
|
phone_number: Optional[str] = None
|
|
|
|
|
|
class SupplierCreate(SQLModel):
|
|
tin_number: int
|
|
names: str
|
|
phone_number: str
|
|
|
|
|
|
class SupplierUpdate(ClientUpdate):
|
|
tin_number: Optional[int] = None
|
|
names: Optional[str] = None
|
|
phone_number: Optional[str] = None
|
|
|
|
|
|
class ProductCreate(SQLModel):
|
|
product_code: str
|
|
product_name: str
|
|
purchase_price: int
|
|
|
|
|
|
class ProductUpdate(SQLModel):
|
|
product_code: Optional[str] = None
|
|
product_name: Optional[str] = None
|
|
purchase_price: Optional[int] = None
|