actualizacion de funciones
This commit is contained in:
@@ -1,13 +1,8 @@
|
||||
const moment = require('moment');
|
||||
const {
|
||||
validarNumeroEntero,
|
||||
validarNumeroCuenta,
|
||||
} = require('../../helper/validar');
|
||||
const {
|
||||
usuarioInscrito,
|
||||
agregarRecibo,
|
||||
agregarDetalleServicio,
|
||||
} = require('../../config/mariadb.conf');
|
||||
const { usuarioInscrito } = require('../../config/mariadb.conf');
|
||||
const dbPath = '../../db/tablas';
|
||||
const Inscripcion = require(`${dbPath}/Inscripcion`);
|
||||
const gmail = require('../../helper/gmail');
|
||||
@@ -17,8 +12,6 @@ const correoInscripcion = require('../../helper/correo');
|
||||
const validarTicket = async (body) => {
|
||||
const folio = validarNumeroEntero(body.folio, 'folio', true);
|
||||
const idArea = validarNumeroEntero(body.idArea, 'IDAREA', true);
|
||||
const monto = validarNumeroEntero(body.monto, 'monto', true);
|
||||
const fechaTicket = body.fechaTicket;
|
||||
|
||||
const numeroCuenta = validarNumeroCuenta(
|
||||
body.numeroCuenta,
|
||||
@@ -59,14 +52,7 @@ const validarTicket = async (body) => {
|
||||
email = `${numeroCuenta}@pcpuma.acatlan.unam.mx`;
|
||||
if (body.validacion === 1) {
|
||||
correo = correoInscripcion();
|
||||
// usuarioInscrito(numeroCuenta, idArea);
|
||||
// agregarRecibo(
|
||||
// folio,
|
||||
// monto,
|
||||
// moment(fechaTicket).format('L'),
|
||||
// numeroCuenta
|
||||
// );
|
||||
// agregarDetalleServicio(monto, numeroCuenta);
|
||||
usuarioInscrito(numeroCuenta, idArea);
|
||||
} else {
|
||||
correo = correoDeclinar();
|
||||
return Inscripcion.update(
|
||||
|
||||
@@ -22,9 +22,6 @@ const inscripcion = async (body, file) => {
|
||||
const folio = validarNumero(body.folio, 'folio', true, 6);
|
||||
const fechaTicket = body.fechaTicket;
|
||||
|
||||
let correo = {};
|
||||
let email = '';
|
||||
|
||||
return Inscripcion.findOne({
|
||||
where: { folio, cancelacion: 0 },
|
||||
})
|
||||
@@ -60,6 +57,13 @@ const inscripcion = async (body, file) => {
|
||||
.then((res) => {
|
||||
if (file)
|
||||
fs.renameSync(file.path, file.path + '.' + file.mimetype.split('/')[1]);
|
||||
agregarRecibo(
|
||||
folio,
|
||||
monto,
|
||||
moment(fechaTicket).format('L'),
|
||||
numeroCuenta
|
||||
);
|
||||
agregarDetalleServicio(monto, numeroCuenta);
|
||||
})
|
||||
.then((res) => ({
|
||||
message: `Tu inscripción está sujeta a validación por parte de un operador de CEDETEC, en caso de no ser correcta o veraz el servicio será suspendido. Por favor ingresa a <a href="https://kalinga.acatlan.unam.mx/cedetec/" target="_blank">Kalinga</a> para confirmar tu inscripción`,
|
||||
|
||||
Reference in New Issue
Block a user