import dataclasses
import datetime
import enum

from folkugat_web.model import playlists

DEFAULT_START_TIME = datetime.time(20, 30)
DEFAULT_END_TIME = datetime.time(22, 30)


@dataclasses.dataclass(frozen=True)
class SessionVenue:
    name: str | None = None
    url: str | None = None


@dataclasses.dataclass(frozen=True)
class Session:
    id: int | None = None
    date: datetime.date = dataclasses.field(default_factory=datetime.date.today)
    start_time: datetime.time = DEFAULT_START_TIME
    end_time: datetime.time = DEFAULT_END_TIME
    venue: SessionVenue = dataclasses.field(default_factory=SessionVenue)
    notes: str | None = None
    cartell_url: str | None = None
    slowjam: playlists.Playlist | None = None
    setlist: playlists.Playlist | None = None
    is_live: bool = False


@dataclasses.dataclass
class DateNames:
    day_name: str
    day: str
    month_name: str
    year: str


class SessionCols(enum.Enum):
    DATE = "date"
