Production
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import uuid
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
|
||||
class ChemistCreate(BaseModel):
|
||||
headquarters_id: uuid.UUID
|
||||
name: str = Field(min_length=2, max_length=200)
|
||||
shop_address: str = Field(min_length=2, max_length=500)
|
||||
contact_number: str | None = Field(default=None, max_length=20)
|
||||
|
||||
|
||||
class ChemistUpdate(BaseModel):
|
||||
name: str | None = Field(default=None, min_length=2, max_length=200)
|
||||
shop_address: str | None = Field(default=None, min_length=2, max_length=500)
|
||||
contact_number: str | None = Field(default=None, max_length=20)
|
||||
is_active: bool | None = None
|
||||
|
||||
|
||||
class ChemistRead(BaseModel):
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
id: uuid.UUID
|
||||
headquarters_id: uuid.UUID
|
||||
name: str
|
||||
shop_address: str
|
||||
contact_number: str | None
|
||||
is_active: bool
|
||||
Reference in New Issue
Block a user