modified newSaldo

This commit is contained in:
2025-10-29 08:16:36 -06:00
parent aae6cb8704
commit 3a3e145642
2 changed files with 10 additions and 1 deletions
@@ -112,6 +112,10 @@ export class PersonaService {
select: { cantidadCuenta: true },
});
if (!persona) {
throw new NotFoundException('user not found');
}
return persona?.cantidadCuenta;
}
+6 -1
View File
@@ -33,7 +33,12 @@ export class OperationsService {
this.pagoKioscoService.create(pagoKiosco);
const newSaldo = this.personaService.updateSaldo(idPersona, cantidad);
let newSaldo: number;
if (transaccion === 'Inscripcion') {
newSaldo = await this.personaService.saldo(idPersona);
} else {
newSaldo = await this.personaService.updateSaldo(idPersona, cantidad);
}
return newSaldo;
}