Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

This document is based on this ADR

Acceptance Criteria

Be able to search a customer using the loyalty ID and add a new line on search labels.

This should follow the user permissions, where users can search in countries where they are admins.

Examples

  • Admin user ESP, only can access ESP loyalty customers

  • Admin user ESP and PT, can access ESP and PT loyalty customers

image-20240606-193508.png

Figma

https://www.figma.com/design/Ti8Qr6jeSEPaencIDyYfcJ/branch/iS2eu3wihqpTUjXoJPXkbK/Burger-King?node-id=1218-356&t=EZP7GwsI6H6Bsmbn-0

Solution

Enhance the existing search bar on the home screen to accept the loyalty ID. Then create a new backend method to communicate with the loyalty API to get the customer cognito ID. With the cognito ID the Admin app can show the customer information correctly.

Tasks breakdown

Schemas/Customer

  • Update the Query with the new method customerByLoyaltyId and update graphQl queries

    image-20240521-201830.png

     

  • Create a new method customerByLoyaltyId inside the Query resolvers section (with the same signature and name of query above)

    image-20240521-200957.png

    and this is the loyalty response

    {
      "createdAt": "string",
      "id": "string",
      "name": "string",
      "updatedAt": "string",
      "clientUserId": "string",
      "dateOfBirth": "string",
      "email": "string",
      "emailVerified": true,
      "expirationBuckets": [
        {
          "expirationDate": "string",
          "pointsToExpire": 0
        }
      ],
      "loyaltyTier": {
        "loyaltyTierExpiryDate": "string",
        "loyaltyTierKey": "Tier_1",
        "pointsEarnedInTimeConstraint": 0,
        "startAt": "string"
      },
      "metadata": {
        "additionalProp1": "string",
        "additionalProp2": "string",
        "additionalProp3": "string"
      },
      "offerRedemptionAvailability": {
        "availableAfter": "string",
        "transactionId": "string"
      },
      "phoneNumber": "string",
      "phoneVerified": true,
      "points": 0,
      "pointsEarningDisabled": true,
      "pointsExpiryDateKey": "string"
    }
    • To get the User from Loyalty service, can be used this provider

    image-20240522-191903.png

 

queries/customers

Create a new query inside the customers queries

image-20240522-195309.png

Create a use query for consume the customerByLoyaltyId

image-20240522-194947.png

Add on the map section the new query

image-20240522-195002.png

universal-search/searchInstructions

Add new descriptions to this list for loyalty id

image-20240522-204049.png

The text for loyaltyId already exist in Lokalize, avoiding the necessity of create a new string text.

  • No labels