"""Customers schemas."""
from __future__ import annotations


from datetime import datetime, date, time
from uuid import UUID

from pydantic import BaseModel, ConfigDict, Field

from app.models.types import LifecycleStatus
from app.schemas.common import ORMBase

_FORBID = ConfigDict(extra="forbid")


class CustomerProfileCreate(BaseModel):
    model_config = _FORBID

    organization_id: UUID
    code: str = Field(max_length=50)
    display_name: str = Field(max_length=255)
    external_crm_contact_ref: str | None = None
    external_user_ref: str | None = None
    mobile: str | None = None
    email: str | None = None
    status: LifecycleStatus = LifecycleStatus.ACTIVE
    metadata_json: dict | None = None


class CustomerProfileRead(ORMBase):
    id: UUID
    tenant_id: UUID
    organization_id: UUID
    code: str
    display_name: str
    external_crm_contact_ref: str | None
    external_user_ref: str | None
    mobile: str | None
    email: str | None
    status: LifecycleStatus
    metadata_json: dict | None
    is_deleted: bool
    created_by: str | None
    updated_by: str | None
    created_at: datetime
    updated_at: datetime
