update librerias

This commit is contained in:
2022-08-23 17:12:09 -05:00
parent 7f7dfbe9c1
commit 2a031a7658
25 changed files with 2775 additions and 3297 deletions
+20 -18
View File
@@ -72,7 +72,7 @@ export class MultaService {
'No se mandó ningún motivo para multar a este alumno.',
);
return this.repository
.findOne({ prestamo })
.findOne({ where: { prestamo } })
.then((existeMulta) => {
if (existeMulta)
throw new ConflictException(
@@ -107,27 +107,29 @@ export class MultaService {
desactivarMultas() {
const ahora = moment();
return this.repository.find({ activo: true }).then(async (multas) => {
for (let i = 0; i < multas.length; i++)
if (ahora.diff(moment(multas[i].fecha_fin)) > 0) {
const instituciones = multas[i].prestamo.usuario.instituciones;
return this.repository
.find({ where: { activo: true } })
.then(async (multas) => {
for (let i = 0; i < multas.length; i++)
if (ahora.diff(moment(multas[i].fecha_fin)) > 0) {
const instituciones = multas[i].prestamo.usuario.instituciones;
multas[i].activo = false;
await this.repository.save(multas[i]);
for (let j = 0; j < instituciones.length; j++) {
const institucionUsuario = instituciones[j];
multas[i].activo = false;
await this.repository.save(multas[i]);
for (let j = 0; j < instituciones.length; j++) {
const institucionUsuario = instituciones[j];
if (
institucionUsuario.institucionCarrera.institucion
.id_institucion ===
multas[i].opeardorMulta.institucion.id_institucion
) {
institucionUsuario.multa = false;
await this.institucionUsuarioService.update(institucionUsuario);
if (
institucionUsuario.institucionCarrera.institucion
.id_institucion ===
multas[i].opeardorMulta.institucion.id_institucion
) {
institucionUsuario.multa = false;
await this.institucionUsuarioService.update(institucionUsuario);
}
}
}
}
});
});
}
async findAll(filtros: {