actualizacion del ticket en la db y validacion del folio
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
const moment = require('moment');
|
||||
const fs = require('fs');
|
||||
const { validarNumeroEntero, validarNumero } = require('../../helper/validar');
|
||||
const {
|
||||
validarNumeroEntero,
|
||||
validarNumero,
|
||||
validarAlfanumerico,
|
||||
} = require('../../helper/validar');
|
||||
const { eliminarArchivo } = require('../../helper/helper');
|
||||
const dbPath = '../../db/tablas';
|
||||
const Carrera = require(`${dbPath}/Carrera`);
|
||||
@@ -11,7 +15,7 @@ const inscripcion = async (body, file) => {
|
||||
const idUsuario = validarNumeroEntero(body.idUsuario, 'id Usuario', true);
|
||||
const idArea = validarNumeroEntero(body.idArea, 'id Area', true);
|
||||
const monto = validarNumero(body.monto, 'monto', true);
|
||||
const folio = body.folio;
|
||||
const folio = validarAlfanumerico(body.folio, 'folio', true);
|
||||
|
||||
return Inscripcion.findOne({
|
||||
where: { folio },
|
||||
|
||||
@@ -24,7 +24,7 @@ Inscripcion.init(
|
||||
defaultValue: false,
|
||||
},
|
||||
folio: {
|
||||
type: DataTypes.STRING(5),
|
||||
type: DataTypes.STRING(10),
|
||||
allowNull: true,
|
||||
defaultValue: null,
|
||||
unique: true,
|
||||
|
||||
Reference in New Issue
Block a user