from pydantic import BaseModel, EmailStr, Field
class CustomerCreate(BaseModel):
    name: str = Field(min_length=2, max_length=150)
    mobile: str = Field(min_length=7, max_length=30)
    email: EmailStr | None = None
    city: str | None = None
    consent_whatsapp: bool = False
class CustomerUpdate(BaseModel):
    name: str | None = None
    email: EmailStr | None = None
    city: str | None = None
    consent_whatsapp: bool | None = None
class CustomerOut(BaseModel):
    id: int
    brand_id: int
    customer_code: str
    name: str
    mobile: str
    email: str | None
    city: str | None
    lifetime_points: int
    points_balance: int
    status: str
    model_config = {"from_attributes": True}
