Design:
...
{
"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_SAVING (E.g: 2.99) :
HIGHER LOWER TIER (fee + serviceFee - discount - serviceFeediscount ) - LOWER HIGHER TIER (fee +serviceFee - discount - serviceFeeDiscount )
Pros: More flexible.
Cons: More calculations to handle different tiers / more efforts/ new fee interface changes
...