from typing import Optional, List, Any

from ....core.enums.state import State
from ....core.interfaces.dto import Dto
from ....core.enums.status import Status
from ....core.interfaces.core import Core
from ....enums.career.services import ServiceType
from ....enums.career.common.range import LocationRange


class Service[Properties: Any](Core[Properties]):
  type: ServiceType
  range: Optional[LocationRange]

  name: str

  state: State
  status: Status

  branch: Optional[str]
  business: str

  location: Optional[str]
  categories: Optional[List[str]]

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

  currency: Optional[str]  # Currency ID

  unit: Optional[str]
  price: Optional[float]
  profit: Optional[float]
  discount: Optional[float]


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


class ServiceDto[Properties: Any](Dto[Properties]):
  type: ServiceType
  range: Optional[LocationRange]

  name: str

  state: Optional[State]
  status: Status

  branch: Optional[str]
  business: str

  location: Optional[str]
  categories: Optional[List[str]]

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

  currency: Optional[str]  # Currency ID

  unit: Optional[str]
  price: Optional[float]
  profit: Optional[float]
  discount: Optional[float]
