# Auto-generated by DjangoCFG - see CLAUDE.md

from __future__ import annotations
import datetime
from typing import Any

from pydantic import BaseModel, ConfigDict, Field

from ..enums import LeadDetailContactType, LeadDetailStatus


class LeadDetail(BaseModel):
    """
    Serializer for lead detail view.

    Response model (includes read-only fields).
    """

    model_config = ConfigDict(
        validate_assignment=True,
        extra="allow",
        frozen=False,
    )

    id: str = ...
    name: Any = ...
    email: str = ...
    subject: Any = ...
    status: LeadDetailStatus = Field(description='* `new` - New * `contacted` - Co...')
    status_color: Any = ...
    project_slug: Any = Field(pattern='^[-a-zA-Z0-9_]+$')
    contact_type: LeadDetailContactType = Field(description='* `email` - Email * `whatsapp` -...')
    created_at: datetime.datetime = ...
    company: str | None = Field(None, max_length=255)
    company_site: str | None = Field(None, max_length=200)
    contact_value: str | None = Field(None, max_length=255)
    message: str = ...
    extra: dict[str, Any] | None = None
    site_url: str | None = Field(None, max_length=200)
    user_agent: str | None = None
    ip_address: str | None = None
    admin_notes: str | None = None
    updated_at: datetime.datetime = ...



class PatchedLeadUpdateRequest(BaseModel):
    """
    Serializer for updating lead status/notes by admin.

    Request model (no read-only fields).
    """

    model_config = ConfigDict(
        validate_assignment=True,
        extra="allow",
        frozen=False,
    )

    status: LeadDetailStatus | None = Field(
    None,
    description='* `new` - New * `contacted` - Co...',
)
    admin_notes: str | None = None



class LeadList(BaseModel):
    """
    Serializer for listing leads.

    Response model (includes read-only fields).
    """

    model_config = ConfigDict(
        validate_assignment=True,
        extra="allow",
        frozen=False,
    )

    id: str = ...
    name: Any = ...
    email: str = ...
    subject: Any = ...
    status: LeadDetailStatus = Field(description='* `new` - New * `contacted` - Co...')
    status_color: Any = ...
    project_slug: Any = Field(pattern='^[-a-zA-Z0-9_]+$')
    contact_type: LeadDetailContactType = Field(description='* `email` - Email * `whatsapp` -...')
    created_at: datetime.datetime = ...



class LeadSubmitRequest(BaseModel):
    """
    Serializer for public lead form submission.

    Request model (no read-only fields).
    """

    model_config = ConfigDict(
        validate_assignment=True,
        extra="allow",
        frozen=False,
    )

    name: str = Field(description="Submitter's full name", min_length=1, max_length=255)
    email: str | None = None
    company: str | None = Field(None, max_length=255)
    company_site: str | None = None
    contact_type: LeadDetailContactType | None = Field(
    None,
    description='* `email` - Email * `whatsapp` -...',
)
    contact_value: str | None = Field(None, max_length=255)
    subject: str | None = Field(None, max_length=255)
    message: str = Field(description='Main inquiry message', min_length=1)
    extra: dict[str, Any] | None = None



class LeadSubmitResponse(BaseModel):
    """
    Response serializer for lead submission.

    Response model (includes read-only fields).
    """

    model_config = ConfigDict(
        validate_assignment=True,
        extra="allow",
        frozen=False,
    )

    success: bool = ...
    message: str | None = None
    lead_id: str | None = None
    error: str | None = None



class PaginatedLeadListList(BaseModel):
    """
    
    Response model (includes read-only fields).
    """

    model_config = ConfigDict(
        validate_assignment=True,
        extra="allow",
        frozen=False,
    )

    count: int = Field(description='Total number of items across all...')
    page: int = Field(description='Current page number (1-based)')
    pages: int = Field(description='Total number of pages')
    page_size: int = Field(description='Number of items per page')
    has_next: bool = Field(description='Whether there is a next page')
    has_previous: bool = Field(description='Whether there is a previous page')
    next_page: int | None = Field(None, description='Next page number (null if no nex...')
    previous_page: int | None = Field(None, description='Previous page number (null if no...')
    results: list[LeadList] = Field(description='Array of items for current page')



