From 7e29a5e5b45ee73f5bf5c7f2b8808ef5d26544c8 Mon Sep 17 00:00:00 2001 From: Tu Nombre Date: Fri, 7 Feb 2025 18:07:41 -0600 Subject: [PATCH] escolares --- Dockerfile | 20 + README.md | 7 +- Servicios.postman_collection.json | 502 +++++++++++++++++++++++++ escolares_internal_test.sql | 107 ++++++ server/controller/Usuario/escolares.js | 14 + server/db/data-fake.js | 78 ++-- 6 files changed, 699 insertions(+), 29 deletions(-) create mode 100644 Dockerfile create mode 100644 Servicios.postman_collection.json create mode 100644 escolares_internal_test.sql diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d94364d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +# Usa una imagen base de Node.js +FROM node:16 + +# Establece el directorio de trabajo dentro del contenedor +WORKDIR /usr/src/app + +# Copia los archivos de package.json y package-lock.json (si existe) +COPY package*.json ./ + +# Instala las dependencias +RUN npm install + +# Copia el código fuente de la aplicación +COPY . . + +# Expone el puerto que la app usará +EXPOSE 3000 + +# Comando por defecto para ejecutar la aplicación en desarrollo +CMD ["npm", "run", "dev"] diff --git a/README.md b/README.md index 5cf8637..3456870 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,12 @@ -Documentacion del sistema IRIS +# Documentacion del sistema IRIS + + + + + Tipos de usuarios diff --git a/Servicios.postman_collection.json b/Servicios.postman_collection.json new file mode 100644 index 0000000..32b67f0 --- /dev/null +++ b/Servicios.postman_collection.json @@ -0,0 +1,502 @@ +{ + "info": { + "_postman_id": "5672f077-78c4-41d4-8877-6c8ccddbf3ef", + "name": "Servicios", + "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json", + "_exporter_id": "39860549" + }, + "item": [ + { + "name": "cuestionarios", + "item": [ + { + "name": "cuestionario_alumno", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"year\":\"2024\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{api}}/cuestionario_alumno?year=2024", + "host": [ + "{{api}}" + ], + "path": [ + "cuestionario_alumno" + ], + "query": [ + { + "key": "year", + "value": "2024" + } + ] + } + }, + "response": [] + }, + { + "name": "cuestionario_alumno", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"token\":\"asdfasdf\",\n \"idServicio\":3,\n \n \"p1\": \"Dependencia de la UNAM, Asesoría académica, Oportunidad de desarrollo de tesis\",\n\n \"p12_A_1\": \"Deficiente\",\n \"p12_A_2\": \"Deficiente\",\n \"p12_A_3\": \"Deficiente\",\n \"p12_A_4\": \"Deficiente\",\n \"p12_B_1\": \"Básico\",\n \"p12_B_2\": \"Básico\",\n \"p12_B_3\": \"Básico\",\n \"p12_B_4\": \"Básico\",\n \"p12_C_1\": \"Intermedio\",\n \"p12_C_2\": \"Intermedio\",\n \"p12_C_3\": \"Intermedio\",\n \"p12_C_4\": \"Intermedio\",\n \"p10_1\": \"si\",\n \"p10_2\": \"si\",\n \"p10_3\": \"si\",\n \"p11_1\": \"Nunca\",\n \"p11_2\": \"Rara vez\",\n \"p11_3\": \"Algunas veces\",\n \"p11_4\": \"Siempre\",\n \"p17_1\": \"si\",\n \"p17_2\": \"no\",\n \"p17_3\": \"si\",\n \"p3_1\": \"si\",\n \"p3_2\": \"si\",\n \"p3_3\": \"si\",\n \"p3_4\": \"si\",\n \"p12_D_1\": \"Destacado\",\n \"p12_D_2\": \"Destacado\",\n \"p12_D_3\": \"Destacado\",\n \"p12_D_4\": \"Destacado\",\n \"p12_D_5\": \"Destacado\",\n \"p2\": \"Deficiente\",\n \"p4\": \"No\",\n \"p5\": \"respuesta5\",\n \"p6\": \"Sí\",\n \"p7\": \"Sí\",\n \"p8\": \"respuesta8\",\n \"p9\": \"Sí\",\n \"p13\": \"Responsable directo del programa\",\n \"p14\": \"Se te otorgó de acuerdo a lo establecido\",\n \"p15\": \"Sí\",\n \"p16\": \"respuesta 16\",\n \"p18\": \"respuesta18\"\n\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": "{{api}}/cuestionario_alumno" + }, + "response": [] + } + ] + }, + { + "name": "usuarios", + "item": [ + { + "name": "login", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n usuario:\"asdfasdf\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": "{{api}}/usuario/login" + }, + "response": [] + }, + { + "name": "escolares", + "request": { + "method": "GET", + "header": [], + "url": "{{api}}/usuario/escolares" + }, + "response": [] + }, + { + "name": "responsable", + "request": { + "method": "GET", + "header": [], + "url": "{{api}}/usuario/responsable" + }, + "response": [] + }, + { + "name": "responsables", + "request": { + "method": "GET", + "header": [], + "url": "{{api}}/usuario/responsables" + }, + "response": [] + }, + { + "name": "new pass alumno", + "request": { + "method": "PUT", + "header": [], + "url": "{{api}}/usuario/new_password_alumno" + }, + "response": [] + }, + { + "name": "new pass respon", + "request": { + "method": "PUT", + "header": [], + "url": "{{api}}/usuario/new_password_responsable" + }, + "response": [] + }, + { + "name": "responsable update", + "request": { + "method": "PUT", + "header": [], + "url": "{{api}}/usuario/responsable/update" + }, + "response": [] + } + ] + }, + { + "name": "status", + "item": [ + { + "name": "status", + "request": { + "method": "GET", + "header": [], + "url": "{{api}}/status" + }, + "response": [] + } + ] + }, + { + "name": "servicio", + "item": [ + { + "name": "status Copy", + "request": { + "method": "POST", + "header": [], + "url": "{{api}}/servicio/nuevo" + }, + "response": [] + }, + { + "name": "status Copy 2", + "request": { + "method": "GET", + "header": [], + "url": "{{api}}/servicio/admin" + }, + "response": [] + }, + { + "name": "status Copy 3", + "request": { + "method": "GET", + "header": [], + "url": "{{api}}/servicio/alumno" + }, + "response": [] + }, + { + "name": "status Copy 4", + "request": { + "method": "GET", + "header": [], + "url": "{{api}}/servicio/gustavo_baz_prada" + }, + "response": [] + }, + { + "name": "status Copy 5", + "request": { + "method": "GET", + "header": [], + "url": "{{api}}/servicio/reporte" + }, + "response": [] + }, + { + "name": "status Copy 6", + "request": { + "method": "GET", + "header": [], + "url": "{{api}}/servicio/servicios_admin" + }, + "response": [] + }, + { + "name": "status Copy 7", + "request": { + "method": "GET", + "header": [], + "url": "{{api}}/servicio/servicios_responsable" + }, + "response": [] + }, + { + "name": "status Copy 8", + "request": { + "method": "GET", + "header": [], + "url": "{{api}}/servicio/cancelar" + }, + "response": [] + }, + { + "name": "status Copy 9", + "request": { + "method": "GET", + "header": [], + "url": "{{api}}/servicio/carta_aceptacion" + }, + "response": [] + }, + { + "name": "status Copy 10", + "request": { + "method": "GET", + "header": [], + "url": "{{api}}/servicio/carta_termino" + }, + "response": [] + }, + { + "name": "status Copy 11", + "request": { + "method": "GET", + "header": [], + "url": "{{api}}/servicio/informe_global" + }, + "response": [] + }, + { + "name": "status Copy 12", + "request": { + "method": "GET", + "header": [], + "url": "{{api}}/servicio/liberacion" + }, + "response": [] + }, + { + "name": "status Copy 13", + "request": { + "method": "GET", + "header": [], + "url": "{{api}}/servicio/registro" + }, + "response": [] + }, + { + "name": "status Copy 14", + "request": { + "method": "GET", + "header": [], + "url": "{{api}}/servicio/registro_validado" + }, + "response": [] + }, + { + "name": "status Copy 15", + "request": { + "method": "GET", + "header": [], + "url": "{{api}}/servicio/rechazar_aceptacion" + }, + "response": [] + }, + { + "name": "status Copy 16", + "request": { + "method": "GET", + "header": [], + "url": "{{api}}/servicio/rechazar_informe" + }, + "response": [] + }, + { + "name": "status Copy 17", + "request": { + "method": "GET", + "header": [], + "url": "{{api}}/servicio/rechazar_termino" + }, + "response": [] + }, + { + "name": "status Copy 18", + "request": { + "method": "GET", + "header": [], + "url": "{{api}}/servicio/update" + }, + "response": [] + } + ] + }, + { + "name": "Programa", + "item": [ + { + "name": "status Copy 2", + "request": { + "method": "POST", + "header": [], + "url": "{{api}}/programa/carga_masiva" + }, + "response": [] + }, + { + "name": "status Copy 3", + "request": { + "method": "POST", + "header": [], + "url": "{{api}}/programa/reasignar_programas" + }, + "response": [] + }, + { + "name": "status Copy 4", + "request": { + "method": "GET", + "header": [], + "url": "{{api}}/programa/programas_admin" + }, + "response": [] + }, + { + "name": "status Copy 5", + "request": { + "method": "POST", + "header": [], + "url": "{{api}}/programa/programas_responsable" + }, + "response": [] + } + ] + }, + { + "name": "cuestionario", + "item": [ + { + "name": "cuestonario programa", + "request": { + "method": "GET", + "header": [], + "url": "{{api}}/cuestionario_programa" + }, + "response": [] + }, + { + "name": "cuestonario programa Copy", + "request": { + "method": "GET", + "header": [], + "url": "{{api}}/cuestionario_programa" + }, + "response": [] + }, + { + "name": "cuestonario alumno", + "request": { + "method": "GET", + "header": [], + "url": "{{api}}/cuestionario_alumno" + }, + "response": [] + }, + { + "name": "cuestonario alumno", + "request": { + "method": "GET", + "header": [], + "url": "{{api}}/cuestionario_alumno" + }, + "response": [] + } + ] + }, + { + "name": "caso especial", + "item": [ + { + "name": "cuestonario alumno Copy", + "request": { + "method": "GET", + "header": [], + "url": "{{api}}/caso_especial/nuevo" + }, + "response": [] + }, + { + "name": "cuestonario alumno Copy 2", + "request": { + "method": "GET", + "header": [], + "url": "{{api}}/caso_especial" + }, + "response": [] + }, + { + "name": "cuestonario alumno Copy 3", + "request": { + "method": "GET", + "header": [], + "url": "{{api}}/caso_especial/servicios_especiales" + }, + "response": [] + }, + { + "name": "cuestonario alumno Copy 4", + "request": { + "method": "GET", + "header": [], + "url": "{{api}}/caso_especial/liberacion" + }, + "response": [] + }, + { + "name": "cuestonario alumno Copy 5", + "request": { + "method": "GET", + "header": [], + "url": "{{api}}/caso_especial/update" + }, + "response": [] + } + ] + }, + { + "name": "New Request", + "request": { + "method": "GET", + "header": [], + "url": "{{api}}" + }, + "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "packages": {}, + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "packages": {}, + "exec": [ + "" + ] + } + } + ], + "variable": [ + { + "key": "api", + "value": "http://localhost:3072", + "type": "string" + }, + { + "key": "api", + "value": "https://venus.acatlan.unam.mx/ss-pruebas", + "type": "string", + "disabled": true + } + ] +} \ No newline at end of file diff --git a/escolares_internal_test.sql b/escolares_internal_test.sql new file mode 100644 index 0000000..97b82d7 --- /dev/null +++ b/escolares_internal_test.sql @@ -0,0 +1,107 @@ +CREATE DATABASE Universidad; +USE Universidad; + + +CREATE TABLE Alumnos ( cuenta INT PRIMARY KEY, nombre VARCHAR(255), carrera VARCHAR(255), creditos DECIMAL(5,2)); + +INSERT INTO Alumnos (cuenta, nombre, carrera, creditos) VALUES +(455229002, 'Sara Francisco Ortega Ramos', 'LIC. EN FILOSOFIA', 3.37), +(344254873, 'Ing. Liliana García', 'LIC. ENSEÑANZA DE ESPAÑOL(LENG. EXTRANJ)', 54.26), +(108304507, 'Modesto Samaniego', 'LIC. EN COMUNICACION', 45.52), +(103285757, 'Rosalia Gonzalo Granado', 'LIC. EN LENGUA Y LITERATURA HISPANICAS', 83.41), +(510877055, 'Guillermo Cazares Vásquez', 'LIC. EN LENGUA Y LITERATURA HISPANICAS', 84.5), +(220810204, 'Wendolin Madera', 'LIC. EN ARQUITECTURA', 64.16), +(662985844, 'César Mayorga Rico', 'LIC. EN LENGUA Y LITERATURA HISPANICAS', 49.36), +(320707048, 'Natalia Martha Patiño', 'LIC. EN ARQUITECTURA', 75.9), +(460281371, 'Micaela Araceli Amaya', 'LIC. EN SOCIOLOGIA', 82.13), +(558466371, 'Fidel Vela Valencia', 'LIC. EN DISEÑO GRAFICO', 46.29), +(730812014, 'Yeni Pedro Collado Barraza', 'LIC. EN ACTUARIA', 64.73), +(657270526, 'Miriam María Eugenia Ochoa', 'LIC. EN HISTORIA', 6.06), +(553042949, 'Patricia Cristal Feliciano', 'LIC. EN MATEMATICAS APLICADAS Y COMP.', 21.64), +(256120924, 'Olga Federico Abrego Espinoza', 'LIC. EN LENGUA Y LITERATURA HISPANICAS', 57.51), +(580095253, 'Jaqueline Candelaria', 'LIC. EN INGENIERIA CIVIL', 21.71), +(894433015, 'Agustín Galván Salgado', 'LIC. ENSEÑANZA DE ALEMÁN (LENG. EXTRANJS', 10.66), +(249880845, 'Lic. Felipe Madrigal', 'LIC. EN LENGUA Y LITERATURA HISPANICAS', 21.64), +(776013075, 'Dr. Jerónimo Arteaga', 'LIC. ENSEÑANZA DE ESPAÑOL(LENG. EXTRANJ)', 90.96), +(711114545, 'Hermelinda Rendón Esquivel', 'LIC. ENSEÑANZA DE ESPAÑOL(LENG. EXTRANJ)', 98.52), +(969046528, 'Norma Rubio', 'LIC. EN FILOSOFIA', 40.1), +(977597890, 'Perla Guzmán Mora', 'LIC. EN INGENIERIA CIVIL', 79.66), +(989320527, 'Soledad Abreu', 'LIC. EN DERECHO (SUA)', 0.46), +(557675592, 'Juan Carlos Tovar', 'LIC. EN DERECHO', 86.37), +(454578965, 'Reynaldo Elias Berríos', 'LIC. EN LENGUA Y LITERATURA HISPANICAS', 51.72), +(574884941, 'Clara Alberto Bahena', 'LIC. EN RELACIONES INTERNACIONALES (SUA)', 43.79), +(344273189, 'Noemí Abrego Beltrán', 'LIC. EN RELACIONES INTERNACIONALES (SUA)', 92.72), +(920455788, 'Ilse Mata', 'LIC. EN ACTUARIA', 85.39), +(843807025, 'Alfredo Homero Lomeli', 'LIC. EN ENSEÑANZA DE INGLES', 98.72), +(737482670, 'Sr(a). Natalia Ortega', 'LIC. EN PEDAGOGÍA', 27.62), +(947886427, 'Amalia Emiliano Sanabria González', 'LIC. EN RELACIONES INTERNACIONALES', 23.84), +(303428996, 'Camilo Fajardo Caldera', 'LIC. EN COMUNICACION', 28.69), +(504420847, 'Socorro Gonzalo Varela Escalante', 'LIC. ENSEÑANZA DE INGLÉS(LENG. EXTRANJE)', 76.77), +(916897575, 'Lic. Armando Vallejo', 'LIC. EN RELACIONES INTERNACIONALES (SUA)', 76.18), +(910548164, 'Ing. Dulce Serna', 'LIC. ENSEÑANZA DE ITALIANO(LENG. EXTRANJ', 99.85), +(287603576, 'Bernardo Juana Barrientos Anguiano', 'LIC. EN SOCIOLOGIA', 83.36), +(127855790, 'Lilia Wendolin Urbina Hernández', 'LIC. EN MATEMATICAS APLICADAS Y COMP.', 28.4), +(572039876, 'Soledad Benjamín Tello Aranda', 'LIC. EN DERECHO (SUA)', 6.27), +(177669679, 'María Luisa Rodarte Sotelo', 'LIC. ENSEÑANZA DE INGLÉS(LENG. EXTRANJE)', 17.71), +(750642431, 'Dr. Fabiola Montoya', 'LIC. ENSEÑANZA DE ALEMÁN (LENG. EXTRANJS', 87.34), +(181357215, 'Berta Bruno Cervantes', 'LIC. EN DISEÑO GRAFICO', 98.56), +(837171875, 'Sandra Miriam Arevalo', 'LIC. EN HISTORIA', 77.77), +(865516896, 'Federico Rafaél Ozuna', 'LIC. EN FILOSOFIA', 5.81), +(418259119, 'Ing. Alfredo Galván', 'LIC. ENSEÑANZA DE ITALIANO(LENG. EXTRANJ', 74.91), +(654945240, 'Alejandra Miguel Ángel Paz', 'LIC. EN DERECHO', 70.53), +(838906646, 'Juana Valentín', 'LIC. EN FILOSOFIA', 13.81), +(786618542, 'Vanesa Contreras', 'LIC. EN CIENCIAS POLITICAS Y ADMON PUB', 18.42), +(311809331, 'Cristobal Lucía Lozano Rico', 'LIC. EN MAT. APLICADAS Y COMPUTACION', 46.31), +(633338912, 'Zacarías Zúñiga Cervantes', 'LIC. ENSEÑANZA DE ALEMÁN (LENG. EXTRANJS', 16.59), +(430388364, 'Linda Gómez', 'LIC. ENSEÑANZA DE ITALIANO(LENG. EXTRANJ', 30.53), +(494179153, 'Emiliano Robledo Montes', 'LIC. EN COMUNICACION', 90.31), +(761549514, 'Julia Rosa Corrales Luevano', 'LIC. ENSEÑANZA DE ESPAÑOL(LENG. EXTRANJ)', 68.57), +(917797548, 'Elvia Camarillo', 'LIC. EN DISEÑO GRAFICO', 93.9), +(656519098, 'Asunción Valles Arguello', 'LIC. EN DERECHO (SUA)', 49.11), +(959317624, 'Abraham Merino Collado', 'LIC. EN LENGUA Y LITERATURA HISPANICAS', 74.86), +(529088942, 'Mtro. José Emilio Carrero', 'LIC. EN DERECHO', 25.26), +(410136542, 'Lic. Ivonne Crespo', 'LIC. EN CIENCIAS POLITICAS Y ADMON PUB', 41.01), +(955532842, 'Hermelinda Violeta Vela', 'LIC. ENSEÑANZA DE ITALIANO(LENG. EXTRANJ', 23.99), +(944109052, 'Leonardo Mónica Arenas Barreto', 'LIC. EN CIENCIAS POLITICAS Y ADMON PUB', 65.66), +(736137931, 'Mtro. Vanesa Santiago', 'LIC. EN MAT. APLICADAS Y COMPUTACION', 60.6), +(548504744, 'René Gutiérrez Ozuna', 'LIC. EN ECONOMIA', 51.1), +(230591766, 'Esparta Zamudio Rendón', 'LIC. ENSEÑANZA DE ESPAÑOL(LENG. EXTRANJ)', 96.7), +(365584469, 'Lic. Jacinto Baeza', 'LIC. EN ENSEÑANZA DE INGLES', 16.6), +(366378810, 'Benito Garica Gómez', 'LIC. EN DISEÑO GRAFICO', 50.21), +(130793203, 'Mercedes Dalia Melgar', 'LIC. EN DISEÑO GRAFICO', 79.79), +(118327168, 'Aurelio Juana Chávez', 'LIC. EN PEDAGOGÍA', 65.11), +(541469134, 'René Estévez Alvarez', 'LIC. EN ENSEÑANZA DE INGLES', 83.62), +(146702834, 'Verónica Hugo Montañez Montero', 'LIC. EN ACTUARIA', 82.31), +(391227832, 'Federico Escobar Gollum', 'LIC. EN MATEMATICAS APLICADAS Y COMP.', 53.46), +(620658001, 'Ing. Bernabé Flores', 'LIC. EN ENSEÑANZA DE INGLES', 77.52), +(434742427, 'Esmeralda Yeni Téllez Guerrero', 'LIC. ENSEÑANZA DE ALEMÁN (LENG. EXTRANJS', 92.49), +(789523713, 'Margarita Bahena Rodríquez', 'LIC. EN MAT. APLICADAS Y COMPUTACION', 32.86), +(388536523, 'Hilda Aparicio Ulloa', 'LIC. EN RELACIONES INTERNACIONALES (SUA)', 29.32), +(533652320, 'Lic. Luis Miguel Concepción', 'LIC. EN RELACIONES INTERNACIONALES (SUA)', 57.32), +(766082299, 'Tomás Córdova', 'LIC. ENSEÑANZA DE ALEMÁN (LENG. EXTRANJS', 73.03), +(386050318, 'Noelia Villarreal Colón', 'LIC. EN RELACIONES INTERNACIONALES (SUA)', 17.6), +(746187129, 'Sr(a). Jos Nava', 'LIC. EN ARQUITECTURA', 95.45), +(485991016, 'Lucía Aurora Casárez', 'LIC. EN ACTUARIA', 42.66), +(563067802, 'David Jorge Pizarro Camarillo', 'LIC. EN DERECHO (SUA)', 62.65), +(736767614, 'Ing. Adán Serna', 'LIC. EN HISTORIA', 88.74), +(809970519, 'Rosalia Amelia Zamora Molina', 'LIC. EN RELACIONES INTERNACIONALES', 74.47), +(895517249, 'Gloria Genaro Bustos', 'LIC. ENSEÑANZA DE INGLÉS(LENG. EXTRANJE)', 68.23), +(747147954, 'Nadia Becerra', 'LIC. EN ECONOMIA', 2.22), +(354535405, 'Roberto Zamora', 'LIC. EN COMUNICACION', 87.97), +(577656886, 'Hernán Robledo Guevara', 'LIC. ENSEÑANZA DE ESPAÑOL(LENG. EXTRANJ)', 66.64), +(187735537, 'Camila Gaytán Guerrero', 'LIC. EN DERECHO (SUA)', 6.46), +(399199599, 'José Luis Humberto Villalpando', 'LIC. EN DERECHO (SUA)', 6.83), +(143603799, 'Anabel Rodríquez', 'LIC. EN RELACIONES INTERNACIONALES', 34.91), +(966725974, 'Laura Gloria Maya', 'LIC. EN MATEMATICAS APLICADAS Y COMP.', 51.86), +(612650412, 'Elvira Villaseñor', 'LIC. EN MATEMATICAS APLICADAS Y COMP.', 51.44), +(931796380, 'Clemente Nayeli Robledo', 'LIC. EN CIENCIAS POLITICAS Y ADMON.PUBL.', 29.24), +(414281020, 'Arcelia Delgadillo', 'LIC. ENSEÑANZA DE INGLÉS(LENG. EXTRANJE)', 10.09), +(142787880, 'Inés Julio César Tijerina Roybal', 'LIC. EN ENSEÑANZA DE INGLES', 53.02), +(439856515, 'Bruno Guardado', 'LIC. EN PERIODISMO Y COMUNICACION COL.', 4.94), +(378161746, 'Lic. Porfirio García', 'LIC. EN LENGUA Y LITERATURA HISPANICAS', 50.44), +(216618195, 'Nayeli Raquel Serrato', 'LIC. ENSEÑANZA DE ITALIANO(LENG. EXTRANJ', 56.96), +(826483124, 'Dr. Gabino Carrera', 'LIC. EN SOCIOLOGIA', 74.9), +(936737436, 'Yeni Liliana Pedroza Girón', 'LIC. EN CIENCIAS POLITICAS Y ADMON.PUBL.', 48.61), +(350401488, 'Dalia Julia Trujillo', 'LIC. EN CIENCIAS POLITICAS Y ADMON PUB', 80.19), +(443993884, 'Abigail Caridad Cervántez Rojas', 'LIC. EN DISEÑO GRAFICO', 86.89), +(920680444, 'Barbara David Montoya', 'LIC. EN PERIODISMO Y COMUNICACION COL.', 81.56); \ No newline at end of file diff --git a/server/controller/Usuario/escolares.js b/server/controller/Usuario/escolares.js index 1326a47..5765aa9 100644 --- a/server/controller/Usuario/escolares.js +++ b/server/controller/Usuario/escolares.js @@ -36,11 +36,25 @@ 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}`, }) + + */ + + return new Promise((res) => { + res({ + data:{ + nombre:"nombre", + carrconst:"Carrera", + avance:"avance" + } + }) + }) + .then((res) => { if (!res.data.nombre || !res.data.carrconst || !res.data.avance) throw new Error( diff --git a/server/db/data-fake.js b/server/db/data-fake.js index 7ea1fd6..9e70a58 100644 --- a/server/db/data-fake.js +++ b/server/db/data-fake.js @@ -5,8 +5,21 @@ const Programa = require('./tablas/Programa'); const correosExt = ['eithan.castillo@acatlan.unam.mx']; const correosInt = ['316092940@pcpuma.acatlan.unam.mx']; -const nombresExt = ['Lemuel Rosas']; -const nombresInt = ['Lemuel Márquez']; +const nombresExt = ['responsable exterior']; +const nombresInt = ['responsable interno']; + +const correosAdmin = ['unam.alternativo@gmail.com'] +const nombresAdmin = ['admin1'] + + +const correosEspecial = ['eithan.dev@gmail.com'] +const nombresEspecial = ['Especial1'] + + + + + + @@ -14,28 +27,32 @@ const nombresInt = ['Lemuel Márquez']; // create los admin son los encargados de cada programa const createAdmin = async () => { console.log('\nPaso 1) Instalando Responsables Externos falsos.'.bold.blue); - for (let i = 0; i < correosExt.length; i++) { + for (let i = 0; i < correosAdmin.length; i++) { await Usuario.create({ - usuario: correosExt[i], - idTipoUsuario: 2, - nombre: nombresExt[i], + usuario: correosAdmin[i], + idTipoUsuario: 1, + nombre: nombresAdmin[i], password: encriptar.encriptar('qwertyui'), activo: true, - }).then(async (res) => { - console.log(`Se inserto al responsable ${nombresExt[i]}`.magenta); - for (let j = 1; j <= 5; j++) { - await Programa.create({ - institucion: `Institucion Falsa ${i + 1}`, - dependencia: `Dependencia Falsa ${j - i + 1}`, - programa: `Programa Falso ${j}`, - clavePrograma: `2020-${j}/${i + j + 1}-${i + j + 1}`, - idUsuario: res.dataValues.idUsuario, - }); - console.log( - `Se inserto el programa ${j} del responsable ${i + 1}`.magenta - ); - } - }); + }) + + + } +}; + + + + +const createEspecial = async () => { + console.log('\nPaso 1) Instalando Responsables Externos falsos.'.bold.blue); + for (let i = 0; i < correosEspecial.length; i++) { + await Usuario.create({ + usuario: correosEspecial[i], + idTipoUsuario: 4, + nombre: nombresEspecial[i], + password: encriptar.encriptar('qwertyui'), + activo: true, + }) } }; @@ -43,12 +60,7 @@ const createAdmin = async () => { - - - - - - + const dataResponsableExt = async () => { console.log('\nPaso 1) Instalando Responsables Externos falsos.'.bold.blue); for (let i = 0; i < correosExt.length; i++) { @@ -74,7 +86,9 @@ const dataResponsableExt = async () => { } }); } -}; +}; + + const dataResponsableInt = async () => { console.log('\nPaso 1) Instalando Responsables Internos falsos.'.bold.blue); @@ -103,9 +117,17 @@ const dataResponsableInt = async () => { } }; + + + + + const exec = async () => { await dataResponsableExt(); await dataResponsableInt(); + await createAdmin(); + await createEspecial(); + console.log( '\nSe ha instalado exitosamente la informacion falsa.\n'.underline.bold .green