from pydantic import BaseModel
from datetime import datetime
from typing import Optional


class CircuitBase(BaseModel):
    local_flight_id: int
    circuit_timestamp: datetime


class CircuitCreate(CircuitBase):
    pass


class CircuitUpdate(BaseModel):
    circuit_timestamp: Optional[datetime] = None


class Circuit(CircuitBase):
    id: int
    created_at: datetime

    class Config:
        from_attributes = True
