from typing import Optional, Any
from datetime import datetime


from ....core.enums.state import State
from ....core.enums.status import Status
from ....core.interfaces.dto import Dto
from ....core.interfaces.core import Core
from ....enums.career.branches import BranchType


class Branch[Properties: Any](Core[Properties]):
  type: BranchType

  name: Optional[str]
  business: str  # Business ID

  code: Optional[str]

  state: Optional[State]
  status: Status

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

  parent: Optional[str]  # Origin Branch ID
  manager: Optional[str]  # Employee ID

  location: str

  phone: Optional[str]
  address: Optional[str]

  opening_date: Optional[datetime]


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


class BranchDto[Properties: Any](Dto[Properties]):
  type: BranchType

  name: Optional[str]
  business: str  # Business ID

  code: Optional[str]

  state: Optional[State]
  status: Status

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

  parent: Optional[str]  # Origin Branch ID
  manager: Optional[str]  # Employee ID

  location: str

  phone: Optional[str]
  address: Optional[str]

  opening_date: Optional[datetime]
