While syncing students to Avni, students might go through the same flow multiple times. It is important to remove duplicates as much as possible. As one mechanism of preventing this, we can prevent those with the same business primary key from being registered more than once.
Acceptance criteria
When the integration service notices that the flow for a flow_result_id has already been processed by Avni, it is ignored by the service.
To decide if this has already been processed, we match the contact number, first name, last name, date of birth and gender with Avni to see if they already exist.
Tech details
first fetch all Students for "Contact.phoneNumber" using external-api (/api/subjects, with Concepts filter)
Iterate and filter out based on "First Name, Last Name, Father Name, DOB, Gender" values specified in flow_result (case insensitive lookup)
IF an entry exists, then this is a duplicate entry, ignore and move to next flow_result record
Else, as there are no entries that match this unique constraint, create a new student
Out of scope
Same student registering through multiple phone numbers. These will be treated as separate
Spelling mistakes in two different submissions from the same phone number. This will also be treated as separate
Background
While syncing students to Avni, students might go through the same flow multiple times. It is important to remove duplicates as much as possible. As one mechanism of preventing this, we can prevent those with the same business primary key from being registered more than once.
Acceptance criteria
When the integration service notices that the flow for a flow_result_id has already been processed by Avni, it is ignored by the service.
To decide if this has already been processed, we match the contact number, first name, last name, date of birth and gender with Avni to see if they already exist.
Tech details
Out of scope