from typing import Optional, List, Any

from ....core.enums.state import State
from ....core.interfaces.dto import Dto
from ....core.interfaces.core import Core
from .feature import ProductFeature, ProductFeatureDto


class Product[Properties: Any](Core[Properties]):
  name: str
  alias: Optional[str]

  state: Optional[State]

  store: Optional[str]
  branch: Optional[str]
  business: Optional[str]

  brand: Optional[str]
  content: Optional[str]

  cover: Optional[str]
  gallery: Optional[List[str]]
  categories: Optional[List[str]]

  rate: float
  votes: Optional[int]
  rating: Optional[float]

  features: Optional[List[ProductFeature]]


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


class ProductDto[Properties: Any](Dto[Properties]):
  name: str
  alias: Optional[str]

  state: Optional[State]

  store: Optional[str]
  branch: Optional[str]
  business: Optional[str]

  brand: Optional[str]
  content: Optional[str]

  cover: Optional[str]
  gallery: Optional[List[str]]
  categories: Optional[List[str]]

  rate: float
  votes: Optional[int]
  rating: Optional[float]

  features: Optional[List[ProductFeatureDto]]
