"""Pydantic models for cinema, movie, and showtime data."""
from __future__ import annotations
from datetime import date, time
from pydantic import BaseModel, Field
class Showtime(BaseModel):
"""A movie showtime at a specific cinema."""
cinema_name: str = Field(..., description="Name of the cinema")
movie_title: str = Field(..., description="Title of the movie")
showtime_date: date = Field(..., description="Date of the showtime")
showtime_time: time = Field(..., description="Time of the showtime")
model_config = {"populate_by_name": True}
class Movie(BaseModel):
"""A movie playing in Amsterdam cinemas."""
title: str = Field(..., description="Title of the movie")
rating: float | None = Field(None, description="Movie rating (e.g., 7.6)")
showtimes: list[Showtime] = Field(default_factory=list, description="List of showtimes")
class Cinema(BaseModel):
"""A cinema in Amsterdam."""
name: str = Field(..., description="Name of the cinema")
address: str | None = Field(None, description="Address of the cinema")
movies: list[Movie] = Field(default_factory=list, description="Movies playing at this cinema")