Uploaded by Rakshitha Muranga Rodrigo

dropme price calculation

advertisement
Fare Calculation Logic – DROPME
2018 – December – 12
Version - 2.1
Considerations
price(renamedTo : AdminCommission)
BaseFare(renamedTo : BookingFare)
MinimumFare
MinimumKM
BelowKMFare (less than KM limit)
BelowAboveKMRange (KM limit)
AboveKMFare(greter than KM limit)
TrafficWaitingFee
NormalWaitingFee
TripTravelledDistance (from driver app)
#Logic
if ( TripTravelledDistance <= MinimumKMRange) {
total = AdminCommission + BookingFare + minimumFare + (waitingTime * [trafficWaitingFee || normalWaitingFee])
} elif ( TripTravelledDistance <= BelowAboveKMRange){
total = AdminCommission + BookingFare + minimumFare + (waitingTime * [trafficWaitingFee || normalWaitingFee]) + (BelowKMFare * [TripTravelledDistance - MinimumKMRange ])
} elif ( TripTravelledDistance > BelowAboveKMRange){
total = AdminCommission + BookingFare + minimumFare + (waitingTime * [trafficWaitingFee || normalWaitingFee]) + (BelowKMFare * [BelowAboveKMRange – MinimumKMRange ])
+ (AboveKMFare * [TripTravelledDistance - BelowAboveKMRange])
}
Download