Front-end
...
Similar to what we have in the current app (airtouch):
...
gastos de envio → delivery fee
otros gastos → management fee
FE tech discovery can be found here
Mapping of how delivery fee is set (BE):
PriceOrder
Calls partner service API PriceOrder to get price related info including fees.
Persists taxes fees into the database
GetOrder
Retrieves order related info from the database, including fees
...
Delivery fees are managed by the fee service ( intl-delivery-service):
getFeeAndDiscountByBrand
getFeeChargeByTier
It get the values from launchdarkly based on the service mode.
If catering , it uses
tiered-catering-delivery-fees
Otherwise, it uses
tiered-delivery-fees
Searches the tier list from highest to lowest key, stopping when requestedAmountCents exceeds that tier.
Said that, we can to analyze the following "return” to propose the management fee. Apart from that, looks like Launchdarkly existing configuration (variations) were thought to enable "free delivery” and we can leverage this approach.
We may introduce a new fee named "management fee” to fulfill the current use-case or explore existing fees.Code Block return { baseDeliveryFee: fee, --> LD fee deliverySurchargeFee, --> LD expandedFees (based on delivery quotation value) discount, --> LD discount fee: fee + geographicalFee + serviceFee + smallCartFee + deliverySurchargeFee, geographicalFee, --> LD geographicalFee serviceFee, --> Calculated with LD serviceFeePercent of the requested amount smallCartFee, --> LD smallCartFee };
Expand | ||
---|---|---|
| ||
{ |
...
SNS: dev-plk-delivery-quote-outcome
SQS: aws-rbi-dev-plk-apply-delivery-service-quote
Lambda: sls-rbi-dev-plk-orders-delivery-service-apply-quote ( intl-orders-service)
Which get the message and updates the current order in the database (dynamodb)
Proposal:
Enhance this lambda function (dev-plk-delivery-on-apply-quote) to not overwrite discount and service fees with zeroes. It should keep the value from launchdarkly.
Configure launchdarkly to fit business needs enabling FE to show fees and discounts properly.
discount <> 0
serviceFee <> 0
fee <> 0
...