Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
...
A phone number can only be associated with a single customer, which will be the first one to inform the number on the platform
There isn’t a simple way to delete the link between a user and a phone number recorded in a delivery order. One possibility is allowing customer support to remove the link via the support tool if it is outdated.
Implementation Proposal
Search by phone
The search will be implemented in the users service API, the NPM user package (represented as intl-packages below) exposes the client that admin app will use to make this request.
...
Create phone lookup records
The creation of the lookup records can be either synchronous or asynchronous, the two diagrams below details the different approaches:
asynchronous: since the commit order operation is already slow, this option minimizes possibly making it slower. [PREFERRED]
...
synchronous: simpler implementation
...
POC
The code below creates lookup records if they don’t exist when the order is committed.
...
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:
Infonote |
---|
We’ll need to implement checks to prevent the creation of multiple lookup records linking the same phone number and customer |
...
Task breakdown
[intl-user-service]
Refactor user-lookup-by-phone.repository to use both “UserPhone” and “UserPhoneLookUp” records
Since this impacts SA team, we need to ask their review as well
Update the lookup record structure to enable associating multiple phones and users
Develop create lookup records endpoint
Develop find by phone endpoint
...