From 2b5f226ffe035e1405c0a7dc3ed6715c6f6124e5 Mon Sep 17 00:00:00 2001 From: lemuel Date: Thu, 3 Nov 2022 03:20:49 -0600 Subject: [PATCH] listo antes de agregar passcode --- src/auth/strategy/jwt-strategy.service.ts | 1 - src/multa/multa.service.ts | 2 ++ src/prestamo/prestamo.service.ts | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/auth/strategy/jwt-strategy.service.ts b/src/auth/strategy/jwt-strategy.service.ts index e3a9eac..2bb9235 100644 --- a/src/auth/strategy/jwt-strategy.service.ts +++ b/src/auth/strategy/jwt-strategy.service.ts @@ -63,7 +63,6 @@ export class JwtStrategyService extends PassportStrategy(Strategy) { ); } user.operador = operador; - console.log(user.operador); }); // Este objeto retornado se encuentra en el objeto request // (El ojbeto que recibe toda la información de la petición) diff --git a/src/multa/multa.service.ts b/src/multa/multa.service.ts index 09e95e1..e507a5a 100644 --- a/src/multa/multa.service.ts +++ b/src/multa/multa.service.ts @@ -5,6 +5,7 @@ import { FindOptionsWhere, Like, Repository } from 'typeorm'; import { Multa } from './entity/multa.entity'; import { FullInformacionMultaView } from './entity/views/full-informacion-multa.view'; import { InformacionMultaView } from './entity/views/informacion-multa.view'; +import { Modulo } from '../modulo/entity/modulo.entity'; import { Operador } from '../operador/entity/operador.entity'; import { Prestamo } from '../prestamo/entity/prestamo.entity'; import { Usuario } from '../usuario/entity/usuario.entity'; @@ -33,6 +34,7 @@ export class MultaService { async create( operadorMulta: Operador, + modulo: Modulo, prestamo: Prestamo, descripcion: string, retraso?: number, diff --git a/src/prestamo/prestamo.service.ts b/src/prestamo/prestamo.service.ts index 2d1d935..86b27a5 100644 --- a/src/prestamo/prestamo.service.ts +++ b/src/prestamo/prestamo.service.ts @@ -755,7 +755,7 @@ export class PrestamoService { const tardanza = Math.trunc(ahora.diff(moment(prestamo.hora_fin)) / 60000); // Minutos que se tardo entre el tiempo configurable de la institución const semanasCastigo = Math.trunc( - tardanza / operadorRegreso.institucion.tiempo_entrega, + tardanza / modulo.institucion.tiempo_entrega, ); this.validacionBasicaPrestamo(prestamo); @@ -782,6 +782,7 @@ export class PrestamoService { if (id_institucion_infraccion) await this.multaService.create( operadorRegreso, + modulo, prestamo, `${mensajeTardanza} ${descripcion}`, semanasCastigo, @@ -791,6 +792,7 @@ export class PrestamoService { else await this.multaService.create( operadorRegreso, + modulo, prestamo, mensajeTardanza, semanasCastigo, @@ -800,6 +802,7 @@ export class PrestamoService { // el usuario solo solo daño el equipo await this.multaService.create( operadorRegreso, + modulo, prestamo, descripcion, null,