Running here live on render π
- Database: PostgreSQL
- Backend Framework: NodeJS with Typescript
I had absolute fun solving this problem statement. Found couple of edge cases, have added conditions for them too. There's a basic input validation at start to check if both email and phonenumber is not null. And then a function to validate both email and phonenumber.
ββ dist
β βββ dbconf.js
β βββ index.js
β βββ types.js
βββ eslint.config.js
βββ package.json
βββ package-lock.json
βββ README.md
βββ src
β βββ dbconf.ts
β βββ index.ts
β βββ types.ts
βββ tsconfig.json
- /api/contacts - to return all contacts from FluxKart DB
- /api/identify - for identity reconcilation of FluxKart Customers
When creating a new contact using a secondary email or phone number, ensure that these details have not been used by the primary contact linked to this record.
-
Primary Contact
- Email:
[email protected]
- Phone Number:
123
- Email:
-
Secondary Contacts
- Email:
[email protected]
, Phone Number:789
- Email:
[email protected]
, Phone Number:789
- Email:
The goal is to manage cases where the secondary contactβs email or phone number overlaps with other contacts.