horas finales
This commit is contained in:
@@ -18,6 +18,10 @@ const entregar = async (body) => {
|
||||
true
|
||||
);
|
||||
let idEquipo;
|
||||
let update = {
|
||||
idOperadorEntrega,
|
||||
horaInicio: ahora.format(),
|
||||
};
|
||||
|
||||
return Operador.findOne({ where: { idOperador: idOperadorEntrega } })
|
||||
.then((res) => {
|
||||
@@ -44,18 +48,12 @@ const entregar = async (body) => {
|
||||
'Ya pasó el tiempo límite para recoger el equipo de cómputo.'
|
||||
);
|
||||
});
|
||||
if (ahora > moment(`${ahora.format('YYYY-MM-DD')} 17:45`))
|
||||
update.horaFin = moment(`${ahora.format('YYYY-MM-DD')} 19:45`);
|
||||
else update.horaInicio = ahora.add(2, 'h').format();
|
||||
return Equipo.update({ idStatus: 2 }, { where: { idEquipo } });
|
||||
})
|
||||
.then(() => {
|
||||
Prestamo.update(
|
||||
{
|
||||
idOperadorEntrega,
|
||||
horaInicio: ahora.format(),
|
||||
horaFin: ahora.add(2, 'h').format(),
|
||||
},
|
||||
{ where: { idPrestamo } }
|
||||
);
|
||||
})
|
||||
.then(() => Prestamo.update(update, { where: { idPrestamo } }))
|
||||
.then(() =>
|
||||
Equipo.findOne({
|
||||
where: { idEquipo },
|
||||
|
||||
@@ -13,7 +13,7 @@ const Usuario = require(`${dbPath}/Usuario`);
|
||||
|
||||
const pedir = async (body) => {
|
||||
const ahora = moment();
|
||||
const horaMax = moment(`${ahora.format('YYYY-MM-DD')} 19:00`);
|
||||
const horaMax = moment(`${ahora.format('YYYY-MM-DD')} 18:45`);
|
||||
const horaMin = moment(`${ahora.format('YYYY-MM-DD')} 09:00`);
|
||||
const idUsuario = validarNumeroEntero(body.idUsuario, 'id usuario', true);
|
||||
const idTipoCarrito = validarNumeroEntero(
|
||||
|
||||
Reference in New Issue
Block a user