Skip to content

Commit

Permalink
feature: allow filter to ignore debit notes (for integration testing)
Browse files Browse the repository at this point in the history
  • Loading branch information
scx1332 committed Jul 23, 2024
1 parent b603c34 commit f8a714d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/payment/agreement_payment_process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,18 @@ export class AgreementPaymentProcess {

this.debitNotes.set(debitNote.id, debitNote);

let acceptedByFilter = false;
let acceptedByFilter: boolean = false;
try {
acceptedByFilter = await this.options.debitNoteFilter(debitNote, {
agreement: this.agreement,
allocation: this.allocation,
demand: this.agreement.demand,
});
} catch (error) {
if (error == "ignore debit note") {
// This is a special case when the filter wants to ignore the debit note
return false;
}
throw new GolemUserError("An error occurred in the debit note filter", error);
}

Expand Down

0 comments on commit f8a714d

Please sign in to comment.