Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
This refinement details the necessary changes for the search by phone to work in admin tool documented in Search customer by phone in Admin App .
...
Commit an order with delivery.dropoff.phoneNumber +222222
Validate record in database
Searching phone in support tool
Customer details
Solution 2 [Preferred]
Solution 2 uses the same strategy as solution 1, the only difference is that it proposes to update the lookup record structure so that it can link multiple phone numbers to multiple customers. Below is a suggestion of the new record:
...
With these changes, the search by phone will return a list of customers instead of a single one and avoid the problem of manual record deletion that solution 1 requires. However, the support tool front end will have to be adapted so that customer support can choose which one they want to check, given the list of customers associated with that phone number. The front end design will have to be aligned with UI/UX team.
An important point is that customer support can differentiate which customer is the actual owner of the phone number. Phone verification is not enabled in Iberia right now, but the feature is expected to be activated in the following months.
Pros and cons
Pros
Search will work with both phone numbers included in the order or in the user account
Doesn’t require phone verification
This solution will be compatible with the Phone OTP
Doesn’t require migration scripts, the search will work as long as the user has made one order after the feature release
Allows the association of multiple phone numbers with multiple customers
...
Require the development of a new page in the support tool front end to select which customer they want to check
Although very unlikely, there is a scenario where a single phone number is linked to many customers and this might make the process of finding the right one cumbersome
POC
SearchByPhone POC:
For this POC I changed the getByUserServiceLookup
to use the proposed structure:
...
and was able to find the two customers when searching for the phone number +123123123:
...
Distinguish verified number POC:
To explicitly display which user is verified, we need to:
return phoneVerified in the Customer query from backend
check verified numbers and compare them with the searched text in the result.
intl-admin-app/src/components/layout/universal-search/index.tsx
Code Block | ||
---|---|---|
| ||
export const UniversalSearch = () => {
...
return (
<List>
...
{searchResults.map((result) => {
const customer = result as CustomerDetails;
const { phoneVerified, phoneNumber } = customer;
const isVerifiedUser = !!phoneVerified && searchTerm === phoneNumber;
return (
<SearchItem
item={result}
key={result.id}
onClick={handleSearchResultSelection}
isVerified={isVerifiedUser}
/>
);
}
</List>
)
} |
The code alterations above, plus altering SearchItem to change the text if the phone is verified we get:
...
Task breakdown
[intl-user-service]
...
Update customer query to also search by phone
Develop customer selection page
Update universal search to Include search by phone in search bar
include search by phone
in use-universal-search hook
add logic to explicitly show verified numbers