...
We currently send a single discount to the front end as the delivery discount, and we aim to display the service fee discount separately. Essentially, we want to show the original amount, crossed out, and place the word "free" next to it in a prominent highlight.
Solution
...
Add a new field in LaunchDarkly to store the discount value. For instance, if the 'serviceFee' is 300 cents, there will be a corresponding 'serviceFeeDiscount' field The field will be named serviceFeeDiscount
with a value of 300 cents, indicating the intention to deduct the entire amount.
Solution #2
If the service fee is calculated as a percentage of the order total, the discount should also be in percentage terms. For example, the value could be 100% to remove the entire fee or 50% to deduct half.
N cents that will discount the calculated serviceFee
by that amount in cents.
A second new field will be added in LaunchDarkly named serviceFee
that if populated will override the calculation previously used the calculate the serviceFee
. After reviewing the code this feature already exists. As long as serviceFeePercent
is null or 0 the value used will be the value stored in serviceFee
.
Technical Solution
Jira Legacy | ||||||
---|---|---|---|---|---|---|
|
Sequence diagram of solution flow
...
Note that the proposed changes have sinergy synergy with the refinement to show the service fees in DMP: Feature - Show delivery fees in DMP
Detailed flow
...
Simplified flow
...