ascetic_ddd.seedwork.domain.values.money.sum¶
Classes
|
Represents the sum of two monetary expressions. |
- class ascetic_ddd.seedwork.domain.values.money.sum.Sum(augend, addend)[source]¶
Bases:
ExpressionRepresents the sum of two monetary expressions.
This class enables complex expressions like (5 USD + 10 CHF) + 20 EUR to be built up and then reduced to a single currency when needed.
- Parameters:¶
- augend : Expression¶
- addend : Expression¶
- reduce(bank, to)[source]¶
Reduce this Sum to a Money object in the target currency.
This reduces both operands to the target currency and adds them.
- plus(addend)[source]¶
Add another expression to this Sum.