24 lines
486 B
Python
24 lines
486 B
Python
|
|
from typing import Annotated
|
||
|
|
|
||
|
|
from pydantic import BaseModel, Field
|
||
|
|
|
||
|
|
from .status import Status
|
||
|
|
|
||
|
|
|
||
|
|
class Contact(BaseModel):
|
||
|
|
id: int
|
||
|
|
code: str
|
||
|
|
address: str | None
|
||
|
|
notes: str | None
|
||
|
|
status: Status | None
|
||
|
|
|
||
|
|
|
||
|
|
class ContactCreate(BaseModel):
|
||
|
|
code: str = Field(max_length=80)
|
||
|
|
address: Annotated[str | None, Field(max_length=253)] = None
|
||
|
|
notes: str | None = None
|
||
|
|
|
||
|
|
|
||
|
|
class ContactUpdate(ContactCreate):
|
||
|
|
code: Annotated[str | None, Field(max_length=80)] = None
|