from datetime import datetime
from typing import Optional

from pydantic import BaseModel, Field


class WineAppellationBaseSchema(BaseModel):
    title: str = Field(..., example="Côte de Nuits")
    country_id: Optional[int] = Field(None, example=1)
    region_id: Optional[int] = Field(None, example=5)
    sub_region_id: Optional[int] = Field(None, example=12)


class WineAppellationCreateSchema(WineAppellationBaseSchema):
    pass


class WineAppellationUpdateSchema(BaseModel):
    title: Optional[str] = Field(None, example="Updated Appellation Title")
    country_id: Optional[int] = Field(None, example=1)
    region_id: Optional[int] = Field(None, example=5)
    sub_region_id: Optional[int] = Field(None, example=12)


class WineAppellationOutSchema(WineAppellationBaseSchema):
    id: int
    created_at: datetime
    updated_at: datetime

