Clientes y facturas de cliente

This commit is contained in:
David Arranz 2025-10-04 19:43:03 +02:00
parent 41ca0c2286
commit e719feaadf
4 changed files with 5 additions and 10 deletions

View File

@ -1,2 +1,3 @@
export * from "./customer-invoice-application.service";
export * from "./presenters";
export * from "./use-cases";

View File

@ -163,7 +163,7 @@ export class CustomerInvoiceItemDomainMapper
if (createResult.isFailure) {
return Result.fail(
new ValidationErrorCollection("Invoice item entity creation failed", [
new ValidationErrorCollection([
{ path: `items[${index}]`, message: createResult.error.message },
])
);

View File

@ -274,9 +274,7 @@ export class CustomerInvoiceDomainMapper
// 5) Si hubo errores de mapeo, devolvemos colección de validación
if (errors.length > 0) {
return Result.fail(
new ValidationErrorCollection("Customer invoice mapping failed [mapToDomain]", errors)
);
return Result.fail(new ValidationErrorCollection(errors));
}
// 6) Construcción del agregado (Dominio)
@ -321,9 +319,7 @@ export class CustomerInvoiceDomainMapper
if (createResult.isFailure) {
return Result.fail(
new ValidationErrorCollection("Customer invoice entity creation failed", [
{ path: "invoice", message: createResult.error.message },
])
new ValidationErrorCollection([{ path: "invoice", message: createResult.error.message }])
);
}

View File

@ -197,9 +197,7 @@ export class CustomerDomainMapper
// Si hubo errores de mapeo, devolvemos colección de validación
if (errors.length > 0) {
return Result.fail(
new ValidationErrorCollection("Customer props mapping failed (CustomerMapper)", errors)
);
return Result.fail(new ValidationErrorCollection(errors));
}
const customerProps: CustomerProps = {