"""
I Ching attributes and data structures.

This module defines attributes specific to the I Ching system,
including Trigrams and Hexagrams.
"""

from dataclasses import dataclass, field
from typing import List, Optional

from utils.attributes import Number, Planet


@dataclass
class Trigram:
    """Represents one of the eight I Ching trigrams."""

    name: str
    chinese_name: str
    pinyin: str
    element: str
    attribute: str
    binary: str
    description: str = ""
    line_diagram: str = ""


@dataclass
class Hexagram:
    """Represents an I Ching hexagram with Tarot correspondence."""

    number: int
    name: str
    chinese_name: str
    pinyin: str
    judgement: str
    image: str
    upper_trigram: Trigram
    lower_trigram: Trigram
    keywords: List[str] = field(default_factory=list)
    associated_number: Optional[Number] = None
    planetary_influence: Optional[Planet] = None
    notes: str = ""
    line_diagram: str = ""
