using cuestionario2 has atribute, create credentials for testing

This commit is contained in:
Your Name
2025-02-13 13:57:28 -05:00
parent f89b7e05db
commit 7bef28e60f
22 changed files with 251 additions and 39 deletions
+18 -2
View File
@@ -255,13 +255,29 @@ console.log("datos a registrar en la tabla cuestionarioAlumno2", { ...body, idC
let respuestasRegistradas = await CuestionarioAlumno2.create({ ...body, idCuestionario: cuestionarioRegistro.idCuestionario });
console.log('despues de registrar cuestionario', respuestasRegistradas);
console.log('cuestionario registrado', cuestionarioRegistro);
console.log('agregar el id a la tabla servicio, esta validado en el front');
let resX = await Servicio.update(
{ idCuestionarioAlumno2: respuestasRegistradas.idCuestionarioAlumno2},
{ where: { idServicio } }
)
console.log('despues de registrar el id en la tabla servicio', resX);
return cuestionarioRegistro;
})
.then((res) => validar.validarPreTermino(idServicio))
.then((res) => ({
message: `Se guardaron tus respuestas correctamente. ${res}`,
}));
@@ -155,7 +155,7 @@ const nuevo = async (body) => {
let cuestionarioRegistro = await Cuestionario.create({
idServicio,
idCuestionarioPrograma: respuestasRegistradas.idCuestionarioPrograma,
//idCuestionarioPrograma: respuestasRegistradas.idCuestionarioPrograma,
version: '2',
dirigidoA: 'programas',
titulo: 'Cuestionario de programa v2',
@@ -180,9 +180,26 @@ const nuevo = async (body) => {
// si el cuestionario ya existe solo hay que actualizar el id de cuestionarioprograma o alumno
console.log("registrar id en servicio en cuestionario 2");
let x = await Servicio.update(
{ idCuestionarioPrograma2: respuestasRegistradas.idCuestionarioPrograma2 },
{ where: { idServicio } }
)
console.log(x);
return cuestionarioRegistro;
})
.then((res) => validar.validarPreTermino(idServicio))
.then((res) => ({
message: `Se guardaron tus respuestas correctamente. ${res}`,
}));
+2
View File
@@ -56,7 +56,9 @@ const admin = async (body) => {
'vistoBuenoAcatlan',
'createdAt',
'idCuestionarioAlumno',
'idCuestionarioAlumno2',
'idCuestionarioPrograma',
'idCuestionarioPrograma2'
],
}).then((res) => {
if (!res) throw new Error('No existe este servicio social.');
+1
View File
@@ -46,6 +46,7 @@ const alumno = async (body) => {
'profesor',
'createdAt',
'idCuestionarioAlumno',
'idCuestionarioAlumno2'
],
});
})
+4 -2
View File
@@ -24,12 +24,14 @@ const cartaTermino = async (body, file) => {
switch (res.idStatus) {
case 4:
case 8:
return drive.uploadFile(
return drive.uploadFile(
path,
`Carta_Termino.pdf`,
'application/pdf',
res.carpeta
);
);
//return "carta de termino"
case 1:
case 2:
case 3:
+3 -2
View File
@@ -24,12 +24,13 @@ const informeGlobal = async (body, file) => {
switch (res.idStatus) {
case 4:
case 9:
return drive.uploadFile(
return drive.uploadFile(
path,
`Informe_Global.pdf`,
'application/pdf',
res.carpeta
);
);
// return "informe global"
case 1:
case 2:
case 3:
+2 -2
View File
@@ -79,7 +79,7 @@ const nuevo = async (body, file) => {
.then((servicio) => {
let carpeta = '';
drive
drive
.mkDir(numeroCuenta)
.then((res) => {
carpeta = res;
@@ -95,7 +95,7 @@ const nuevo = async (body, file) => {
{ carpeta, cartaAceptacion: res },
{ where: { idServicio: servicio.idServicio } }
)
);
);
return { message: `Se Pre-Registro correctamente a este alumno.` };
});
};
+4 -1
View File
@@ -12,7 +12,9 @@ const registro = async (body) => {
body.idServicio,
'id servicio'
);
const password = encriptar.generarPassword();
//const password = encriptar.generarPassword(); // esta genera la contraseña
let pass = 'qwertyui'
const password = pass //encriptar.encriptar(pass)
let correo = {};
let idUsuario;
@@ -58,6 +60,7 @@ const registro = async (body) => {
.then((res) => ({
message:
'Se cambio de estatus correctamente y se envio un correo al alumno con sus credenciales.',
pass
}));
};
@@ -78,13 +78,19 @@ const registroValidado = async (body) => {
gmail(correoResponsable.subject, emailResponsable, correoResponsable.msj)
)
.then((res) =>
Servicio.update(
{
let tempStatus = 3
if (process.env.MODE == "pruebas") tempStatus = 4
return Servicio.update(
// Producción
{ idStatus: 3, direccion, telefono, fechaNacimiento },
// { idStatus: 3, direccion, telefono, fechaNacimiento },
// Pruebas
// { idStatus: 4, direccion, telefono, fechaNacimiento },
{ idStatus: tempStatus, direccion, telefono, fechaNacimiento },
{ where: { idServicio } }
)
}
)
.then((res) => ({
message: 'Haz terminado el registro de tu Servicio Social correctamente.',
@@ -57,6 +57,7 @@ const serviciosResponsable = async (body) => {
'cartaTermino',
'createdAt',
'idCuestionarioPrograma',
'idCuestionarioPrograma2'
],
order: [['updatedAt', 'DESC']],
limit: 25,
+22 -15
View File
@@ -36,24 +36,31 @@ const escolares = async (body) => {
const numeroCuenta = validarNumeroCuenta(body.numeroCuenta);
let alumno;
/*
return axios({
method: 'post',
url: `${process.env.ESCOLARES}${numeroCuenta}`,
data: `${process.env.ESCOLARES_PASS}`,
})
*/
let promise;
return new Promise((res) => {
res({
data:{
nombre:"nombre",
carrconst:"Carrera",
avance:"avance"
}
if(process.env.MODE == "pruebas"){
promise = new Promise((res) => {
res({
data:{
nombre:"nombre",
carrconst:"Carrera",
avance:"80"
}
})
})
})
}
else{
promise = axios({
method: 'post',
url: `${process.env.ESCOLARES}${numeroCuenta}`,
data: `${process.env.ESCOLARES_PASS}`,
})
}
return promise
.then((res) => {
if (!res.data.nombre || !res.data.carrconst || !res.data.avance)