"""Mirrors upstream src/2024/schemas/5e-SRD-Magic-Items.ts."""

from pydantic import Field

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


class Rarity(SRDModel):
    name: str


class MagicItem(SRDModel):
    name: str
    index: str
    url: str
    image: str
    equipment_category: APIReference
    variant: bool
    variants: list[APIReference]
    attunement: bool
    rarity: Rarity
    desc: str
    limited_to: str | None = Field(default=None, alias="limited-to")
