Facturas de cliente

This commit is contained in:
David Arranz 2025-06-27 12:35:53 +02:00
parent 91c00e7344
commit b4c330458d
2 changed files with 6 additions and 6 deletions

View File

@ -49,11 +49,11 @@ export const listCustomerInvoicesPresenter: ListCustomerInvoicesPresenter = {
metadata: {
entity: "customer-invoices",
criteria: criteria.toJSON(),
links: {
self: `/api/customer-invoices?page=${criteria.pageNumber}&per_page=${criteria.pageSize}`,
first: `/api/customer-invoices?page=1&per_page=${criteria.pageSize}`,
last: `/api/customer-invoices?page=${Math.ceil(totalItems / criteria.pageSize)}&per_page=${criteria.pageSize}`,
},
//links: {
// self: `/api/customer-invoices?page=${criteria.pageNumber}&per_page=${criteria.pageSize}`,
// first: `/api/customer-invoices?page=1&per_page=${criteria.pageSize}`,
// last: `/api/customer-invoices?page=${Math.ceil(totalItems / criteria.pageSize)}&per_page=${criteria.pageSize}`,
//},
},
};
},

View File

@ -56,7 +56,7 @@ export class CustomerInvoiceService implements ICustomerInvoiceService {
criteria: Criteria,
transaction?: Transaction
): Promise<Result<Collection<CustomerInvoice>, Error>> {
const customerInvoicesOrError = await this.repository.findAll(criteria, transaction);
const customerInvoicesOrError = await this.repository.findByCriteria(criteria, transaction);
if (customerInvoicesOrError.isFailure) {
return Result.fail(customerInvoicesOrError.error);
}