You can access the detailed problem statement and solution doc here.
/identity receives the HTTP POST requests with JSON body of the following format:
{
"email"?: string,
"phoneNumber"?: number
}
{
"contact":{
"primaryContactId": number,
"emails": string[], // first element being email of primary contact
"phoneNumbers": string[], // first element being phoneNumber of primary contact
"secondaryContactIds": number[] // Array of all Contact IDs that are "secondary" to the primary contact
}
}
{
id Int
phoneNumber String?
email String?
linkedId Int? // the ID of another Contact linked to this one
linkPrecedence "secondary"|"primary" // "primary" if it's the first Contact in the chain, otherwise "secondary"
createdAt DateTime
updatedAt DateTime
deletedAt DateTime?
}
{
"email": "muzaffar@hillvale.edu"
"phoneNumber": "123456"
}
and later came back to place another order with
{
"email": "naeem@hillvale.edu"
"phoneNumber": "123456"
}
{
id 1
phoneNumber "123456"
email "muzaffar@hillvale.edu"
linkedId null
linkPrecedence "primary"
createdAt 2024-04-01 00:00:00.374+00
updatedAt 2024-04-01 00:00:00.374+00
deletedAt null
},
{
id 23
phoneNumber "123456"
email "naeem@hillvale.edu"
linkedId 1
linkPrecedence "secondary"
createdAt 2024-04-20 05:30:00.11+00
updatedAt 2024-04-20 05:30:00.11+00
deletedAt null
}
{
"email": "naeem@hillvale.edu",
"phoneNumber": "123456"
}
will give the following response:
{
"contact":{
"primaryContactId": 1,
"emails": ["muzaffar@hillvale.edu","naeem@hillvale.edu"]
"phoneNumbers": ["123456"]
"secondaryContactIds": [23]
}
}
{
"phoneNumber":"123456"
}
{
"email": "muzaffar@hillvale.edu"
}
{
"email": "naeem@hillvale.edu"
}