From 8834d654d3d31ba0089ec8d6f9051f50bde057ee Mon Sep 17 00:00:00 2001 From: SinR0str0 Date: Sun, 9 Aug 2026 21:28:42 -0600 Subject: [PATCH 1/4] Migrando xlsx a exceljs --- package-lock.json | 142 +--------------------------------- package.json | 3 +- src/email/email.controller.ts | 1 - src/email/email.service.ts | 23 +++++- 4 files changed, 21 insertions(+), 148 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0052dbc..5d5ecd2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,8 +39,7 @@ "swagger-ui-express": "^4.6.1", "sybase": "^1.2.3", "typeorm": "^0.3.12", - "uuid": "^9.0.1", - "xlsx": "^0.18.5" + "uuid": "^9.0.1" }, "devDependencies": { "@jridgewell/sourcemap-codec": "^1.4.14", @@ -2878,14 +2877,6 @@ "node": ">=0.4.0" } }, - "node_modules/adler-32": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/adler-32/-/adler-32-1.3.1.tgz", - "integrity": "sha512-ynZ4w/nUUv5rrsR8UUGoe1VC9hZj6V5hU9Qw1HlMDJGEJw5S7TfTErWTjMys6M7vr0YWcPqs3qAr4ss0nDfP+A==", - "engines": { - "node": ">=0.8" - } - }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -3849,18 +3840,6 @@ ], "license": "CC-BY-4.0" }, - "node_modules/cfb": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/cfb/-/cfb-1.2.2.tgz", - "integrity": "sha512-KfdUZsSOw19/ObEWasvBP/Ac4reZvAGauZhs6S/gqNhXhI7cKwvlH7ulj+dOEYnca4bm4SGo8C1bTAQvnTjgQA==", - "dependencies": { - "adler-32": "~1.3.0", - "crc-32": "~1.2.0" - }, - "engines": { - "node": ">=0.8" - } - }, "node_modules/chainsaw": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/chainsaw/-/chainsaw-0.1.0.tgz", @@ -4068,14 +4047,6 @@ "node": ">= 0.12.0" } }, - "node_modules/codepage": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/codepage/-/codepage-1.15.0.tgz", - "integrity": "sha512-3g6NUTPd/YtuuGrhMnOMRjFc+LJw/bnMp3+0r/Wcz3IXUuCosKRJvMphm5+Q+bvTVGcJJuRvVLuYba+WojaFaA==", - "engines": { - "node": ">=0.8" - } - }, "node_modules/collect-v8-coverage": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.3.tgz", @@ -5966,14 +5937,6 @@ "node": ">= 0.6" } }, - "node_modules/frac": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/frac/-/frac-1.1.2.tgz", - "integrity": "sha512-w/XBfkibaTl3YDqASwfDUqkna4Z2p9cFSr1aHDt0WoMTECnRfBOv2WArlZILlqgWlmdIlALXGpM2AOhEk5W3IA==", - "engines": { - "node": ">=0.8" - } - }, "node_modules/fresh": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", @@ -10284,17 +10247,6 @@ "node": ">=14" } }, - "node_modules/ssf": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/ssf/-/ssf-0.11.2.tgz", - "integrity": "sha512-+idbmIXoYET47hH+d7dfm2epdOMUDjqcB4648sTZ+t2JwoyBFL/insLfB/racrDmsKB3diwsDA696pZMieAC5g==", - "dependencies": { - "frac": "~1.1.2" - }, - "engines": { - "node": ">=0.8" - } - }, "node_modules/stack-utils": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", @@ -12092,22 +12044,6 @@ "node": ">=8.12.0" } }, - "node_modules/wmf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wmf/-/wmf-1.0.2.tgz", - "integrity": "sha512-/p9K7bEh0Dj6WbXg4JG0xvLQmIadrner1bi45VMJTfnbVHsc7yIajZyoSoK60/dtVBs12Fm6WkUI5/3WAVsNMw==", - "engines": { - "node": ">=0.8" - } - }, - "node_modules/word": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/word/-/word-0.3.0.tgz", - "integrity": "sha512-OELeY0Q61OXpdUfTp+oweA/vtLVg5VDOXh+3he3PNzLGG/y0oylSOC1xRVj0+l4vQ3tj/bB1HVHv1ocXkQceFA==", - "engines": { - "node": ">=0.8" - } - }, "node_modules/word-wrap": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", @@ -12176,26 +12112,6 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/xlsx": { - "version": "0.18.5", - "resolved": "https://registry.npmjs.org/xlsx/-/xlsx-0.18.5.tgz", - "integrity": "sha512-dmg3LCjBPHZnQp5/F/+nnTa+miPJxUXB6vtk42YjBBKayDNagxGEeIdWApkYPOf3Z3pm3k62Knjzp7lMeTEtFQ==", - "dependencies": { - "adler-32": "~1.3.0", - "cfb": "~1.2.1", - "codepage": "~1.15.0", - "crc-32": "~1.2.1", - "ssf": "~0.11.2", - "wmf": "~1.0.1", - "word": "~0.3.0" - }, - "bin": { - "xlsx": "bin/xlsx.njs" - }, - "engines": { - "node": ">=0.8" - } - }, "node_modules/xmlchars": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", @@ -14403,11 +14319,6 @@ "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", "devOptional": true }, - "adler-32": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/adler-32/-/adler-32-1.3.1.tgz", - "integrity": "sha512-ynZ4w/nUUv5rrsR8UUGoe1VC9hZj6V5hU9Qw1HlMDJGEJw5S7TfTErWTjMys6M7vr0YWcPqs3qAr4ss0nDfP+A==" - }, "agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -15072,15 +14983,6 @@ "integrity": "sha512-72Cuvd95zbSYPKq6Fhg8eDJRlzgWDf7/mtoZv6Qe/DYNCEBdNxoA3+rZAU2ZhGCpZlns3EssFavaZomckT5Uuw==", "dev": true }, - "cfb": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/cfb/-/cfb-1.2.2.tgz", - "integrity": "sha512-KfdUZsSOw19/ObEWasvBP/Ac4reZvAGauZhs6S/gqNhXhI7cKwvlH7ulj+dOEYnca4bm4SGo8C1bTAQvnTjgQA==", - "requires": { - "adler-32": "~1.3.0", - "crc-32": "~1.2.0" - } - }, "chainsaw": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/chainsaw/-/chainsaw-0.1.0.tgz", @@ -15218,11 +15120,6 @@ "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", "dev": true }, - "codepage": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/codepage/-/codepage-1.15.0.tgz", - "integrity": "sha512-3g6NUTPd/YtuuGrhMnOMRjFc+LJw/bnMp3+0r/Wcz3IXUuCosKRJvMphm5+Q+bvTVGcJJuRvVLuYba+WojaFaA==" - }, "collect-v8-coverage": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.3.tgz", @@ -16616,11 +16513,6 @@ "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==" }, - "frac": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/frac/-/frac-1.1.2.tgz", - "integrity": "sha512-w/XBfkibaTl3YDqASwfDUqkna4Z2p9cFSr1aHDt0WoMTECnRfBOv2WArlZILlqgWlmdIlALXGpM2AOhEk5W3IA==" - }, "fresh": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", @@ -19677,14 +19569,6 @@ "resolved": "https://registry.npmjs.org/sql-highlight/-/sql-highlight-6.1.0.tgz", "integrity": "sha512-ed7OK4e9ywpE7pgRMkMQmZDPKSVdm0oX5IEtZiKnFucSF0zu6c80GZBe38UqHuVhTWJ9xsKgSMjCG2bml86KvA==" }, - "ssf": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/ssf/-/ssf-0.11.2.tgz", - "integrity": "sha512-+idbmIXoYET47hH+d7dfm2epdOMUDjqcB4648sTZ+t2JwoyBFL/insLfB/racrDmsKB3diwsDA696pZMieAC5g==", - "requires": { - "frac": "~1.1.2" - } - }, "stack-utils": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", @@ -20864,16 +20748,6 @@ } } }, - "wmf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wmf/-/wmf-1.0.2.tgz", - "integrity": "sha512-/p9K7bEh0Dj6WbXg4JG0xvLQmIadrner1bi45VMJTfnbVHsc7yIajZyoSoK60/dtVBs12Fm6WkUI5/3WAVsNMw==" - }, - "word": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/word/-/word-0.3.0.tgz", - "integrity": "sha512-OELeY0Q61OXpdUfTp+oweA/vtLVg5VDOXh+3he3PNzLGG/y0oylSOC1xRVj0+l4vQ3tj/bB1HVHv1ocXkQceFA==" - }, "word-wrap": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", @@ -20921,20 +20795,6 @@ "signal-exit": "^3.0.7" } }, - "xlsx": { - "version": "0.18.5", - "resolved": "https://registry.npmjs.org/xlsx/-/xlsx-0.18.5.tgz", - "integrity": "sha512-dmg3LCjBPHZnQp5/F/+nnTa+miPJxUXB6vtk42YjBBKayDNagxGEeIdWApkYPOf3Z3pm3k62Knjzp7lMeTEtFQ==", - "requires": { - "adler-32": "~1.3.0", - "cfb": "~1.2.1", - "codepage": "~1.15.0", - "crc-32": "~1.2.1", - "ssf": "~0.11.2", - "wmf": "~1.0.1", - "word": "~0.3.0" - } - }, "xmlchars": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", diff --git a/package.json b/package.json index 40d3684..b3b0ba8 100644 --- a/package.json +++ b/package.json @@ -50,8 +50,7 @@ "swagger-ui-express": "^4.6.1", "sybase": "^1.2.3", "typeorm": "^0.3.12", - "uuid": "^9.0.1", - "xlsx": "^0.18.5" + "uuid": "^9.0.1" }, "devDependencies": { "@jridgewell/sourcemap-codec": "^1.4.14", diff --git a/src/email/email.controller.ts b/src/email/email.controller.ts index 50fb946..5e80b97 100644 --- a/src/email/email.controller.ts +++ b/src/email/email.controller.ts @@ -16,7 +16,6 @@ import { FileInterceptor } from '@nestjs/platform-express'; import { EmailDto } from './dto/emailDto.dto'; import { EmailService } from './email.service'; import { Response } from 'express'; -import * as xlsx from 'xlsx'; import { AuthGuard } from '@nestjs/passport'; @Controller('email') diff --git a/src/email/email.service.ts b/src/email/email.service.ts index ab65008..ecb236e 100644 --- a/src/email/email.service.ts +++ b/src/email/email.service.ts @@ -13,7 +13,6 @@ import { EventosService } from 'src/eventos/eventos.service'; import { Participante } from 'src/participante/participante.entity'; import { Repository } from 'typeorm'; import { EmailDto } from './dto/emailDto.dto'; -import * as xlsx from 'xlsx'; import * as pdfMake from 'pdfmake/build/pdfmake'; import * as pdfFonts from 'pdfmake/build/vfs_fonts'; /* import * as PDFDocument from 'pdfkit'; */ @@ -127,9 +126,25 @@ export class EmailService { //traemos la info del evento const evento = await this.eventoService.getEventosPorId(id_evento); - const workbook = xlsx.read(file.buffer); - const worksheet = workbook.Sheets[workbook.SheetNames[0]]; - const data = xlsx.utils.sheet_to_json(worksheet); + const workbook = new ExcelJS.Workbook(); + await workbook.xlsx.load(file.buffer); + const worksheet = workbook.worksheets[0]; + + const data: any[] = []; + let headers: string[] = []; + worksheet.eachRow((row, rowNumber) => { + const rowData: any = {}; + row.eachCell({ includeEmpty: true }, (cell, colNumber) => { + if (rowNumber === 1) { + headers[colNumber] = String(cell.value).trim(); + } else { + rowData[headers[colNumber]] = cell.value; + } + }); + if (rowNumber > 1) { + data.push(rowData); + } + }); // Carga el PDF pre-diseñado const existingPdfBytes = fs.readFileSync('src/email/DisenoConstancia.pdf'); From 0cb847d057440739d42d3d27016345b83d2d853e Mon Sep 17 00:00:00 2001 From: SinR0str0 Date: Sun, 9 Aug 2026 21:35:44 -0600 Subject: [PATCH 2/4] Usando estilos lint --- src/email/email.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/email/email.service.ts b/src/email/email.service.ts index ecb236e..44e5e2d 100644 --- a/src/email/email.service.ts +++ b/src/email/email.service.ts @@ -131,7 +131,7 @@ export class EmailService { const worksheet = workbook.worksheets[0]; const data: any[] = []; - let headers: string[] = []; + const headers: string[] = []; worksheet.eachRow((row, rowNumber) => { const rowData: any = {}; row.eachCell({ includeEmpty: true }, (cell, colNumber) => { From ff234843317e02df12e41aa534273807c89738c4 Mon Sep 17 00:00:00 2001 From: SinR0str0 Date: Sun, 9 Aug 2026 21:50:53 -0600 Subject: [PATCH 3/4] Reparando referencias absolutas --- src/auth/auth.module.ts | 6 +++--- src/auth/auth.service.ts | 2 +- src/carrusel/carrusel.module.ts | 2 +- src/carrusel/carrusel.service.ts | 2 +- src/catalogos/area.entity.ts | 2 +- src/catalogos/carrera.entity.ts | 2 +- src/catalogos/tipo-miembro.entity.ts | 2 +- src/contacto/entity/contacto.entity.ts | 2 +- src/email/email.module.ts | 10 +++++----- src/email/email.service.ts | 6 +++--- src/equipo-evento/entity/equipo_evento.entity.ts | 4 ++-- src/equipo-miembro/entity/equipo_miembro.entity.ts | 4 ++-- src/equipo/entity/equipo.entity.ts | 4 ++-- .../evento-participante.module.ts | 2 +- .../evento-participante.service.ts | 4 ++-- .../evento-participante/eventoParticipante.entity.ts | 2 +- src/eventos/evento.entity.ts | 4 ++-- src/eventos/eventos.controller.ts | 2 +- src/eventos/eventos.service.ts | 4 ++-- .../entity/inscripcion_area.entity.ts | 4 ++-- src/inscripcion-dsc/entity/inscripcion_dsc.entity.ts | 8 ++++---- .../entity/inscripcion_status.entity.ts | 2 +- .../entity/inscripcion_usuario.entity.ts | 4 ++-- .../entity/miembro_contacto.entity.ts | 4 ++-- .../entity/miembro_proyecto.entity.ts | 4 ++-- src/miembro/entity/miembro.entity.ts | 12 ++++++------ src/participante/participante.entity.ts | 2 +- src/periodo/entity/periodo.entity.ts | 2 +- src/proyecto/entity/proyecto.entity.ts | 2 +- 29 files changed, 55 insertions(+), 55 deletions(-) diff --git a/src/auth/auth.module.ts b/src/auth/auth.module.ts index 28f3f79..0266ec9 100644 --- a/src/auth/auth.module.ts +++ b/src/auth/auth.module.ts @@ -6,9 +6,9 @@ import { AuthController } from './auth.controller'; import { TypeOrmModule } from '@nestjs/typeorm'; import { JwtModule } from '@nestjs/jwt'; import { jwtConstants } from './jwt.constants'; -import { MiembroModule } from 'src/miembro/miembro.module'; -import { MiembroService } from 'src/miembro/miembro.service'; -import { Miembro } from 'src/miembro/entity/miembro.entity'; +import { MiembroModule } from '../miembro/miembro.module'; +import { MiembroService } from '../miembro/miembro.service'; +import { Miembro } from '../miembro/entity/miembro.entity'; @Module({ imports: [ diff --git a/src/auth/auth.service.ts b/src/auth/auth.service.ts index 5b2b25a..e674c76 100644 --- a/src/auth/auth.service.ts +++ b/src/auth/auth.service.ts @@ -7,7 +7,7 @@ import { Repository } from 'typeorm'; import { compare } from 'bcrypt'; import { jwtConstants } from './jwt.constants'; import { LoginMiembroDto } from './dto/loginMiembro.dto'; -import { Miembro } from 'src/miembro/entity/miembro.entity'; +import { Miembro } from '../miembro/entity/miembro.entity'; import { RegistrarMiembroDto } from './dto/registrarMiembro.dto'; @Injectable() diff --git a/src/carrusel/carrusel.module.ts b/src/carrusel/carrusel.module.ts index 5dac5b8..12f3975 100644 --- a/src/carrusel/carrusel.module.ts +++ b/src/carrusel/carrusel.module.ts @@ -2,7 +2,7 @@ import { Module } from '@nestjs/common'; import { CarruselController } from './carrusel.controller'; import { CarruselService } from './carrusel.service'; import { TypeOrmModule } from '@nestjs/typeorm'; -import { Carrusel } from 'src/carrusel/entity/carrusel.entity'; +import { Carrusel } from '../carrusel/entity/carrusel.entity'; @Module({ imports: [TypeOrmModule.forFeature([Carrusel])], diff --git a/src/carrusel/carrusel.service.ts b/src/carrusel/carrusel.service.ts index 2afab88..831e185 100644 --- a/src/carrusel/carrusel.service.ts +++ b/src/carrusel/carrusel.service.ts @@ -4,7 +4,7 @@ import { InternalServerErrorException, } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; -import { Carrusel } from 'src/carrusel/entity/carrusel.entity'; +import { Carrusel } from '../carrusel/entity/carrusel.entity'; import { Repository } from 'typeorm'; import { carruselDto } from './dto/carruselDto.dto'; import * as fs from 'fs'; diff --git a/src/catalogos/area.entity.ts b/src/catalogos/area.entity.ts index 5284a28..c22ec6a 100644 --- a/src/catalogos/area.entity.ts +++ b/src/catalogos/area.entity.ts @@ -1,4 +1,4 @@ -import { InscripcionArea } from 'src/inscripcion-area/entity/inscripcion_area.entity'; +import { InscripcionArea } from '../inscripcion-area/entity/inscripcion_area.entity'; import { Column, Entity, diff --git a/src/catalogos/carrera.entity.ts b/src/catalogos/carrera.entity.ts index a93a041..ab9030c 100644 --- a/src/catalogos/carrera.entity.ts +++ b/src/catalogos/carrera.entity.ts @@ -1,4 +1,4 @@ -import { Miembro } from 'src/miembro/entity/miembro.entity'; +import { Miembro } from '../miembro/entity/miembro.entity'; import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm'; @Entity() diff --git a/src/catalogos/tipo-miembro.entity.ts b/src/catalogos/tipo-miembro.entity.ts index 6bce0e6..b489f55 100644 --- a/src/catalogos/tipo-miembro.entity.ts +++ b/src/catalogos/tipo-miembro.entity.ts @@ -1,4 +1,4 @@ -import { Miembro } from 'src/miembro/entity/miembro.entity'; +import { Miembro } from '../miembro/entity/miembro.entity'; import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm'; @Entity() diff --git a/src/contacto/entity/contacto.entity.ts b/src/contacto/entity/contacto.entity.ts index 1013e24..86136dd 100644 --- a/src/contacto/entity/contacto.entity.ts +++ b/src/contacto/entity/contacto.entity.ts @@ -1,4 +1,4 @@ -import { MiembroContacto } from 'src/miembro-contacto/entity/miembro_contacto.entity'; +import { MiembroContacto } from '../../miembro-contacto/entity/miembro_contacto.entity'; import { Column, Entity, diff --git a/src/email/email.module.ts b/src/email/email.module.ts index 6968ffc..f69f5d2 100644 --- a/src/email/email.module.ts +++ b/src/email/email.module.ts @@ -1,12 +1,12 @@ import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; -import { EventosModule } from 'src/eventos/eventos.module'; -import { Participante } from 'src/participante/participante.entity'; +import { EventosModule } from '../eventos/eventos.module'; +import { Participante } from '../participante/participante.entity'; import { EmailController } from './email.controller'; import { EmailService } from './email.service'; -import { EventosService } from 'src/eventos/eventos.service'; -import { EventoParticipante } from 'src/evento-participante/evento-participante/eventoParticipante.entity'; -import { Evento } from 'src/eventos/evento.entity'; +import { EventosService } from '../eventos/eventos.service'; +import { EventoParticipante } from '../evento-participante/evento-participante/eventoParticipante.entity'; +import { Evento } from '../eventos/evento.entity'; @Module({ imports: [ diff --git a/src/email/email.service.ts b/src/email/email.service.ts index 44e5e2d..39c9071 100644 --- a/src/email/email.service.ts +++ b/src/email/email.service.ts @@ -9,8 +9,8 @@ import { import { ConfigService } from '@nestjs/config'; import { InjectRepository } from '@nestjs/typeorm'; import * as nodemailer from 'nodemailer'; -import { EventosService } from 'src/eventos/eventos.service'; -import { Participante } from 'src/participante/participante.entity'; +import { EventosService } from '../eventos/eventos.service'; +import { Participante } from '../participante/participante.entity'; import { Repository } from 'typeorm'; import { EmailDto } from './dto/emailDto.dto'; import * as pdfMake from 'pdfmake/build/pdfmake'; @@ -147,7 +147,7 @@ export class EmailService { }); // Carga el PDF pre-diseñado - const existingPdfBytes = fs.readFileSync('src/email/DisenoConstancia.pdf'); + const existingPdfBytes = fs.readFileSync('../email/DisenoConstancia.pdf'); for (let i = 0; i < data.length; i++) { const row = data[i] as Row; diff --git a/src/equipo-evento/entity/equipo_evento.entity.ts b/src/equipo-evento/entity/equipo_evento.entity.ts index 488d0dc..eaa1b60 100644 --- a/src/equipo-evento/entity/equipo_evento.entity.ts +++ b/src/equipo-evento/entity/equipo_evento.entity.ts @@ -1,5 +1,5 @@ -import { Equipo } from 'src/equipo/entity/equipo.entity'; -import { Evento } from 'src/eventos/evento.entity'; +import { Equipo } from '../../equipo/entity/equipo.entity'; +import { Evento } from '../../eventos/evento.entity'; import { Column, Entity, diff --git a/src/equipo-miembro/entity/equipo_miembro.entity.ts b/src/equipo-miembro/entity/equipo_miembro.entity.ts index 256c882..c9943e1 100644 --- a/src/equipo-miembro/entity/equipo_miembro.entity.ts +++ b/src/equipo-miembro/entity/equipo_miembro.entity.ts @@ -1,5 +1,5 @@ -import { Equipo } from 'src/equipo/entity/equipo.entity'; -import { Miembro } from 'src/miembro/entity/miembro.entity'; +import { Equipo } from '../../equipo/entity/equipo.entity'; +import { Miembro } from '../../miembro/entity/miembro.entity'; import { Column, Entity, diff --git a/src/equipo/entity/equipo.entity.ts b/src/equipo/entity/equipo.entity.ts index a418c28..8620e21 100644 --- a/src/equipo/entity/equipo.entity.ts +++ b/src/equipo/entity/equipo.entity.ts @@ -1,5 +1,5 @@ -import { EquipoEvento } from 'src/equipo-evento/entity/equipo_evento.entity'; -import { EquipoMiembro } from 'src/equipo-miembro/entity/equipo_miembro.entity'; +import { EquipoEvento } from '../../equipo-evento/entity/equipo_evento.entity'; +import { EquipoMiembro } from '../../equipo-miembro/entity/equipo_miembro.entity'; import { Column, Entity, diff --git a/src/evento-participante/evento-participante/evento-participante.module.ts b/src/evento-participante/evento-participante/evento-participante.module.ts index 7366682..04ad3ff 100644 --- a/src/evento-participante/evento-participante/evento-participante.module.ts +++ b/src/evento-participante/evento-participante/evento-participante.module.ts @@ -1,6 +1,6 @@ import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; -import { Participante } from 'src/participante/participante.entity'; +import { Participante } from '../../participante/participante.entity'; import { EventoParticipanteController } from './evento-participante.controller'; import { EventoParticipanteService } from './evento-participante.service'; import { EventoParticipante } from './eventoParticipante.entity'; diff --git a/src/evento-participante/evento-participante/evento-participante.service.ts b/src/evento-participante/evento-participante/evento-participante.service.ts index 138a98f..b81cac5 100644 --- a/src/evento-participante/evento-participante/evento-participante.service.ts +++ b/src/evento-participante/evento-participante/evento-participante.service.ts @@ -4,9 +4,9 @@ import { Repository } from 'typeorm'; import { RegistrarParticipanteDto } from './dto/registrarParticipanteDto.dto'; -import { Evento } from 'src/eventos/evento.entity'; +import { Evento } from '../../eventos/evento.entity'; import { EventoParticipante } from './eventoParticipante.entity'; -import { Participante } from 'src/participante/participante.entity'; +import { Participante } from '../../participante/participante.entity'; import { info } from 'console'; import { registrarEnEvento } from './dto/registrarEnEvento.dto'; diff --git a/src/evento-participante/evento-participante/eventoParticipante.entity.ts b/src/evento-participante/evento-participante/eventoParticipante.entity.ts index 62cc054..3afb5c4 100644 --- a/src/evento-participante/evento-participante/eventoParticipante.entity.ts +++ b/src/evento-participante/evento-participante/eventoParticipante.entity.ts @@ -1,4 +1,4 @@ -import { Evento } from 'src/eventos/evento.entity'; +import { Evento } from '../../eventos/evento.entity'; import { Column, Entity, diff --git a/src/eventos/evento.entity.ts b/src/eventos/evento.entity.ts index 4c162d5..37b250c 100644 --- a/src/eventos/evento.entity.ts +++ b/src/eventos/evento.entity.ts @@ -1,5 +1,5 @@ -import { EquipoEvento } from 'src/equipo-evento/entity/equipo_evento.entity'; -import { EventoParticipante } from 'src/evento-participante/evento-participante/eventoParticipante.entity'; +import { EquipoEvento } from '../equipo-evento/entity/equipo_evento.entity'; +import { EventoParticipante } from '../evento-participante/evento-participante/eventoParticipante.entity'; import { Column, Entity, diff --git a/src/eventos/eventos.controller.ts b/src/eventos/eventos.controller.ts index 2b7c884..5b8afde 100644 --- a/src/eventos/eventos.controller.ts +++ b/src/eventos/eventos.controller.ts @@ -12,7 +12,7 @@ import { } from '@nestjs/common'; import { Response } from 'express'; import { InjectRepository } from '@nestjs/typeorm'; -import { EventoParticipante } from 'src/evento-participante/evento-participante/eventoParticipante.entity'; +import { EventoParticipante } from '../evento-participante/evento-participante/eventoParticipante.entity'; import { Repository } from 'typeorm'; import { actualizarEventoDto } from './dto/actualizarEvento.dto'; import { crearEventoDto } from './dto/crearEvento.dto'; diff --git a/src/eventos/eventos.service.ts b/src/eventos/eventos.service.ts index 362e62e..ac643ae 100644 --- a/src/eventos/eventos.service.ts +++ b/src/eventos/eventos.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; -import { EventoParticipante } from 'src/evento-participante/evento-participante/eventoParticipante.entity'; -import { Participante } from 'src/participante/participante.entity'; +import { EventoParticipante } from '../evento-participante/evento-participante/eventoParticipante.entity'; +import { Participante } from '../participante/participante.entity'; import { Between, MoreThanOrEqual, Repository } from 'typeorm'; import { actualizarEventoDto } from './dto/actualizarEvento.dto'; import { crearEventoDto } from './dto/crearEvento.dto'; diff --git a/src/inscripcion-area/entity/inscripcion_area.entity.ts b/src/inscripcion-area/entity/inscripcion_area.entity.ts index 21e7d4b..ee7045d 100644 --- a/src/inscripcion-area/entity/inscripcion_area.entity.ts +++ b/src/inscripcion-area/entity/inscripcion_area.entity.ts @@ -1,5 +1,5 @@ -import { Area } from 'src/catalogos/area.entity'; -import { InscripcionDSC } from 'src/inscripcion-dsc/entity/inscripcion_dsc.entity'; +import { Area } from '../../catalogos/area.entity'; +import { InscripcionDSC } from '../../inscripcion-dsc/entity/inscripcion_dsc.entity'; import { Column, Entity, diff --git a/src/inscripcion-dsc/entity/inscripcion_dsc.entity.ts b/src/inscripcion-dsc/entity/inscripcion_dsc.entity.ts index 393063d..1c998df 100644 --- a/src/inscripcion-dsc/entity/inscripcion_dsc.entity.ts +++ b/src/inscripcion-dsc/entity/inscripcion_dsc.entity.ts @@ -1,7 +1,7 @@ -import { InscripcionArea } from 'src/inscripcion-area/entity/inscripcion_area.entity'; -import { InscripcionStatus } from 'src/inscripcion-status/entity/inscripcion_status.entity'; -import { InscripcionUsuario } from 'src/inscripcion-usuario/entity/inscripcion_usuario.entity'; -import { Periodo } from 'src/periodo/entity/periodo.entity'; +import { InscripcionArea } from '../../inscripcion-area/entity/inscripcion_area.entity'; +import { InscripcionStatus } from '../../inscripcion-status/entity/inscripcion_status.entity'; +import { InscripcionUsuario } from '../../inscripcion-usuario/entity/inscripcion_usuario.entity'; +import { Periodo } from '../../periodo/entity/periodo.entity'; import { Column, Entity, diff --git a/src/inscripcion-status/entity/inscripcion_status.entity.ts b/src/inscripcion-status/entity/inscripcion_status.entity.ts index 5dff9cf..33dbb93 100644 --- a/src/inscripcion-status/entity/inscripcion_status.entity.ts +++ b/src/inscripcion-status/entity/inscripcion_status.entity.ts @@ -1,4 +1,4 @@ -import { InscripcionDSC } from 'src/inscripcion-dsc/entity/inscripcion_dsc.entity'; +import { InscripcionDSC } from '../../inscripcion-dsc/entity/inscripcion_dsc.entity'; import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm'; @Entity() diff --git a/src/inscripcion-usuario/entity/inscripcion_usuario.entity.ts b/src/inscripcion-usuario/entity/inscripcion_usuario.entity.ts index 5ee2b56..b38165a 100644 --- a/src/inscripcion-usuario/entity/inscripcion_usuario.entity.ts +++ b/src/inscripcion-usuario/entity/inscripcion_usuario.entity.ts @@ -1,5 +1,5 @@ -import { InscripcionDSC } from 'src/inscripcion-dsc/entity/inscripcion_dsc.entity'; -import { Miembro } from 'src/miembro/entity/miembro.entity'; +import { InscripcionDSC } from '../../inscripcion-dsc/entity/inscripcion_dsc.entity'; +import { Miembro } from '../../miembro/entity/miembro.entity'; import { Column, Entity, diff --git a/src/miembro-contacto/entity/miembro_contacto.entity.ts b/src/miembro-contacto/entity/miembro_contacto.entity.ts index 36f7e10..abe58fd 100644 --- a/src/miembro-contacto/entity/miembro_contacto.entity.ts +++ b/src/miembro-contacto/entity/miembro_contacto.entity.ts @@ -1,5 +1,5 @@ -import { Contacto } from 'src/contacto/entity/contacto.entity'; -import { Miembro } from 'src/miembro/entity/miembro.entity'; +import { Contacto } from '../../contacto/entity/contacto.entity'; +import { Miembro } from '../../miembro/entity/miembro.entity'; import { Column, Entity, diff --git a/src/miembro-proyecto/entity/miembro_proyecto.entity.ts b/src/miembro-proyecto/entity/miembro_proyecto.entity.ts index b3ef84d..9c84c47 100644 --- a/src/miembro-proyecto/entity/miembro_proyecto.entity.ts +++ b/src/miembro-proyecto/entity/miembro_proyecto.entity.ts @@ -1,5 +1,5 @@ -import { Miembro } from 'src/miembro/entity/miembro.entity'; -import { Proyecto } from 'src/proyecto/entity/proyecto.entity'; +import { Miembro } from '../../miembro/entity/miembro.entity'; +import { Proyecto } from '../../proyecto/entity/proyecto.entity'; import { Column, Entity, diff --git a/src/miembro/entity/miembro.entity.ts b/src/miembro/entity/miembro.entity.ts index 7d236f7..a52d984 100644 --- a/src/miembro/entity/miembro.entity.ts +++ b/src/miembro/entity/miembro.entity.ts @@ -1,10 +1,10 @@ import { IsEmail } from 'class-validator'; -import { Carrera } from 'src/catalogos/carrera.entity'; -import { TipoMiembro } from 'src/catalogos/tipo-miembro.entity'; -import { EquipoMiembro } from 'src/equipo-miembro/entity/equipo_miembro.entity'; -import { InscripcionUsuario } from 'src/inscripcion-usuario/entity/inscripcion_usuario.entity'; -import { MiembroContacto } from 'src/miembro-contacto/entity/miembro_contacto.entity'; -import { MiembroProyecto } from 'src/miembro-proyecto/entity/miembro_proyecto.entity'; +import { Carrera } from '../../catalogos/carrera.entity'; +import { TipoMiembro } from '../../catalogos/tipo-miembro.entity'; +import { EquipoMiembro } from '../../equipo-miembro/entity/equipo_miembro.entity'; +import { InscripcionUsuario } from '../../inscripcion-usuario/entity/inscripcion_usuario.entity'; +import { MiembroContacto } from '../../miembro-contacto/entity/miembro_contacto.entity'; +import { MiembroProyecto } from '../../miembro-proyecto/entity/miembro_proyecto.entity'; import { Column, Entity, diff --git a/src/participante/participante.entity.ts b/src/participante/participante.entity.ts index 335b2cf..bff547a 100644 --- a/src/participante/participante.entity.ts +++ b/src/participante/participante.entity.ts @@ -1,5 +1,5 @@ import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm'; -import { EventoParticipante } from 'src/evento-participante/evento-participante/eventoParticipante.entity'; +import { EventoParticipante } from '../evento-participante/evento-participante/eventoParticipante.entity'; @Entity() export class Participante { diff --git a/src/periodo/entity/periodo.entity.ts b/src/periodo/entity/periodo.entity.ts index 1339beb..b39595b 100644 --- a/src/periodo/entity/periodo.entity.ts +++ b/src/periodo/entity/periodo.entity.ts @@ -1,4 +1,4 @@ -import { InscripcionDSC } from 'src/inscripcion-dsc/entity/inscripcion_dsc.entity'; +import { InscripcionDSC } from '../../inscripcion-dsc/entity/inscripcion_dsc.entity'; import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm'; @Entity() diff --git a/src/proyecto/entity/proyecto.entity.ts b/src/proyecto/entity/proyecto.entity.ts index a24331d..c46392f 100644 --- a/src/proyecto/entity/proyecto.entity.ts +++ b/src/proyecto/entity/proyecto.entity.ts @@ -1,4 +1,4 @@ -import { MiembroProyecto } from 'src/miembro-proyecto/entity/miembro_proyecto.entity'; +import { MiembroProyecto } from '../../miembro-proyecto/entity/miembro_proyecto.entity'; import { Column, Entity, From c34fb58b30cc987e1ce4c18db0ff36168dc161a9 Mon Sep 17 00:00:00 2001 From: SinR0str0 Date: Sun, 9 Aug 2026 22:00:01 -0600 Subject: [PATCH 4/4] Corrigiendo email controller test --- src/email/email.controller.spec.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/email/email.controller.spec.ts b/src/email/email.controller.spec.ts index 9470aa8..92e23a6 100644 --- a/src/email/email.controller.spec.ts +++ b/src/email/email.controller.spec.ts @@ -1,12 +1,25 @@ import { Test, TestingModule } from '@nestjs/testing'; import { EmailController } from './email.controller'; +import { EmailService } from './email.service'; describe('EmailController', () => { let controller: EmailController; + const mockEmailService = { + sendEmail: jest.fn(), + sendConstancias: jest.fn(), + getParticipantesExcel: jest.fn(), + }; + beforeEach(async () => { const module: TestingModule = await Test.createTestingModule({ controllers: [EmailController], + providers: [ + { + provide: EmailService, + useValue: mockEmailService, + }, + ], }).compile(); controller = module.get(EmailController);