from typing import Optional, List, Any

from ....core.interfaces.dto import Dto
from ....core.interfaces.core import Core
from ....enums.special.stats import StatKey, StatType


class Stat[Properties: Any](Core[Properties]):
  type: StatType

  key: StatKey | str

  obj: Optional[str]
  flag: Optional[str]

  day: Optional[int]
  month: Optional[int]
  year: int

  hours: Optional[List[int]]
  days: Optional[List[int]]
  months: Optional[List[int]]


# ----------------------------------------
# Data Transfer Object Interface
# ----------------------------------------


class StatDto[Properties: Any](Dto[Properties]):
  type: StatType

  key: StatKey | str

  obj: Optional[str]
  flag: Optional[str]

  day: Optional[int]
  month: Optional[int]
  year: Optional[int]

  hours: Optional[List[int]]
  days: Optional[List[int]]
  months: Optional[List[int]]


class StatCollectDto[Properties: Any](Dto[Properties]):
  type: Optional[StatType]

  key: StatKey | str
  val: Optional[float]

  obj: Optional[str]
  flag: Optional[str]

  day: Optional[int]
  month: Optional[int]
  year: Optional[int]

  hours: Optional[List[int]]
  days: Optional[List[int]]
  months: Optional[List[int]]
