const USER_ENTRY_EVENT = 'User Entry'; const ENABLE_PASSAGE_MODE = 'Enable Passage Mode by Group 2'; const DISABLE_PASSAGE_MODE = 'Disable Passage Mode by Group 2'; const VALID_CSV_HEADERS = ['Date', 'Time', 'User No', 'Name', 'Event']; const doorLockEvents = { USER_LOCKED: 'locked', USER_UNLOCKED: 'unlocked', }; const unlockedIncidentLevelsPrices = { UNLOCKED_0: { id: 0, title: 'UNLOCKED_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, description: 'Second month', }, UNLOCKED_2: { id: 2, title: 'UNLOCKED_2', price: parseInt(process.env.UNLOCK_2) || 20, description: 'Third month', }, UNLOCKED_3: { id: 3, title: 'UNLOCKED_3', price: parseInt(process.env.UNLOCK_3) || 30, description: 'Fourth month', }, UNLOCKED_4: { id: 4, title: 'UNLOCKED_4', price: parseInt(process.env.UNLOCK_4) || 40, description: 'Fifth month', }, UNLOCKED_5: { id: 5, title: 'UNLOCKED_5', price: parseInt(process.env.UNLOCK_5) || 50, description: 'Sixth month and onward', } }; const csvParserErrors = { INVALID_HEADERS: 'Invalid headers', INVALID_ENTRY_EXPECTED_USER: 'Invalid entry type. Expected user entry type', INVALID_ENTRY_EXPECTED_PASSAGE_MODE: 'Invalid entry type. Expected enable/disable passage mode following user entry', UNKNOWN_MEMBER: 'Member is not registered in OfficeRnD system', GENERIC_ERROR: 'There was error while parsing uploaded file(s)', }; const officeRnDAPIErrors = { FAILED_TO_FETCH_MEMBERS: 'Failed to fetch members', 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', INVALID_DATE_RANGE: 'Dates in date range are invalid', }; const incidentType = { NOT_AN_INCIDENT: 1, UNLOCKED_INCIDENT_RELATED_WITH_RESERVATION: 2, UNSCHEDULED_INCIDENT_BEFORE_RESERVATION: 3, UNSCHEDULED_INCIDENT_AFTER_RESERVATION: 4, UNLOCKED_INCIDENT_STANDALONE: 5, UNSCHEDULED_INCIDENT_STANDALONE: 6, BOOKING_MOVED_TO_ANOTHER_DAY: 7, BOOKING_SHORTENED: 8, 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'; const MAX_BACK_TO_BACK_DIFFERENCE = parseInt(process.env.MAX_BACK_TO_BACK_DIFFERENCE) || 0; const UNSCHEDULED_TIME_RESOLUTION = parseInt(process.env.UNSCHEDULED_USE_TIME_RESOLUTION) || 5; const UNSCHEDULED_CHARGE_PRICE = parseFloat(process.env.UNSCHEDULED_USE_CHARGE_PRICE) || 5; const BOOKING_CHANGE_PERCENTAGE_CHARGE = parseInt(process.env.BOOKING_CHANGE_PERCENTAGE_CHARGE) || 100; const ALLOWED_BOOKING_CANCELLATION_TIME= parseInt(process.env.ALLOWED_BOOKING_CANCELLATION_TIME) || 30; module.exports = { VALID_CSV_HEADERS, USER_ENTRY_EVENT, ENABLE_PASSAGE_MODE, DISABLE_PASSAGE_MODE, csvParserErrors, officeRnDAPIErrors, doorLockEvents, unlockedIncidentLevelsPrices, integrationServiceErrors, incidentType, incidentTypeExplanations, UI_TIMEZONE, DEFAULT_DATE_FORMAT, MAX_BACK_TO_BACK_DIFFERENCE, UNSCHEDULED_TIME_RESOLUTION, UNSCHEDULED_CHARGE_PRICE, BOOKING_CHANGE_PERCENTAGE_CHARGE, ALLOWED_BOOKING_CANCELLATION_TIME, };