12 lines
286 B
Python
12 lines
286 B
Python
from dataclasses import dataclass
|
|
|
|
from domain.marketplace.money import Money
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class Price(Money):
|
|
def __post_init__(self):
|
|
super().__post_init__()
|
|
if self.amount < 0:
|
|
raise ValueError(f"Price cannot be negative: {self.amount}")
|