feat: add addition and subtraction to Money and Price
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user