from typing import Optional, Any

from ....core.interfaces.dto import Dto
from ....core.interfaces.core import Core


class InvoiceItem[Properties: Any](Core[Properties]):
  title: Optional[str]

  price: float
  quantity: float  # default: 1

  profit: Optional[float]
  discount: Optional[float]

  measurement: Optional[str]  # Unit of Measurement


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


class InvoiceItemDto[Properties: Any](Dto[Properties]):
  title: Optional[str]

  price: float
  quantity: Optional[float]  # default: 1

  profit: Optional[float]
  discount: Optional[float]

  measurement: Optional[str]  # Unit of Measurement
