Problem statement
Portuguese law requires that customer pays a tax related with bags usage. This tax aims to reduce bags consumption to comply with environment sustainable goals. Although, this law could not be reinforced in other UE countries, it’s likely that other markets will adopt similar laws/regulations.
To comply with this law, BK PT must display of the paper bag tax value on the platform/system, which customers have to pay.
We need to show this information to the user and to the person managing delivery partners platforms (such as DMP) and Admin Tools (for support purposes).
This deliverable will be available for any other brand/market as needed.
Business requirements
This tax must be shown and applied to every service mode that requires a bag or places a takeaway order:
...
The label for the paper bag tax should be configured in the Lokalise platform, as desired.
Where does the paper bag tax need to be shown?
Application | Demonstration |
---|---|
Whitelabel App | |
Admin Tools (Order details) | |
DMP (Order details) | |
Email receipt |
Sanity configuration
To configure which service mode will enable the Paper Bag Tax, the value for each one, the email receipt template, and other configurations, we have the following dedicated document: /wiki/spaces/COG/pages/4900028627 Feature - Fees and Taxes.
Delivery Partners Platforms integration
The Paper Bag Tax will be sent in the fees field of the Create Delivery Webhook using the BAG_FEE
type: https://euw3-bk-partners.rbictg.com/docs/market/#tag/DeliveryWebhook/operation/deliveryCreate.
...
POS partners integration
POS partners should use existing API https://euw3-bk-partners.rbictg.com/docs/market/#tag/OrderAPI/operation/getOrder to read order details including bag tax (named internally as BAG_FEE) .
...
Lokalise keys
All keys below will change the label for the line that shows the paper bag tax value.
Admin Tools
orderDetails.bagFee
DMP
pages.OrderManagement.OrderDetails.fees.bagFee
Whitelabel App
bagFee
Feature Flags
Flags that affect all the applications where we’ll show the paper bag tax and are responsible for enabling the back-end logic:
...
enable-bag-fee: Enable this to include the paper bag tax in the back-end logic. If disabled, the paper bag tax value will not be returned or sent to the partners' API or saved in the database
Accepts country, region, storeId and email as filters
If we want to condition only for a specific store we should focus on this flag because it will be the main toggle to turn the feature enable or disabled
enable-relaying-new-cart-fees-to-pos: Enable this if the
cart.fees
structure (which includes the paper bag tax value) should be sent to the POS partnerAccepts only country as filter
Flags that affect only Whitelabel App:
...
enable-fees-on-order-receipt: Enable if custom fees (such as the paper bag tax) should be shown on the delivery tracking modal receipt. For the “default” receipt, this flag does not need to be enabled
Should accept any valid general filter in LD context
Flags that affect only delivery partners platform (such as DMP):
...
display-fees-from-webhook: Enable this to show fees (such as the paper bag tax) value in delivery order details
Should accept any valid general filter in LD context