feat: add addition and subtraction to Money and Price

This commit is contained in:
2026-07-26 08:08:43 -04:00
parent 354ecbdd64
commit 3df59767ea
2 changed files with 21 additions and 0 deletions

View File

@@ -5,3 +5,9 @@ from decimal import Decimal
@dataclass(frozen=True)
class Money:
amount: Decimal
def __add__(self, other):
return Money(self.amount + other.amount)
def __sub__(self, other):
return Money(self.amount - other.amount)