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

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


class SpellDamage(SRDModel):
    damage_type: APIReference | None = None
    damage_at_slot_level: dict[str, str] | None = None
    damage_at_character_level: dict[str, str] | None = None


class SpellDC(SRDModel):
    dc_type: APIReference
    dc_success: str
    desc: str | None = None


class Spell(SRDModel):
    index: str
    name: str
    desc: list[str]
    higher_level: list[str] | None = None
    range: str
    components: list[str]
    material: str | None = None
    ritual: bool
    duration: str
    concentration: bool
    casting_time: str
    level: int
    attack_type: str | None = None
    damage: SpellDamage | None = None
    dc: SpellDC | None = None
    area_of_effect: AreaOfEffect | None = None
    heal_at_slot_level: dict[str, str] | None = None
    school: APIReference
    classes: list[APIReference]
    subclasses: list[APIReference] | None = None
    url: str
