.
This commit is contained in:
parent
cfbc4e6657
commit
4361df07a0
@ -10,6 +10,7 @@ import { z } from "zod/v4";
|
|||||||
|
|
||||||
export const NumericStringSchema = z
|
export const NumericStringSchema = z
|
||||||
.string()
|
.string()
|
||||||
|
.trim()
|
||||||
.regex(/^\d*$/, { message: "Must be empty or contain only digits (0-9)." });
|
.regex(/^\d*$/, { message: "Must be empty or contain only digits (0-9)." });
|
||||||
|
|
||||||
// Cantidad de dinero (base): solo para la cantidad y la escala, sin moneda
|
// Cantidad de dinero (base): solo para la cantidad y la escala, sin moneda
|
||||||
|
|||||||
@ -32,8 +32,6 @@ export class ProformaUpdater implements IProformaUpdater {
|
|||||||
}): Promise<Result<Proforma, Error>> {
|
}): Promise<Result<Proforma, Error>> {
|
||||||
const { companyId, id, patchProps, transaction } = params;
|
const { companyId, id, patchProps, transaction } = params;
|
||||||
|
|
||||||
console.log("patchProps => ", patchProps);
|
|
||||||
|
|
||||||
// Recuperar agregado existente
|
// Recuperar agregado existente
|
||||||
const existingResult = await this.repository.getByIdInCompany(companyId, id, transaction);
|
const existingResult = await this.repository.getByIdInCompany(companyId, id, transaction);
|
||||||
|
|
||||||
@ -50,8 +48,6 @@ export class ProformaUpdater implements IProformaUpdater {
|
|||||||
return Result.fail(updateResult.error);
|
return Result.fail(updateResult.error);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(proforma);
|
|
||||||
|
|
||||||
// Persistir cambios
|
// Persistir cambios
|
||||||
const saveResult = await this.repository.update(proforma, transaction);
|
const saveResult = await this.repository.update(proforma, transaction);
|
||||||
|
|
||||||
|
|||||||
@ -52,9 +52,6 @@ export class UpdateProformaUseCase {
|
|||||||
|
|
||||||
const patchProps: ProformaPatchProps = patchPropsResult.data;
|
const patchProps: ProformaPatchProps = patchPropsResult.data;
|
||||||
|
|
||||||
console.log("dto => ", dto);
|
|
||||||
console.log("patchProps => ", patchProps);
|
|
||||||
|
|
||||||
return this.transactionManager.complete(async (transaction) => {
|
return this.transactionManager.complete(async (transaction) => {
|
||||||
try {
|
try {
|
||||||
const updateResult = await this.updater.update({
|
const updateResult = await this.updater.update({
|
||||||
|
|||||||
@ -171,8 +171,6 @@ export class Proforma extends AggregateRoot<ProformaInternalProps> implements IP
|
|||||||
...otherProps,
|
...otherProps,
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log(candidateProps);
|
|
||||||
|
|
||||||
// Validacciones
|
// Validacciones
|
||||||
const validationResult = Proforma.validateCreateProps(candidateProps);
|
const validationResult = Proforma.validateCreateProps(candidateProps);
|
||||||
|
|
||||||
|
|||||||
@ -33,7 +33,6 @@ export class GetIssuedInvoiceByIdController extends ExpressController {
|
|||||||
|
|
||||||
return result.match(
|
return result.match(
|
||||||
(data) => {
|
(data) => {
|
||||||
console.log(data);
|
|
||||||
const dto = GetIssuedInvoiceByIdResponseSchema.parse(data);
|
const dto = GetIssuedInvoiceByIdResponseSchema.parse(data);
|
||||||
return this.ok(dto);
|
return this.ok(dto);
|
||||||
},
|
},
|
||||||
|
|||||||
@ -435,7 +435,6 @@ export class SequelizeIssuedInvoiceDomainMapper extends SequelizeDomainMapper<
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 3) Cliente
|
// 3) Cliente
|
||||||
console.debug(source.recipient);
|
|
||||||
const recipient = this._recipientMapper.mapToPersistence(source.recipient, {
|
const recipient = this._recipientMapper.mapToPersistence(source.recipient, {
|
||||||
errors,
|
errors,
|
||||||
parent: source,
|
parent: source,
|
||||||
|
|||||||
@ -53,9 +53,7 @@ export const ProformaUpdateComp = ({ proforma: proformaData }: ProformaUpdateCom
|
|||||||
});
|
});
|
||||||
|
|
||||||
const handleSubmit = (formData: ProformaFormData) => {
|
const handleSubmit = (formData: ProformaFormData) => {
|
||||||
console.log("Guardo factura");
|
|
||||||
const dto = ProformaDtoAdapter.toDto(formData, context);
|
const dto = ProformaDtoAdapter.toDto(formData, context);
|
||||||
console.log("dto => ", dto);
|
|
||||||
mutate(
|
mutate(
|
||||||
{ id: proforma_id, data: dto as Partial<ProformaFormData> },
|
{ id: proforma_id, data: dto as Partial<ProformaFormData> },
|
||||||
{
|
{
|
||||||
|
|||||||
@ -33,12 +33,8 @@ export const useProformaUpdateMutation = () => {
|
|||||||
throw new ValidationErrorCollection("Validation failed", toValidationErrors(result.error));
|
throw new ValidationErrorCollection("Validation failed", toValidationErrors(result.error));
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("Hola!!!");
|
|
||||||
|
|
||||||
const dto: UpdateProformaByIdResult = await updateProformaById(dataSource, params);
|
const dto: UpdateProformaByIdResult = await updateProformaById(dataSource, params);
|
||||||
|
|
||||||
console.log(dto);
|
|
||||||
|
|
||||||
return GetProformaByIdAdapter.fromDto(dto);
|
return GetProformaByIdAdapter.fromDto(dto);
|
||||||
},
|
},
|
||||||
onSuccess: async (proforma) => {
|
onSuccess: async (proforma) => {
|
||||||
|
|||||||
@ -12,7 +12,6 @@ export const useUpdateProformaPageController = () => {
|
|||||||
defaultLanguageCode: updateCtrl.form.watch("languageCode"),
|
defaultLanguageCode: updateCtrl.form.watch("languageCode"),
|
||||||
defaultCurrencyCode: updateCtrl.form.watch("currencyCode"),
|
defaultCurrencyCode: updateCtrl.form.watch("currencyCode"),
|
||||||
onCustomerSelected: (customer) => {
|
onCustomerSelected: (customer) => {
|
||||||
console.log(customer);
|
|
||||||
updateCtrl.setCustomer(customer);
|
updateCtrl.setCustomer(customer);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@ -148,8 +148,6 @@ export class CreateProformaFromFactugesUseCase {
|
|||||||
return Result.fail(createResult.error);
|
return Result.fail(createResult.error);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(createResult.data);
|
|
||||||
|
|
||||||
// Valida que los datos de entrada coincidan con el snapshot
|
// Valida que los datos de entrada coincidan con el snapshot
|
||||||
const proforma = createResult.data;
|
const proforma = createResult.data;
|
||||||
const validationResult = this.validateDraftAgainstProforma(proformaDraft, proforma);
|
const validationResult = this.validateDraftAgainstProforma(proformaDraft, proforma);
|
||||||
@ -238,6 +236,7 @@ export class CreateProformaFromFactugesUseCase {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (errors.length > 0) {
|
if (errors.length > 0) {
|
||||||
|
console.error(errors);
|
||||||
return Result.fail(
|
return Result.fail(
|
||||||
new ValidationErrorCollection(
|
new ValidationErrorCollection(
|
||||||
"La proforma generada no coincide con las magnitudes validadas del borrador importado.",
|
"La proforma generada no coincide con las magnitudes validadas del borrador importado.",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user