feat: add endpoint to register participant attendance without token
This commit is contained in:
@@ -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',
|
||||
})
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user