...
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
...
Figma
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.
Zenuml sequence macro lite | ||||||
---|---|---|---|---|---|---|
| ||||||
Tasks breakdown
Schemas/Customer
Update the Query with the new method customerByLoyaltyId and update graphQl queries
Create a new method customerByLoyaltyId inside the Query resolvers section (with the same signature and name of query above)
and this is the loyalty response
Code Block { "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
queries/customers
Create a new query inside the customers queries
...
hooks/use-universal-search
Create a use query for consume the customerByLoyaltyId
...
Add on the map section the new query
...
universal-search/searchInstructions
Add new descriptions to this list for loyalty id
...
The text for loyaltyId already exist in Lokalize, avoiding the necessity of create a new string text.