2022-02-03 23:09:40 -06:00
|
|
|
const dbPath = '../../db/tablas';
|
|
|
|
|
const Inscripcion = require(`${dbPath}/Inscripcion`);
|
|
|
|
|
|
|
|
|
|
const ticket = async (body) => {
|
|
|
|
|
return Inscripcion.findOne({
|
|
|
|
|
where: { folio: body.folio },
|
2022-03-18 01:29:10 -06:00
|
|
|
attributes: ['rutaTicket', 'extension', 'motivo'],
|
2022-03-06 18:41:23 -06:00
|
|
|
})
|
|
|
|
|
.then((res) => {
|
|
|
|
|
if (!res) throw new Error('No pudimos encontrar este ticket.');
|
2022-03-18 01:29:10 -06:00
|
|
|
return {
|
|
|
|
|
rutaTicket: res.rutaTicket,
|
|
|
|
|
extension: res.extension,
|
|
|
|
|
motivo: res.motivo,
|
|
|
|
|
};
|
2022-03-06 18:41:23 -06:00
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
throw new Error('No fue posible validar el ticket. ' + err);
|
|
|
|
|
});
|
2022-02-03 23:09:40 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
module.exports = ticket;
|