/
[Solution] Summary & historical data from Customer Tier in Loyalty Transaction

[Solution] Summary & historical data from Customer Tier in Loyalty Transaction

 

Document Status

Reviewed

Document Owner(s)

@Goncalves, Felipe

Reviewers

@Raphael Ferreira Gomes
@Ruani, Andrea
@Garozzo de Sobral, Wellington
@Franca, Helio
@Augusto Romao, Vinicius
@Caes, Guilherme
@Fragalli, Andre

Potential Solutions

Note: this section should be short and sweet, documenting notes about different solutions that were considered during ideation. Can just be a link to a whiteboard for example. Expected outcome: one solution is chosen and documented in more detail under Proposed Solution.

This solution aims to assist Customer Support operators in quickly responding to inquiries about user tier levels. It provides information on reasons for tier changes and accumulated tier points over time, thereby facilitating and expediting the handling of these requests.

Proposed Solution

Description of the proposed solution.

For Customer Support operators it is essential to have more details about the user's history at their current tier. To get this information, the operator need to access the values that the user had in his own transactions. Therefore, we need to retrieve the available data regarding the user's tier for each transaction. This functionality is already implemented in the providers, we just need to add this data to the Types and Queries in GraphQL.

Figma file

https://www.figma.com/design/Ti8Qr6jeSEPaencIDyYfcJ/branch/BWG0jdWLD56nLea7jNklPq/Burger-King?node-id=3292-6851&t=dFfOhVKnNLluzx2k-0

Development

Add Feature Flag

Is the same FF of this solution

Backend:

Customer Tier on Transactions

transaction.jpg

Each transaction on the Loyalty Transaction screen needs to include tier information for historical purposes. The provider already returns the transaction with points tier, so we need to add the tier information to the Loyalty Schema and the GQL query in the Front-end.

image-20250120-121451.png
  • File: services/graphql/src/schemas/intl-loyalty.ts

  • Add the new Type on CurrentLoyaltyTier in Person type in the schemas

    • type Person { currentLoyaltyTier: INTLCurrentLoyaltyTier currentPoints: String } type INTLCurrentLoyaltyTier { loyaltyTierExpiryDate: String loyaltyTierKey: String pointsEarnedInTimeConstraint: Int startAt: String }
  • Run yarn build to run the Apollo Types

  • File: src/remote/queries/fragments/intl-loyalty-transaction.ts

  • Add the new prop on CompleteTimeLine and TransactionCard component with name customerLoyaltyTierConfig and this field is optional

    • export const INTLLoyaltyTransactionFragmentForTimeline = gql` fragment INTLLoyaltyTransactionFragmentForTimeline on INTLLoyaltyTransaction { ... transactionDetails { person { currentLoyaltyTier { loyaltyTierExpiryDate loyaltyTierKey pointsEarnedInTimeConstraint startAt } currentPoints } } ... } `;

Frontend

Summary Part

In this section, it is essential to include the Tier level, so that the support user can identify the current customer level.

  • File: src/containers/intl-loyalt/index.tsx

  • Use the loyaltyId and isoCountryCode from customerData that already created in the container to call the tier query

  • File Types: src/components/intl-loyalty/types.ts

  • Add the new optional field in IntlLoyaltyProps type

    • File component CustomerLoyaltyIntl: src/components/intl-loyalty/index.tsx

  • import the INTLCustomerLoyaltyTierConfig from src/types/intl-loyalty.ts

    • export type IntlLoyaltyProps = { ... customerLoyaltyTierConfig?: INTLCustomerLoyaltyTierConfig, ... };
  • File component Summary of loyalty: src/components/intl-loyalty/summary.tsx

  • Add the new optional field tierLevel on SummaryProps type with optional

    • File component Summary: src/design-system/summary-component/types.ts

    • Get the tier level from the customerLoyaltyTierConfig interface

  • Here an example of which data need to have in the new interface

Transaction Part

In this section, we can add the loyalty tier information for each order, allowing for the visualization of the points history and the user's level at the time of purchase. This will assist the support user in addressing any inquiries regarding level changes, point accumulation, and time periods.

Here we already have the customer and configuration tier information on src/components/intl-loyalty/index.tsx, so we need to pass this to the next components.

 

POC

https://github.com/rbilabs/intl-admin-app/pull/824

Acceptance Criteria

1 - Display of Tier Information on Loyalty Screen

  • Given that the user accesses the Loyalty screens,

  • When the data client is loaded,

  • Then the system should display the following information in the Summary in Loyalty Transaction

    • Current Loyalty Tier, next the Balance Points information

      • This label changes if the user changes the Tier level

        • Normal Tier => King

        • Advanced Tier => SuperKing

  • And the system should display the following information in Orders Transactions Panel:

  • A component that we can expand or collapse, and with this informations

    • Current Loyalty Tier

      • This label changes if the user changes the Tier level

    • Loyalty Tier Period

    • Points earned in this Tier and how much need to change or maintain the Tier

      • This label changes if the user changes the Tier level

      • These points must be the value at the time of purchase.

3 - Feature Flag

  • Given that there is new data to be displayed,

  • When the feature flag is activated,

  • Then the new data should be displayed in the user interface.

  • And when the feature flag is deactivated, the new data should be hidden.

    • PS: This flag is temporary

Potential Challenges

Bear in mind that the solution has been designed considering the Tiers parameters (mostly the points to obtain a specific level) will remain the same along the time. In case this information will be edited, the historical data is not going to track the change showing only the most recent information affecting the reliability of the past informations.

If a configuration specifies that a user's level changes upon reaching 10,000 points, the system will display this total in user orders. For example, if a user has 7,000 points, it will show "7,000 of 10,000."
However, if the overall point threshold is changed from 10,000 to 5,000, the system will also reference 5,000 for previous orders. This means the same user with 7,000 points would now see "7,000 of 5,000," which misrepresents their status. Since the point target does not retain historical data, it always reflects the current threshold, leading to potential confusion for support users.

Cost

Describe any additional cost this solution may imply.

Configuration

Is the same configuration of this documentation.

Metrics

This metric can be obtained through the number of tickets opened for the support team, particularly considering the duration of the tickets and whether a resolution was achieved on the first contact. And we can reach out to the agent support stakeholders and gather their feedback. The goal of this requirement is to streamline access to the customer's tier information, enabling the support user to resolve tickets more efficiently.

Delivery Plan

The delivery will be separate in two parts:

  1. Tier information on Customer Screen. [Solution] Admin tool - Add Customer Tier Information

  2. Tier information on Loyalty Transaction Screen, this screen we can see the Tier Point in each order.

QA Plan

Test Scenario

Expected Result

Test Scenario

Expected Result

if FF enable-customer-tier is disabled or enableLoyaltyTiers Flag Sanity is disabled

No Tier Information is showed

if FF enable-customer-tier is enabled AND enableLoyaltyTiers Flag Sanity is enabled

Show Tier information

If the user is Tier_1 (Normal Tier)

Show first level information label, icon, period and destination points

If the user is Tier_2 (Super Tier)

Show second level information label, icon, period and destination points

If the user moves from level 1 to level 2

Show second level information label, icon, period and destination points in the orders from Tier 2 period

Show first level information label, icon, period and destination points in the orders from Tier 1 period

If the user moves from level 2 to level 1

Show first level information label, icon, period and destination points in the orders from Tier 1 period

Show second level information label, icon, period and destination points in the orders from Tier 2 period

If the deadline expires, or the level changes

Level points need to change to 0

Call-outs

All information related to the Tier, both for users and the market, is sourced from the loyalty system. Thus, all calculations, date periods, and levels originate from this system, and in the admin app, these data will only be displayed, without any calculations or alterations to the values. If any value is being returned incorrectly, the issue should be addressed in the loyalty repository with the loyalty team.

Related content

[Solution] Admin tool - Add Customer Tier Information
[Solution] Admin tool - Add Customer Tier Information
More like this
[Solution] Ability to audit per store available and unavailable products (DOP)
[Solution] Ability to audit per store available and unavailable products (DOP)
Read with this
[Business Requirements] Admin tool - Add Customer Tier Information
[Business Requirements] Admin tool - Add Customer Tier Information
More like this
[Solution] Complete your menu (WIP)
[Solution] Complete your menu (WIP)
Read with this
Loyalty - display points history and origins
Loyalty - display points history and origins
More like this
[Opportunity] Complete your Menu
[Opportunity] Complete your Menu
Read with this