25 lines
798 B
Python
25 lines
798 B
Python
from pydantic import BaseModel, Field
|
|
from typing import Optional
|
|
from datetime import datetime
|
|
import uuid
|
|
|
|
class ContactFormBase(BaseModel):
|
|
name: str = Field(..., description="Contact name")
|
|
phone_number: str = Field(..., description="Contact phone number")
|
|
address: str = Field(..., description="Contact address")
|
|
|
|
class ContactFormCreate(ContactFormBase):
|
|
pass
|
|
|
|
class ContactFormUpdate(ContactFormBase):
|
|
name: Optional[str] = Field(None, description="Contact name")
|
|
phone_number: Optional[str] = Field(None, description="Contact phone number")
|
|
address: Optional[str] = Field(None, description="Contact address")
|
|
|
|
class ContactFormSchema(ContactFormBase):
|
|
id: uuid.UUID
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
|
|
class Config:
|
|
orm_mode = True |