from typing import Optional, List, 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.employees import EmployeeType
from ....enums.career.common.range import LocationRange


class Employee[Properties: Any](Core[Properties]):
  type: EmployeeType
  range: Optional[LocationRange]

  job_title: str
  profile: Optional[str]  # Profile ID

  branch: Optional[str]  # Branch ID
  manager: Optional[str]  # Employee ID
  business: str  # Business ID

  location: Optional[str]
  services: Optional[List[str]]  # Service ID's

  state: State
  status: Status

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

  salary: Optional[float]
  currency: Optional[str]
  department: Optional[str]

  grade: Optional[float]
  level: Optional[str]

  hire_date: Optional[datetime]
  fire_date: Optional[datetime]

  skills: Optional[List[str]]
  documents: Optional[List[str]]  # file ID
  certifications: Optional[List[str]]  # file ID


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


class EmployeeDto[Properties: Any](Dto[Properties]):
  type: EmployeeType
  range: Optional[LocationRange]

  job_title: str
  profile: Optional[str]  # Profile ID

  branch: Optional[str]  # Branch ID
  manager: Optional[str]  # Employee ID
  business: str  # Business ID

  location: Optional[str]
  services: Optional[List[str]]  # Service ID's

  state: State
  status: Status

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

  salary: Optional[float]
  currency: Optional[str]
  department: Optional[str]

  grade: Optional[float]
  level: Optional[str]

  hire_date: Optional[datetime]
  fire_date: Optional[datetime]

  skills: Optional[List[str]]
  documents: Optional[List[str]]  # file ID
  certifications: Optional[List[str]]  # file ID
