from datetime import datetime

from pydantic import BaseModel, Field


class ContactRequestCreate(BaseModel):
    phone: str = Field(..., description="手机号")
    company_name: str = Field(..., description="公司名称")
    industry: str = Field(..., description="行业")
    name: str = Field(..., description="姓名")
    message: str | None = Field(None, description="留言")


class ContactRequestOut(BaseModel):
    id: str
    user_id: str
    phone: str
    company_name: str
    industry: str
    name: str
    message: str | None
    is_handled: bool
    created_at: datetime

    class Config:
        from_attributes = True


class ContactRequestListOut(BaseModel):
    items: list[ContactRequestOut]
    total: int