Skip to content

Commit

Permalink
Merge branch 'beta' into feature/JST-949/lease-module
Browse files Browse the repository at this point in the history
  • Loading branch information
SewerynKras committed May 28, 2024
2 parents fd73cb2 + ed33d45 commit 375deb7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/lease-process/lease-process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface LeaseProcessEvents {

export interface LeaseProcessOptions {
activity?: ExecutionOptions;
payment?: PaymentProcessOptions;
payment?: Partial<PaymentProcessOptions>;
networkNode?: NetworkNode;
}

Expand Down
10 changes: 6 additions & 4 deletions src/payment/agreement_payment_process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export class AgreementPaymentProcess {
* Example of a rule: you shouldn't accept a debit note if an invoice is already in place
*/
private lock: AsyncLock = new AsyncLock();
private options: PaymentProcessOptions;

public readonly logger: Logger;

Expand All @@ -56,13 +57,14 @@ export class AgreementPaymentProcess {
public readonly agreement: Agreement,
public readonly allocation: Allocation,
public readonly paymentApi: IPaymentApi,
public readonly options: PaymentProcessOptions = {
invoiceFilter: () => true,
debitNoteFilter: () => true,
},
options?: Partial<PaymentProcessOptions>,
logger?: Logger,
) {
this.logger = logger || defaultLogger("payment");
this.options = {
invoiceFilter: options?.invoiceFilter || (() => true),
debitNoteFilter: options?.debitNoteFilter || (() => true),
};
}

/**
Expand Down

0 comments on commit 375deb7

Please sign in to comment.