Merge branch 'remove-first-5-minutes-from-unscheduled-use' into 'master'
remove first N minutes from unscheduled use (N is time resolution) See merge request saburly/psihologija!78
This commit was merged in pull request #78.
This commit is contained in:
@@ -255,9 +255,8 @@ const analyseReservation = (reservation) => {
|
||||
}
|
||||
|
||||
let timeIntervalsToChargeBefore = Math.floor(timeDifferenceFromUnlockEntry / UNSCHEDULED_TIME_RESOLUTION);
|
||||
if (timeDifferenceFromUnlockEntry < UNSCHEDULED_USE_INITIAL_TIME_SEGMENT_LENGTH){
|
||||
timeIntervalsToChargeBefore = 0;
|
||||
}
|
||||
timeIntervalsToChargeBefore -= 1; // Remove first N minutes, N = UNSCHEDULED_TIME_RESOLUTION
|
||||
|
||||
const totalChargeFeeBefore = timeIntervalsToChargeBefore * UNSCHEDULED_CHARGE_PRICE;
|
||||
const chargeBefore = totalChargeFeeBefore > 0;
|
||||
|
||||
@@ -267,9 +266,8 @@ const analyseReservation = (reservation) => {
|
||||
timeDifferenceFromLockEntry = lockTime.diff(currentReservationEnd, 'minutes');
|
||||
}
|
||||
let timeIntervalsToChargeAfter = Math.floor(timeDifferenceFromLockEntry / UNSCHEDULED_TIME_RESOLUTION);
|
||||
if (timeDifferenceFromLockEntry < UNSCHEDULED_USE_INITIAL_TIME_SEGMENT_LENGTH){
|
||||
timeIntervalsToChargeAfter = 0;
|
||||
}
|
||||
timeIntervalsToChargeAfter -= 1; // Remove first N minutes, N = UNSCHEDULED_TIME_RESOLUTION
|
||||
|
||||
const totalChargeFeeAfter = timeIntervalsToChargeAfter * UNSCHEDULED_CHARGE_PRICE;
|
||||
const chargeAfter = totalChargeFeeAfter > 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user