Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Table of Contents
stylenone

...

Sanity Figma: to be filled by design team

WL Figma: https://www.figma.com/design/RtD0UFtwuwXx14lbLCAPlr/branch/SjrTCnkEyeTsC3NNQRsno4/Burger-King?node-id=37068-15787&t=fTr0rg2b61XwxMYo-0 (temporary branch)

...

🔍 Reviewers

Context

To comply with the government rule requiring bag fee tax information, we need to modify our partners' services to retrieve this data from Sanity and forward it appropriately. We’ll need to show this information in the following applications: POS, DMP, Admin App and Whitelabel App.

...

  • The idea is to create a new document in Sanity to get the Bag Fee tax value (see https://rbictg.atlassian.net/wiki/spaces/IBC/pages/4660560004#Sanity4660560004/ADR+-+Bag+Fee#Sanity-proposals below for more details) and service mode that will consider this tax

  • Get the data from Sanity and adjust the desired flow to:

    • Show Bag Fee value (POS, DMP, Admin app, Admin tools and Whitelabel)

    • Total cart price updated considering the Bag Fee value (that cannot have any discounted value)

  • Reuse cart.fees interface in Backend because all the flow is already working with this (saving the value in DynamoDB, show information in Whitelabel App through getOrder)

    image-20240524-214051.pngImage Addedimage-20240522-012220.pngImage Added
    • We don’t want the front end to be the source of truth for the bag fee value, and following the WL pattern that we have today, the backend (getting from Sanity there) should return the value, and the front end will be responsible for the presentation layer

...

Expand

Intl-packages and Intl-sanity

We need to adjust this to get the necessary information from Sanity that will be used later on partners-service.

#Option 1 - Create a new service class in sanity packages to use in partners-service

  • Create a new folder in intl-packages/packages/sanity/src that will be responsible to get the new bag fee information from sanity

  • Create a new class that will be used to inject the information from Sanity in other necessary repos (like the partners-service

    • We can take a look in intl-packages/packages/sanity/src/loyalty/index.ts to know how to implement this

#Option 2 - Not touch in Sanity packages and develop the sanity part locally in partners-service repo OR fulfillment

  • Use the Sanity client to get the necessary document values directly at the chosen repository

Intl-partners-service (if #Option 1 is chosen)

  • Adjust intl-partners-service/src/modules/orders/orders.service.ts

    • Inject the new Sanity instance (developed above in Sanity service solution) to be able to get the bag fee value

    • Adjust price() method to:

      • Add a new property for bagFee value or reuse the cart.fees property (see more details below)

        image-20240521-220441.png
  • As this interface is already prepare to deal with bag fee type we just need to assign the bag fee value from Sanity if exists

    image-20240522-012220.pngimage-20240524-214051.png
  • Interfaces affected:

    • For now, none

Intl-fulfillment-service and Intl-packages/Intl-fulfillment (if #Option 2 is chosen)

  • Adjust priceOrder to:

    • Get values from Sanity

    • Add the values ins in cart.fees structure

  • Interfaces affected:

    • For now, none

Intl-whitelabel-app

Sequence diagram demonstrating WL communication

Zenuml sequence macro lite
uuid823e1d8f-be1c-4153-9e01-b1e21f383cc8
customContentId4714758274
updatedAt2024-05-14T19:06:36Z

Interfaces impact

None. The fees structure already exists in WL App. This value comes from Server Order details (getOrder) at the root of the cart object (cart.fees)

image-20240523-220520.png

Affected screens

The requirements:

  • Show the new bag fee information in:

    • Checkout page

    • Confirmation delivery page and delivery track details modal

    • Receipt page

  • Include bag Fee to be considered in Loyalty Points Calculation if checked on Sanity

The following screens are already showing information about these fees if received from backend. We’ll only need to adjust some visual aspects to match Figma proposal.

  • Receipt details (if enable-discounts-on-order-receipt flag is ON)

    image-20240522-220710.png
  • Your cart subtotal section (the fees values will be below subtotal value)

    image-20240522-220141.png
  • Delivery details

image-20240522-221301.pngimage-20240522-221352.png

Intl-expeditor-tablet (DMP Frontend)

  • Adjust formatRbiFees to include bag fee information

  • Add bag fee in fees.dto

  • Adjust intl-expeditor-tablet to show bag fee in front-end as well

image-20240523-203529.png

Admin App

  • Backend

    • Adjust cart interface to get fees structure

  • Frontend

    • Adjust fechOrder to have fees

    • Adjust tax-fees-and-totals comp to show bag fee in the list of items

image-20240524-143035.png

Intl-partners-api

  • No changes needed. Already prepared

...

The current screenshots don’t have the field for delivery. The idea here is to add insights for design team to work on. This is not the final result yet as the design is not finished yet.

Insights for design team

# Option 1 - Nested service mode block

...