This commit is contained in:
David Arranz 2019-09-10 20:44:00 +02:00
parent cb3436c133
commit b827115bde
2 changed files with 11 additions and 6 deletions

View File

@ -352,11 +352,13 @@ console.log('actualizo confirmados de la nueva reserva');
null)
else
return handleResultResponse("No se ha podido actualizar el aforo de la reserva", null, params, res, httpStatus.NOT_FOUND);
}
//Ponemos la reserva en SOLD_OUT y abrimos la lista de espera si se puede
//Ponemos la reserva en SOLD_OUT para que no se pueda apuntar nadie más
if (dataInscription.reservation.assistants == dataInscription.inscriptionsWithReservationCount)
await eventReservationService._updateSoldOutReservation(dataInscription.reservation.id, true);
}
// APUNTARSE A LISTA DE ESPERA SI SE PUEDE
else {
await eventReservationService._updateSoldOutReservation(dataInscription.reservation.id, true);
if (dataInscription.reservation.allow_overflow === true) {
dataInscription.validated = false;
dataInscription.inscriptionsWithReservationCount = await eventInscriptionService._getCountInscriptionsWithReservation(dataInscription.reservation.overflow_reservationId);
@ -399,10 +401,13 @@ console.log('actualizo confirmados de la nueva reserva');
null)
else
return handleResultResponse("No se ha podido actualizar el aforo del evento", null, params, res, httpStatus.NOT_FOUND);
//Ponemos el evento en SOLD_OUT
if (dataInscription.event.assistants == dataInscription.inscriptionsWithoutReservationCount)
await eventService._updateSoldOutEvent(dataInscription.event.id, true);
}
//Ponemos el evento en SOLD_OUT y abrimos la lista de espera si se puede
// APUNTARSE A la lista de espera si se puede
else {
await eventService._updateSoldOutEvent(dataInscription.event.id, true);
if (dataInscription.event.allow_overflow === true) {
dataInscription.validated = false;

View File

@ -18,7 +18,7 @@ const generalInvalidFields = [
'userId', 'createdAt', 'updatedAt',
'assistants', 'confirmed', 'allow_multiple', 'overflow_eventId',
'state', 'confirmed',
'multiple_limit', 'allow_overflow', 'marketing_list',
'multiple_limit', 'marketing_list',
];
routes.get('/events',