from datetime import datetime
from typing import TYPE_CHECKING, List, Optional
from uuid import UUID, uuid4

from pydantic import EmailStr, constr, validator
from sqlmodel import Column, Field, Relationship, SQLModel
from sqlmodel.sql.sqltypes import GUID

from ...utils.date import now_datetime

if TYPE_CHECKING:
    from .order import Order
    from .user import User


class BaseClient(SQLModel):
    name: str = Field(description="Client name")
    email: Optional[EmailStr] = Field(description="Client email", nullable=True)
    phone: Optional[constr(regex=r"^\d{2}9\d{8}$")] = Field(description="Client cellphone", nullable=True)  # noqa
    zip_code: Optional[str] = Field(description="Postal code", nullable=True)
    address: Optional[str] = 