This commit is contained in:
xXpuma99Xx
2022-11-06 23:02:01 -06:00
parent dddeae7783
commit fd73dfff25
2 changed files with 10 additions and 10 deletions
+4 -4
View File
@@ -10,14 +10,14 @@ import { Socket, Server } from 'socket.io';
@WebSocketGateway({
cors: {
origin: [
'http://localhost:3176',
'http://localhost:3186',
// 'http://localhost:3176',
// 'http://localhost:3186',
// 'http://132.248.80.196:3155',
// 'http://132.248.80.196:3185',
// 'https://pmodulospcpuma.unam.mx',
// 'https://pmodulospcpuma.unam.mx:3015',
// 'https://modulospcpuma.unam.mx',
// 'https://modulospcpuma.unam.mx:3015',
'https://modulospcpuma.unam.mx',
'https://modulospcpuma.unam.mx:3015',
],
},
})
+6 -6
View File
@@ -75,7 +75,7 @@ export class PrestamoService {
motivo: string,
modulo: Modulo,
) {
const ahora = moment().add(14, 'h');
const ahora = moment();
const prestamo = await this.findById(id_prestamo);
this.validacionBasicaPrestamo(prestamo);
@@ -104,7 +104,7 @@ export class PrestamoService {
}
async cancelarUsuario(usuario: Usuario) {
const ahora = moment().add(14, 'h');
const ahora = moment();
const prestamo = await this.prestamoInfoByUsuario(usuario);
this.validacionBasicaPrestamo(prestamo);
@@ -139,7 +139,7 @@ export class PrestamoService {
id_programa?: number,
id_tipo_entrada?: number,
) {
const ahora = moment().add(14, 'h');
const ahora = moment();
const ahoraStr = ahora.format('YYYY-MM-DD');
const sistema = { id_operador: 1 };
const modulo = await this.moduloService.findFullInfoById(id_modulo);
@@ -256,7 +256,7 @@ export class PrestamoService {
}
async desactivarPrestamos() {
const ahora = moment().add(14, 'h');
const ahora = moment();
// Busco todos los préstamos activos y que esten apartadoss
return this.informacionPrestamoView
@@ -294,7 +294,7 @@ export class PrestamoService {
modulo: Modulo,
id_prestamo: number,
) {
const ahora = moment().add(14, 'h');
const ahora = moment();
const ahoraStr = ahora.format('YYYY-MM-DD');
const prestamo = await this.findById(id_prestamo);
const institucionDia =
@@ -779,7 +779,7 @@ export class PrestamoService {
descripcion?: string,
id_institucion_infraccion?: number,
) {
const ahora = moment().add(14, 'h');
const ahora = moment();
// La resta ahora - hora_fin nos da la cantidad de tiempo que se paso el usuario
// en entregar el equipo a tiempo. Si es negativa es que fue antes de la hora_fin
const tardanza = Math.trunc(ahora.diff(moment(prestamo.hora_fin)) / 60000);