refactor: e2e tests for payment received

This commit is contained in:
Ahmed Bouhuolia
2024-12-30 20:58:56 +02:00
parent 515a984714
commit b046edf337
19 changed files with 237 additions and 76 deletions

View File

@@ -8,6 +8,10 @@ export class GetPaymentReceivedInvoices {
constructor(
@Inject(PaymentReceived.name)
private paymentReceiveModel: typeof PaymentReceived,
@Inject(SaleInvoice.name)
private saleInvoiceModel: typeof SaleInvoice,
private validators: PaymentReceivedValidators,
) {}
@@ -28,10 +32,10 @@ export class GetPaymentReceivedInvoices {
const paymentReceiveInvoicesIds = paymentReceive.entries.map(
(entry) => entry.invoiceId,
);
const saleInvoices = await SaleInvoice.query().whereIn(
'id',
paymentReceiveInvoicesIds,
);
const saleInvoices = await this.saleInvoiceModel
.query()
.whereIn('id', paymentReceiveInvoicesIds);
return saleInvoices;
}
}