from typing import Optional, 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.stocks import StockType


class Stock[Properties: Any](Core[Properties]):
  type: StockType

  name: Optional[str]

  state: Optional[State]
  status: Optional[Status]

  product: str  # Product ID
  feature: Optional[str]  # ProductFeature ID's

  store: Optional[str]  # Store ID, StoreID or BusinessID is required
  branch: Optional[str]  # Branch ID
  business: Optional[str]  # Business ID, StoreID or BusinessID is required

  capacity: Optional[float]
  inventory: float

  place: Optional[str]
  position: Optional[str]

  location: Optional[str]
  threshold: Optional[float]

  currency: Optional[str]  # Currency ID

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


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


class StockDto[Properties: Any](Dto[Properties]):
  type: StockType

  name: Optional[str]

  state: Optional[State]
  status: Optional[Status]

  product: str  # Product ID
  feature: Optional[str]  # ProductFeature ID's

  store: Optional[str]  # Store ID, StoreID or BusinessID is required
  branch: Optional[str]  # Branch ID
  business: Optional[str]  # Business ID, StoreID or BusinessID is required

  capacity: Optional[float]
  inventory: float

  place: Optional[str]
  position: Optional[str]

  location: Optional[str]
  threshold: Optional[float]

  currency: Optional[str]  # Currency ID

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