Fix for loading

This commit is contained in:
Senad Uka
2019-07-25 06:53:32 +02:00
parent a691ab94c7
commit 2db47e95e1
26 changed files with 838 additions and 400 deletions

View File

@@ -13,32 +13,38 @@ const unlockedIncidentLevelsPrices = {
UNLOCKED_0: {
id: 0,
title: 'UNLOCKED_0',
price: parseInt(process.env.UNLOCK_0) || 0
price: parseInt(process.env.UNLOCK_0) || 0,
description: 'First month - warning',
},
UNLOCKED_1: {
id: 1,
title: 'UNLOCKED_1',
price: parseInt(process.env.UNLOCK_1) || 10
price: parseInt(process.env.UNLOCK_1) || 10,
description: 'Second month',
},
UNLOCKED_2: {
id: 2,
title: 'UNLOCKED_2',
price: parseInt(process.env.UNLOCK_2) || 20
price: parseInt(process.env.UNLOCK_2) || 20,
description: 'Third month',
},
UNLOCKED_3: {
id: 3,
title: 'UNLOCKED_3',
price: parseInt(process.env.UNLOCK_3) || 30
price: parseInt(process.env.UNLOCK_3) || 30,
description: 'Fourth month',
},
UNLOCKED_4: {
id: 4,
title: 'UNLOCKED_4',
price: parseInt(process.env.UNLOCK_4) || 40
price: parseInt(process.env.UNLOCK_4) || 40,
description: 'Fifth month',
},
UNLOCKED_5: {
id: 5,
title: 'UNLOCKED_5',
price: parseInt(process.env.UNLOCK_5) || 50
price: parseInt(process.env.UNLOCK_5) || 50,
description: 'Sixth month and onward',
}
};
const csvParserErrors = {
@@ -50,9 +56,13 @@ const csvParserErrors = {
};
const officeRnDAPIErrors = {
FAILED_TO_FETCH_MEMBERS: 'Failed to fetch members',
FAILED_TO_FETCH_BOOKINGS: 'Failed to fetch booking reservations'
FAILED_TO_FETCH_BOOKINGS: 'Failed to fetch booking reservations',
FAILED_TO_FETCH_FEES: 'Failed to fetch existing fees',
FAILED_TO_DELETE_FEES: 'Failed to delete fees in ORD',
FAILED_TO_ADD_FEES: 'Failed to add fees in ORD',
};
const integrationServiceErrors = {
IMPORT_SUCCESSFUL_CALCULATION_FAILED: 'Import succeeded but fetching reservations and calculating charges failed',
FAILED_TO_SAVE_BOOKINGS: 'Failed to save booking reservations',
FAILED_TO_SAVE_DOOR_LOCK_ENTRIES: 'Failed to save door lock entries',
FAILED_TO_SAVE_DATA_GENERIC: 'Failed to save data',
@@ -71,6 +81,16 @@ const incidentType = {
BOOKING_CANCELED_LATE: 9,
};
const incidentTypeExplanations = {};
incidentTypeExplanations[incidentType.UNLOCKED_INCIDENT_RELATED_WITH_RESERVATION] = 'Door left unlocked';
incidentTypeExplanations[incidentType.UNLOCKED_INCIDENT_STANDALONE] = 'Door left unlocked';
incidentTypeExplanations[incidentType.UNSCHEDULED_INCIDENT_BEFORE_RESERVATION] = 'Room used before reservation started';
incidentTypeExplanations[incidentType.UNSCHEDULED_INCIDENT_AFTER_RESERVATION] = 'Room used after reservation started';
incidentTypeExplanations[incidentType.UNSCHEDULED_INCIDENT_STANDALONE] = 'Room used without reservation';
incidentTypeExplanations[incidentType.BOOKING_MOVED_TO_ANOTHER_DAY] = 'Reservation moved to another day';
incidentTypeExplanations[incidentType.BOOKING_SHORTENED] = 'Reservation shortened';
incidentTypeExplanations[incidentType.BOOKING_CANCELED_LATE] = 'A reservation canceled after the grace period';
const UI_TIMEZONE = process.env.UI_TIMEZONE || 'America/Los_Angeles';
const DEFAULT_DATE_FORMAT = 'YYYY-MM-DD';
@@ -94,6 +114,7 @@ module.exports = {
unlockedIncidentLevelsPrices,
integrationServiceErrors,
incidentType,
incidentTypeExplanations,
UI_TIMEZONE,
DEFAULT_DATE_FORMAT,
MAX_BACK_TO_BACK_DIFFERENCE,