Design:
...
Backend:
{
"0":{
"app":{
"discount":0,
"serviceFeeDiscount":0,
"fee":199,
"serviceFee":100
}
},
"10":{
"app":{
"discount":99,
"serviceFeeDiscount":50,
"fee":199,
"serviceFee":100
}
},
"20":{
"app":{
"discount":199,
"serviceFeeDiscount":100,
"fee":199,
"serviceFee":100
}
}
}
Frontend:
MAXIMUM_POTENTIAL_DISCOUNT (E.g: 2.99)
Dynamic Calculation based on the HIGHER TIER discount + serviceFeeDiscount
Pros: Flexible
Cons: Less autonomy (control) / more complex / new interface impacts
Option 2 loo
THRESHOLD( E.g: 20.00) → We have two options:
Calculation based on FF discounted-delivery-threshold-cents
Pros: Existing approach / minimum efforts
Cons: Less flexible/ requires caution when configuring / changing config
Dynamic Calculation based on the HIGHER tier
Pros : flexible
Cons: Requires more effort to read the higher tier and return it via new field in the interface
AMOUNT_AWAY_FROM_MAXIMUM_DISCOUNT (E.g.: 8.00 ) →
Threshold - (requestedAmountCents OR
(subTotalCents
+taxCents)
)