mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-11-28 09:24:24 +01:00
(bug) event pre-registration status
This commit is contained in:
parent
768b5d7e0e
commit
d5fa71e113
@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { react2angular } from 'react2angular';
|
||||
import _ from 'lodash';
|
||||
import { Reservation } from '../../models/reservation';
|
||||
import FormatLib from '../../lib/format';
|
||||
import { IApplication } from '../../models/application';
|
||||
@ -44,14 +45,20 @@ export const EventReservationItem: React.FC<EventReservationItemProps> = ({ rese
|
||||
* Return the pre-registration status
|
||||
*/
|
||||
const preRegistrationStatus = () => {
|
||||
if (!reservation.is_valid && !reservation.canceled_at && !reservation.is_paid) {
|
||||
if (!_.isBoolean(reservation.is_valid) && !reservation.canceled_at && !reservation.is_paid) {
|
||||
return t('app.logged.event_reservation_item.in_the_process_of_validation');
|
||||
} else if (reservation.is_valid && !reservation.canceled_at && !reservation.is_paid) {
|
||||
} else if (reservation.is_valid && !reservation.canceled_at && !reservation.is_paid && reservation.reservable.amount !== 0) {
|
||||
return t('app.logged.event_reservation_item.settle_your_payment');
|
||||
} else if (reservation.is_paid && !reservation.canceled_at) {
|
||||
} else if (reservation.is_valid && !reservation.canceled_at && !reservation.is_paid && reservation.reservable.amount === 0) {
|
||||
return t('app.logged.event_reservation_item.registered');
|
||||
} else if (!reservation.is_valid && !reservation.canceled_at) {
|
||||
return t('app.logged.event_reservation_item.not_validated');
|
||||
} else if (reservation.is_paid && !reservation.canceled_at && reservation.reservable.amount !== 0) {
|
||||
return t('app.logged.event_reservation_item.paid');
|
||||
} else if (reservation.is_paid && !reservation.canceled_at && reservation.reservable.amount === 0) {
|
||||
return t('app.logged.event_reservation_item.present');
|
||||
} else if (reservation.canceled_at) {
|
||||
return t('app.logged.event_reservation_item.paid');
|
||||
return t('app.logged.event_reservation_item.canceled');
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -27,7 +27,8 @@ export interface Reservation {
|
||||
slots_reservations_attributes: Array<SlotsReservation>,
|
||||
reservable?: {
|
||||
id: number,
|
||||
name: string
|
||||
name: string,
|
||||
amount?: number
|
||||
},
|
||||
nb_reserve_places?: number,
|
||||
tickets_attributes?: Array<{
|
||||
|
@ -49,6 +49,9 @@ en:
|
||||
settle_your_payment: "Come to the reception desk to settle"
|
||||
paid: "Paid"
|
||||
canceled: "Canceled"
|
||||
registered: "Registered"
|
||||
not_validated: "Not validated"
|
||||
present: "Present"
|
||||
dashboard:
|
||||
#dashboard: public profile
|
||||
profile:
|
||||
|
@ -49,6 +49,9 @@ fr:
|
||||
settle_your_payment: "Venez régler à l'accueil"
|
||||
paid: "Payé"
|
||||
canceled: "Annulé"
|
||||
registered: "Inscrit"
|
||||
not_validated: "Non validé"
|
||||
present: "Présent"
|
||||
dashboard:
|
||||
#dashboard: public profile
|
||||
profile:
|
||||
|
Loading…
Reference in New Issue
Block a user