feat: add max 2 decimal places validation to Money

This commit is contained in:
2026-07-29 01:20:50 -04:00
parent 94ff7c83ce
commit d098a84b03
3 changed files with 30 additions and 0 deletions

View File

@@ -6,5 +6,6 @@ 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}")