Necessary changes - summary
User Service API: Adapt GET user endpoint to also search by phone number
User Service API: Adapt the
create
method in user service to create alookupByPhoneNumber
record if a phone number is informedUser Service API: Adapt
update-user
lambda to update or create alookupByPhoneNumber
record if the phone number changedUser Service API: Add a
isPhoneNumberVerified
field tolookupByPhoneNumber
interface. This is important to avoid impacting https://rbictg.atlassian.net/wiki/spaces/EGMT/pages/4329078785/Solution+Phone+Number+Authentication+for+BK+SA#Customer-support-toolUser packages: Change
getByPhoneNumber
to use User Service API instead of directly accessing the databaseAdmin App Backend: Create a GraphQL query to request customers by phone number
Admin App Frontend: Add the option to search customers by phone using the new query
DynamoDB: Develop a migration script to create
lookupByPhoneNumber
for existing customers
Diagrams
Search customer by phone sequence diagram:
Necessary changes - details
intl-user-service
Include the
isVerified
field inIUserLookupByPhone
Interface: https://github.com/rbilabs/intl-user-service/blob/master/src/users/user-lookup-by-phone.repository.ts#L25-L30
export interface IUserLookupByPhone { pk: string; pk2: string; sk: string; sk2: string; isVerified: boolean; }
Create
lookupByPhoneNumber
record after creating the user in dynamo inside thepre-signup
lambda, but only if a phone number is informed: https://github.com/rbilabs/intl-user-service/blob/master/src/cognito-lambdas/pre-signup.service.ts#L135Update the
lookupByPhoneNumber
record if an user update is triggered and includes the phone number: https://github.com/rbilabs/intl-user-service/blob/master/src/users/update-comm-pref.service.ts#L150Adapt the get user endpoint to have an
phoneNumber
query field, that searches by phone: https://github.com/rbilabs/intl-user-service/blob/master/src/users/users.controller.ts#L124Create a LaunchDarkly Flag and request it via a backend query (https://github.com/rbilabs/intl-admin-app/blob/master/src/remote/queries/launch-darkly.ts )
intl-packages
Create the option to search
lookupByPhone
records created byuser-service
using the endpoint. Currently,getByEmail
already works this way (https://github.com/rbilabs/intl-packages/blob/master/packages/users/src/users.ts#L359).
This changes are already implemented in this git branch: https://github.com/rbilabs/intl-packages/pull/961
intl-admin-app
Create a GraphQL query that uses the
searchByPhone
method exposed by intl-packagesUpdate the UI to display the search by phone number option
These main changes are implemented in this git branch: https://github.com/rbilabs/intl-admin-app/pull/242
Add Comment