from pydantic import BaseModel
from datetime import datetime

class BookingBase(BaseModel):
    user_id: int
    product_id: int
    amount: int
    total_cents: int
    comment: str | None = None

class BookingCreate(BookingBase):
    pass

class BookingOut(BookingBase):
    id: int
    timestamp: datetime

    class Config:
        from_attributes = True  # Pydantic V2
