yapapi
yapapi copied to clipboard
Move the decision "DebitNote/Invoice -> accepted amount" to the MarketStrategy
Something like:
class MarketStrategy:
async def accepted_amount(document: Union[DebitNote, Invoice]) -> float:
# current "default" implementation
return document.amount
Additional things that could be done within this issue:
- Why do we have
Invoice.amount
andDebitNote.total_amount_due
? Is there any meaningful difference? - Why do we accept invoices in two different places in
yapapi.engine
? Maybe this could be refactored?