yapapi icon indicating copy to clipboard operation
yapapi copied to clipboard

Move the decision "DebitNote/Invoice -> accepted amount" to the MarketStrategy

Open johny-b opened this issue 2 years ago • 0 comments

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 and DebitNote.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?

johny-b avatar Mar 07 '22 11:03 johny-b