reapit / foundations

Foundations platform mono repo
57 stars 21 forks source link

Ability to search for Applicant by contact(s) #3403

Closed eazynow closed 3 years ago

eazynow commented 3 years ago

When a new applicant is added to Reapit, negotiators will search for any applicants that are active that match this new one to prevent duplicating contacts, or worse linking a new applicant to an old contact.

However, this is not currently possible by API without a number of API calls which is slow and expensive.

Current workaround

To do it right now I need to:

  1. Search for all active contacts with the same email address from the same office
  2. For each contact, get their relationships
  3. For each applicant relationship, compile a list of applicants
  4. Search applicants for active ones with this subset of applicant ID's
  5. Map that back internally to get a final list of relevant contacts

So 1 contact with 3 applicant records would take 6 API requests, 2 contacts would take 10, 3 would take 14 etc

Ideal solution

Add ability to search for applicant by contact email address (ideally) and/or an array of contact ID's.

cbryanreapit commented 3 years ago

To be broken down into two tickets and reviewed

cbryanreapit commented 3 years ago

Issue with preferred solution added https://github.com/reapit/foundations/issues/3515 - this ticket is superceded