versión producción
This commit is contained in:
parent
0074bd1ddc
commit
d83454af1f
@ -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',
|
||||
],
|
||||
},
|
||||
})
|
||||
|
@ -157,34 +157,34 @@ export class PrestamoService {
|
||||
)
|
||||
: null;
|
||||
|
||||
// if (ahora.weekday() === 0)
|
||||
// throw new ConflictException('No hay servicio los días domingo.');
|
||||
// this.validarInstitucionUsuario(usuario.instituciones, modulo);
|
||||
// if (!institucionDia.activo)
|
||||
// throw new ConflictException(
|
||||
// 'El día de hoy no hay servicio de préstamo de equipos.',
|
||||
// );
|
||||
// if (ahora < horaMin)
|
||||
// throw new ConflictException(
|
||||
// `El servicio inicia a las ${institucionDia.hora_inicio} el día de hoy.`,
|
||||
// );
|
||||
// if (ahora >= horaExtra)
|
||||
// throw new ConflictException(
|
||||
// `El servicio terminó a las ${institucionDia.hora_extra} el día de hoy.`,
|
||||
// );
|
||||
// for (let i = 0; i < institucionDia.horasExcepcion.length; i++) {
|
||||
// const horaFin = moment(
|
||||
// `${ahoraStr} ${institucionDia.horasExcepcion[i].hora_fin}`,
|
||||
// );
|
||||
// const horaInicio = moment(
|
||||
// `${ahoraStr} ${institucionDia.horasExcepcion[i].hora_inicio}`,
|
||||
// );
|
||||
if (ahora.weekday() === 0)
|
||||
throw new ConflictException('No hay servicio los días domingo.');
|
||||
this.validarInstitucionUsuario(usuario.instituciones, modulo);
|
||||
if (!institucionDia.activo)
|
||||
throw new ConflictException(
|
||||
'El día de hoy no hay servicio de préstamo de equipos.',
|
||||
);
|
||||
if (ahora < horaMin)
|
||||
throw new ConflictException(
|
||||
`El servicio inicia a las ${institucionDia.hora_inicio} el día de hoy.`,
|
||||
);
|
||||
if (ahora >= horaExtra)
|
||||
throw new ConflictException(
|
||||
`El servicio terminó a las ${institucionDia.hora_extra} el día de hoy.`,
|
||||
);
|
||||
for (let i = 0; i < institucionDia.horasExcepcion.length; i++) {
|
||||
const horaFin = moment(
|
||||
`${ahoraStr} ${institucionDia.horasExcepcion[i].hora_fin}`,
|
||||
);
|
||||
const horaInicio = moment(
|
||||
`${ahoraStr} ${institucionDia.horasExcepcion[i].hora_inicio}`,
|
||||
);
|
||||
|
||||
// if (ahora > horaInicio && ahora < horaFin)
|
||||
// throw new ConflictException(
|
||||
// `Se suspendió temporalmente el servicio de ${institucionDia.horasExcepcion[i].hora_inicio} a ${institucionDia.horasExcepcion[i].hora_fin}.`,
|
||||
// );
|
||||
// }
|
||||
if (ahora > horaInicio && ahora < horaFin)
|
||||
throw new ConflictException(
|
||||
`Se suspendió temporalmente el servicio de ${institucionDia.horasExcepcion[i].hora_inicio} a ${institucionDia.horasExcepcion[i].hora_fin}.`,
|
||||
);
|
||||
}
|
||||
return this.informacionPrestamoView
|
||||
.findOne({ where: { activo: 1, id_usuario: usuario.id_usuario } })
|
||||
.then((existePrestamo) => {
|
||||
|
Loading…
Reference in New Issue
Block a user