maykinmedia / open-klant

Registratiecomponent voor de opslag en ontsluiting van klantgegevens volgens de Klantinteracties API-specificatie.
Other
2 stars 3 forks source link

Add a filter parameter to filter klantcontacten on a betrokkene's partij #256

Open swrichards opened 1 month ago

swrichards commented 1 month ago

Thema / Theme

Klantinteracties API

Omschrijving / Description

In addition to hadBetrokkene__uuid, and hadBetrokkene__url, add a new parameter hadBetrokkene__wasPartij__uuid to filter the klantcontacten list with reference to a specific Partij.

Toegevoegde waarde / Added value

"Give me all klantcontacten for a known Partij" is a common and obvious use-case, but currently has no easy path. You can either:

  1. Fetch all betrokkenen filtering by wasPartij__uuid, and then use the hadKlantcontact field to build up a list of klantcontacten. However, you then still have to fetch each klantcontact individually, which will require a lot of individual requests in order to build up the full list, which is undesirable.
  2. Fetch all klantcontacten with an expanded hadBetrokkenen.wasPartij and do the filtering by partij client-side. This is also undesirable, as you have to fetch the whole collection of klantcontacten to be sure all records for a particular Partij have been fetched.

Aanvullende opmerkingen / Additional context

No response