View Revisions: Issue #5889

Summary 0005889: Reject logic crashes for across-the-zero reimbursements.
Revision 2019-09-11 00:06 by Marcello Stanisci
Description Say account A gave 10 KUDOS to account B with transaction T, and at some point B rejects transaction T *but* has only 4 KUDOS left on their account. The operation is legitimate if the bank allows their account to reach - for example - 10 KUDOS debit.

Nonetheless, the current logic would not accomplish this operation because it will try to subtract 10 KUDOS (T's amount) from 4 KUDOS (B's balance), and raise (unhandled) ValueError!

The solution would be for the subtraction to go debit until the allowed threshold, and only raise exception if this limit is surpassed.
Revision 2019-09-11 00:05 by Marcello Stanisci
Description Say account A gave 10 KUDOS to account B with transaction T, and at some point B rejects transaction T *but* has only 4 KUDOS left on their account. The operation is legitimate if the bank allows their account to reach - for example - 10 KUDOS debit.

Nonetheless, the current logic would not accomplish this operation because it will try to simply subtract 10 KUDOS (T's amount) from 4 KUDOS (B's balance), and raise (unhandled) ValueError!

The solution would be for the subtraction to go debit until the allowed threshold, and only raise exception if this limit is surpassed.