diff --git a/src/participante_evento/participante_evento.controller.ts b/src/participante_evento/participante_evento.controller.ts index bc450cb..8343ea9 100644 --- a/src/participante_evento/participante_evento.controller.ts +++ b/src/participante_evento/participante_evento.controller.ts @@ -233,12 +233,41 @@ export class ParticipanteEventoController { ); } + @ApiOperation({ + summary: 'Registrar asistencia de un participante a un evento', + }) + @ApiParam({ + name: 'idParticipante', + description: 'ID del participante', + type: 'number', + }) + @ApiParam({ name: 'idEvento', description: 'ID del evento', type: 'number' }) + @ApiResponse({ + status: 200, + description: 'Asistencia registrada correctamente', + }) + @ApiResponse({ status: 404, description: 'Registro no encontrado' }) + @Post('asistencia/:idParticipante/:idEvento') + registrarAsistenciaSinToken( + @Param('idParticipante', ParseIntPipe) idParticipante: number, + @Param('idEvento', ParseIntPipe) idEvento: number, + ) { + return this.participanteEventoService.registrarAsistenciaSinToken( + idParticipante, + idEvento, + ); + } + + @ApiOperation({ + summary: 'Retornala info del token QR', + }) @Post('decode-token') decodeToken(@Body() body: { token: string }) { return this.participanteEventoService.validToken( body.token, ); } + @ApiOperation({ summary: 'Registrar asistencia usando token QR', }) diff --git a/src/participante_evento/participante_evento.service.ts b/src/participante_evento/participante_evento.service.ts index cbb2dab..548e2e6 100644 --- a/src/participante_evento/participante_evento.service.ts +++ b/src/participante_evento/participante_evento.service.ts @@ -160,10 +160,9 @@ export class ParticipanteEventoService { return this.participanteEventoRepository.save(participante_evento); } - async registrarAsistencia( + async registrarAsistenciaSinToken( id_participante: number, id_cuestionario: number, - token: string, ) { const participante_eventoFound = await this.participanteEventoRepository.findOne({