...
Require the development of a new page in 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 to finding the right one cumbersome
POC
For this POC I changed the getByUserServiceLookup
to use the proposed structure:
intl-packages/src/user-lookup-by-phone/user-lookup-by-phone.ts
Code Block |
---|
public async getByUserServiceLookup(
phoneNumber: string,
): Promise<IUserLookupByPhone[] | undefined> {
const dynamoSearch = {
ExpressionAttributeValues: {
':pk2': `phone_lookup#${phoneNumber}`,
':sk2': 'createdAt#',
},
IndexName: 'brand-index-2',
KeyConditionExpression: 'pk2 = :pk2 AND begins_with(sk2, :sk2)',
TableName: this.tableName,
};
const { Items } = await this.executeWithRetry(DynamoMethods.query, dynamoSearch);
return Items ? Items.map((item) => cast(item, TUserLookupByPhone)) : undefined;
} |
And created 4 lookup records for 2 customers:
...
and was able to find the two customers when searching for the phone number +123123123:
...