from __future__ import annotations

from pydantic import BaseModel, ConfigDict, Field


class EnderecoBase(BaseModel):
    titulo: str | None = Field(default=None, max_length=255)
    cep: str | None = Field(default=None, max_length=99)
    logradouro: str | None = Field(default=None, max_length=255)
    numero: str | None = Field(default=None, max_length=50)
    complemento: str | None = Field(default=None, max_length=255)
    cidade: str | None = Field(default=None, max_length=255)
    estado: str | None = Field(default=None, max_length=20)
    pais: str | None = Field(default=None, max_length=99)
    latitude: float | None = None
    longitude: float | None = None
    bairro: str | None = Field(default=None, max_length=255)


class EnderecoCreate(EnderecoBase):
    pass


class EnderecoUpdate(EnderecoBase):
    pass


class EnderecoOut(EnderecoBase):
    id: str
    createdAt: str
    updatedAt: str

    model_config = ConfigDict(from_attributes=True)
