Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Endpoint for getting generic contact data #9206

Open
jkuester opened this issue Jun 24, 2024 · 0 comments
Open

API Endpoint for getting generic contact data #9206

jkuester opened this issue Jun 24, 2024 · 0 comments
Labels
Type: Feature Add something new

Comments

@jkuester
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Based on this discussion we should add a api/vi/contact endpoint (in addition to person and place) that will return return generic contact data (given the identifier for either a person or a place).

There are a number of situations in the CHT data model where one might have a contact identifier, but not know what type of contact it is associated with. (E.g. a report can be associated with a contact, but there is no guarantee if the contact is a person or a place).

Describe the solution you'd like
The api/vi/contact endpoint should support returning the full data for the person/place (implemented via cht-datasource) but under the generic Contact interface.

In cht-datasource we should move the Contact interface into a v1 namespace since it will be exposed as a first-class data type. We should also look at exporting some type assertion helper functions to confirm if a Contact is a Person or a Place.

Describe alternatives you've considered

  • Just not supporting getting generic contacts and trying to update the various places in the data-model to always know the type.
  • Add an endpoint for just getting the type of a contact (so you knew whether to get the entity from the person/place endpoint).
@jkuester jkuester added the Type: Feature Add something new label Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Add something new
Projects
None yet
Development

No branches or pull requests

1 participant