"""Mirrors upstream src/2014/schemas/5e-SRD-Classes.ts."""

from dnd5e_db.models.base import SRDModel
from dnd5e_db.models.common import APIReference, Choice


class SpellcastingInfo(SRDModel):
    name: str
    desc: list[str]


class Spellcasting(SRDModel):
    level: int
    spellcasting_ability: APIReference
    info: list[SpellcastingInfo]


class StartingEquipment(SRDModel):
    equipment: APIReference
    quantity: int


class MultiClassingPrereq(SRDModel):
    ability_score: APIReference | None = None
    minimum_score: int


class MultiClassing(SRDModel):
    prerequisites: list[MultiClassingPrereq] | None = None
    prerequisite_options: Choice | None = None
    proficiencies: list[APIReference] | None = None
    proficiency_choices: list[Choice] | None = None


class Class(SRDModel):
    index: str
    name: str
    hit_die: int
    class_levels: str
    multi_classing: MultiClassing | None = None
    proficiencies: list[APIReference] | None = None
    proficiency_choices: list[Choice]
    saving_throws: list[APIReference] | None = None
    starting_equipment: list[StartingEquipment] | None = None
    starting_equipment_options: list[Choice]
    subclasses: list[APIReference] | None = None
    spellcasting: Spellcasting | None = None
    spells: str | None = None
    url: str
