make difference between pre-reservation and post-reservation unscheduled use

This commit is contained in:
Bilal Catic
2019-07-07 02:43:07 +02:00
parent 5d3653cd65
commit bd513b7599
3 changed files with 76 additions and 23 deletions

View File

@@ -400,7 +400,7 @@ const getIncidentData = (reservation) => {
// 1. Check if member entered before reservation start time
if (unlockEntry && chargeBefore && !previousReservationIsBackToBack) {
incidents.push({
incidentType: incidentType.UNSCHEDULED_INCIDENT_RELATED_WITH_RESERVATION,
incidentType: incidentType.UNSCHEDULED_INCIDENT_BEFORE_RESERVATION,
reservation,
unlockTimestamp: unlockEntry.timestamp,
lockTimestamp: null,
@@ -415,7 +415,7 @@ const getIncidentData = (reservation) => {
// 2. Check if member left after reservation end time
if (lockEntry && chargeAfter && !nextReservationIsBackToBack) {
incidents.push({
incidentType: incidentType.UNSCHEDULED_INCIDENT_RELATED_WITH_RESERVATION,
incidentType: incidentType.UNSCHEDULED_INCIDENT_AFTER_RESERVATION,
reservation,
unlockTimestamp: null,
lockTimestamp: lockEntry.timestamp,
@@ -508,7 +508,8 @@ const calculateDoorLockCharges = () => {
case incidentType.UNLOCKED_INCIDENT_STANDALONE:
unlockedIncidents.push(incident);
break;
case incidentType.UNSCHEDULED_INCIDENT_RELATED_WITH_RESERVATION:
case incidentType.UNSCHEDULED_INCIDENT_BEFORE_RESERVATION:
case incidentType.UNSCHEDULED_INCIDENT_AFTER_RESERVATION:
case incidentType.UNSCHEDULED_INCIDENT_STANDALONE:
unscheduledIncidents.push(incident);
break;