from typing import Optional, Any
from datetime import datetime

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.businesses import BusinessType


class Business[Properties: Any](Core[Properties]):
  name: str
  type: BusinessType

  code: Optional[str]
  alias: Optional[str]

  logo: Optional[str]
  cover: Optional[str]
  slogan: Optional[str]

  state: State
  status: Status

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

  address: Optional[str]
  support: Optional[str]
  website: Optional[str]
  location: Optional[str]
  categories: Optional[str]

  founder: Optional[str]
  co_founders: Optional[str]

  partners: Optional[str]  # Business ID's
  investors: Optional[str]  # Business ID's
  suppliers: Optional[str]  # Business ID's
  customers: Optional[str]  # Business ID's

  foundation_date: datetime


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


class BusinessDto[Properties: Any](Dto[Properties]):
  name: str
  type: BusinessType

  code: Optional[str]
  alias: Optional[str]

  logo: Optional[str]
  cover: Optional[str]
  slogan: Optional[str]

  state: State
  status: Status

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

  address: Optional[str]
  support: Optional[str]
  website: Optional[str]
  location: Optional[str]
  categories: Optional[str]

  founder: Optional[str]
  co_founders: Optional[str]

  partners: Optional[str]  # Business ID's
  investors: Optional[str]  # Business ID's
  suppliers: Optional[str]  # Business ID's
  customers: Optional[str]  # Business ID's

  foundation_date: datetime
