Skip to content

vidit21srivastava/identity-reconciliation

Repository files navigation

Identity Reconciliation

Tech Stack

Backend

Component Technology Version
Runtime Node.js ≥18.0.0
Language TypeScript 5.1.6
Framework Express.js 4.18.2
Database PostgreSQL 15
ORM Prisma 6.8.2
Security Helmet.js 7.0.0
Logging Morgan 1.10.0

Services

Component Service
Hosting Render Web Services
Database Render PostgreSQL
Version Control GitHub

Directory Tree

identity-reconciliation/
├── src/
│   ├── index.ts                    
│   ├── routes/
│   │   └── identity.ts             
│   ├── services/
│   │   └── identityService.ts      
│   ├── middleware/
│   │   ├── validation.ts           
│   │   └── errorHandler.ts         
│   └── types/
│       └── index.ts                
├── prisma/
│   └── schema.prisma               
├── .env.example                    
├── .gitignore                      
├── package.json                    
├── tsconfig.json                   
├── Dockerfile                     
└── README.md                       

Workflow

workings

API Documentation

Headers

All POST requests require

Content-Type: application/json

Health Check Endpoint

GET /health

Verifies service status and connectivity.

Health Check

Status Codes:

  • 200 - Service is healthy
  • 500 - Service error

Identity Reconciliation Endpoint

POST /identify

Main endpoint that processes contact information and returns consolidated customer data.

Success Status

Validation Rules:

  • At least one of email or phoneNumber must be provided
  • email must be valid email format (if provided)
  • phoneNumber must be non-empty string (if provided)
  • Both fields can be provided together

Success Response (200):

{
  "contact": {
    "primaryContactId": 1,
    "emails": ["user@example.com"],
    "phoneNumbers": ["1234567890"],
    "secondaryContactIds": []
  }
}

Error Response (400):

{
  "error": "Bad Request",
  "message": "At least one of email or phoneNumber must be provided"
}

Response Fields

Field Type Description
primaryContactId number ID of the primary contact
emails string[] All emails associated with this customer (primary first)
phoneNumbers string[] All phone numbers associated (primary first)
secondaryContactIds number[] IDs of all secondary contacts linked to primary

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published