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

from pydantic import Field

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


class SubclassSpellPrerequisite(SRDModel):
    index: str
    type: str
    name: str
    url: str


class SubclassSpell(SRDModel):
    prerequisites: list[SubclassSpellPrerequisite]
    spell: APIReference


class Subclass(SRDModel):
    index: str
    name: str
    class_: APIReference = Field(alias="class")
    subclass_flavor: str
    desc: list[str]
    subclass_levels: str
    spells: list[SubclassSpell] | None = None
    url: str
