from datetime import datetime from pydantic import BaseModel, ConfigDict, EmailStr, Field class ContactCreate(BaseModel): account_id: int | None = None first_name: str = Field(..., min_length=1, max_length=120) last_name: str | None = Field(None, max_length=120) email: EmailStr | None = None phone: str | None = Field(None, max_length=40) mobile: str | None = Field(None, max_length=40) job_title: str | None = Field(None, max_length=120) department: str | None = Field(None, max_length=120) is_primary: bool = False owner_user_id: str | None = Field(None, max_length=64) notes: str | None = None class ContactUpdate(BaseModel): account_id: int | None = None first_name: str | None = Field(None, min_length=1, max_length=120) last_name: str | None = Field(None, max_length=120) email: EmailStr | None = None phone: str | None = Field(None, max_length=40) mobile: str | None = Field(None, max_length=40) job_title: str | None = Field(None, max_length=120) department: str | None = Field(None, max_length=120) is_primary: bool | None = None owner_user_id: str | None = Field(None, max_length=64) notes: str | None = None class ContactResponse(BaseModel): model_config = ConfigDict(from_attributes=True) id: int account_id: int | None first_name: str last_name: str | None email: str | None phone: str | None mobile: str | None job_title: str | None department: str | None is_primary: bool owner_user_id: str | None notes: str | None tenant_id: int company_id: int created_at: datetime updated_at: datetime