From 3ec6e174492e0a83fa887657f66cbb592e147243 Mon Sep 17 00:00:00 2001 From: bart-maykin Date: Thu, 21 Nov 2024 12:56:20 +0100 Subject: [PATCH] :art: [#256] improved way we filter on urls in api queryparams --- .../api/filterset/digitaal_adres.py | 12 +- .../klantinteracties/api/filterset/filters.py | 16 ++ .../api/filterset/internetaken.py | 26 +- .../api/filterset/klantcontacten.py | 136 ++-------- .../api/filterset/partijen.py | 81 +----- .../api/tests/test_filters.py | 253 +++++++----------- .../components/klantinteracties/openapi.yaml | 48 ++-- 7 files changed, 183 insertions(+), 389 deletions(-) create mode 100644 src/openklant/components/klantinteracties/api/filterset/filters.py diff --git a/src/openklant/components/klantinteracties/api/filterset/digitaal_adres.py b/src/openklant/components/klantinteracties/api/filterset/digitaal_adres.py index 75afb499..6410360c 100644 --- a/src/openklant/components/klantinteracties/api/filterset/digitaal_adres.py +++ b/src/openklant/components/klantinteracties/api/filterset/digitaal_adres.py @@ -10,6 +10,8 @@ from openklant.components.klantinteracties.models.digitaal_adres import DigitaalAdres from openklant.components.utils.filters import ExpandFilter +from .filters import URLViewFilter + class DigitaalAdresDetailFilterSet(FilterSet): expand = ExpandFilter(serializer_class=DigitaalAdresSerializer) @@ -22,11 +24,11 @@ class DigitaalAdresFilterSet(FilterSet): ), field_name="betrokkene__uuid", ) - verstrekt_door_betrokkene__url = filters.CharFilter( + verstrekt_door_betrokkene__url = URLViewFilter( help_text=_( "Zoek digitaal adres(sen) object(en) op basis van de betrokkene url." ), - method="filter_betrokkene_url", + field_name="betrokkene__uuid", ) verstrekt_door_betrokkene__rol = filters.ChoiceFilter( help_text=_( @@ -36,11 +38,11 @@ class DigitaalAdresFilterSet(FilterSet): ) verstrekt_door_partij__uuid = filters.UUIDFilter( help_text=_("Zoek digitaal adres(sen) object(en) op basis van de partij uuid."), - field_name="betrokkene__uuid", + field_name="partij__uuid", ) - verstrekt_door_partij__url = filters.CharFilter( + verstrekt_door_partij__url = URLViewFilter( help_text=_("Zoek digitaal adres(sen) object(en) op basis van de partij url."), - method="filter_partij_url", + field_name="partij__uuid", ) verstrekt_door_partij__soort_partij = filters.ChoiceFilter( help_text=_( diff --git a/src/openklant/components/klantinteracties/api/filterset/filters.py b/src/openklant/components/klantinteracties/api/filterset/filters.py new file mode 100644 index 00000000..f0f820d5 --- /dev/null +++ b/src/openklant/components/klantinteracties/api/filterset/filters.py @@ -0,0 +1,16 @@ +import uuid + +from django import forms + +from django_filters.rest_framework import filters +from drf_spectacular.types import OpenApiTypes + + +class URLViewFilter(filters.Filter): + field_class = forms.URLField + + def filter(self, qs, value: OpenApiTypes.URI): + if value: + value = uuid.UUID(value.rstrip("/").split("/")[-1]) + + return super().filter(qs, value) diff --git a/src/openklant/components/klantinteracties/api/filterset/internetaken.py b/src/openklant/components/klantinteracties/api/filterset/internetaken.py index cb99d757..71b89d27 100644 --- a/src/openklant/components/klantinteracties/api/filterset/internetaken.py +++ b/src/openklant/components/klantinteracties/api/filterset/internetaken.py @@ -1,20 +1,20 @@ -import uuid - from django.utils.translation import gettext_lazy as _ from django_filters.rest_framework import FilterSet, filters from openklant.components.klantinteracties.models.internetaken import InterneTaak +from .filters import URLViewFilter + class InternetaakFilterSet(FilterSet): toegewezen_aan_actor__uuid = filters.UUIDFilter( help_text=_("Zoek internetaak object op basis van het toegewezen actor uuid."), field_name="actoren__uuid", ) - toegewezen_aan_actor__url = filters.CharFilter( + toegewezen_aan_actor__url = URLViewFilter( help_text=_("Zoek internetaak object op basis van het toegewezen actor url."), - method="filter_toegewezen_aan_actor_url", + field_name="actoren__uuid", ) aanleidinggevend_klantcontact__uuid = filters.UUIDFilter( help_text=_( @@ -22,11 +22,11 @@ class InternetaakFilterSet(FilterSet): ), field_name="klantcontact__uuid", ) - aanleidinggevend_klantcontact__url = filters.CharFilter( + aanleidinggevend_klantcontact__url = URLViewFilter( help_text=_( "Zoek internetaak object op basis van het aanleidingevende klantcontact url." ), - method="filter_aanleidinggevend_klantcontact_url", + field_name="klantcontact__uuid", ) class Meta: @@ -43,17 +43,3 @@ class Meta: "aanleidinggevend_klantcontact__uuid", "aanleidinggevend_klantcontact__url", ) - - def filter_toegewezen_aan_actor_url(self, queryset, name, value): - try: - url_uuid = uuid.UUID(value.rstrip("/").split("/")[-1]) - return queryset.filter(actoren__uuid=url_uuid) - except ValueError: - return queryset.none() - - def filter_aanleidinggevend_klantcontact_url(self, queryset, name, value): - try: - url_uuid = uuid.UUID(value.rstrip("/").split("/")[-1]) - return queryset.filter(klantcontact__uuid=url_uuid) - except ValueError: - return queryset.none() diff --git a/src/openklant/components/klantinteracties/api/filterset/klantcontacten.py b/src/openklant/components/klantinteracties/api/filterset/klantcontacten.py index 70d4e275..4242c006 100644 --- a/src/openklant/components/klantinteracties/api/filterset/klantcontacten.py +++ b/src/openklant/components/klantinteracties/api/filterset/klantcontacten.py @@ -1,5 +1,3 @@ -import uuid - from django.utils.translation import gettext_lazy as _ from django_filters.rest_framework import FilterSet, filters @@ -14,37 +12,39 @@ ) from openklant.components.utils.filters import ExpandFilter +from .filters import URLViewFilter + class KlantcontactDetailFilterSet(FilterSet): expand = ExpandFilter(serializer_class=KlantcontactSerializer) class KlantcontactFilterSet(FilterSet): - had_betrokkene__url = filters.CharFilter( + had_betrokkene__url = URLViewFilter( help_text=_("Zoek klantcontact object op basis van het betrokkene url."), - method="filter_betrokkene_url", + field_name="betrokkene__uuid", ) had_betrokkene__uuid = filters.UUIDFilter( help_text=_("Zoek klantcontact object op basis van het betrokkene uuid."), field_name="betrokkene__uuid", ) - had_betrokkene__was_partij__url = filters.CharFilter( + had_betrokkene__was_partij__url = URLViewFilter( help_text=_("Zoek klantcontact object op basis van de partij url."), - method="filter_partij_url", + field_name="betrokkene__partij__uuid", ) had_betrokkene__was_partij__uuid = filters.UUIDFilter( help_text=_("Zoek klantcontact object op basis van de partij uuid."), field_name="betrokkene__partij__uuid", ) - onderwerpobject__url = filters.CharFilter( + onderwerpobject__url = URLViewFilter( help_text=_("Zoek klantcontact object op basis van het onderwerpobject url."), - method="filter_onderwerpobject_url", + field_name="onderwerpobject__uuid", ) - was_onderwerpobject__url = filters.CharFilter( + was_onderwerpobject__url = URLViewFilter( help_text=_( "Zoek was klantcontact object op basis van het onderwerpobject url." ), - method="filter_was_onderwerpobject_url", + field_name="was_onderwerpobject__uuid", ) inhoud = filters.CharFilter( lookup_expr="icontains", @@ -85,72 +85,44 @@ class Meta: "plaatsgevonden_op", ) - def filter_betrokkene_url(self, queryset, name, value): - try: - url_uuid = uuid.UUID(value.rstrip("/").split("/")[-1]) - return queryset.filter(betrokkene__uuid=url_uuid) - except ValueError: - return queryset.none() - - def filter_partij_url(self, queryset, name, value): - try: - url_uuid = uuid.UUID(value.rstrip("/").split("/")[-1]) - return queryset.filter(betrokkene__partij__uuid=url_uuid) - except ValueError: - return queryset.none() - - def filter_onderwerpobject_url(self, queryset, name, value): - try: - url_uuid = uuid.UUID(value.rstrip("/").split("/")[-1]) - return queryset.filter(onderwerpobject__uuid=url_uuid) - except ValueError: - return queryset.none() - - def filter_was_onderwerpobject_url(self, queryset, name, value): - try: - url_uuid = uuid.UUID(value.rstrip("/").split("/")[-1]) - return queryset.filter(was_onderwerpobject__uuid=url_uuid) - except ValueError: - return queryset.none() - class BetrokkeneFilterSet(FilterSet): had_klantcontact__nummer = filters.CharFilter( help_text=_("Zoek betrokkene object op basis van het klantcontact nummer"), method="filter_had_klantcontact_nummer", ) - had_klantcontact__url = filters.CharFilter( + had_klantcontact__url = URLViewFilter( help_text=_("Zoek betrokkene object op basis van het klantcontact url"), - method="filter_had_klantcontact_url", + field_name="klantcontact__uuid", ) - had_klantcontact__uuid = filters.CharFilter( + had_klantcontact__uuid = filters.UUIDFilter( help_text=_("Zoek betrokkene object op basis van het klantcontact uuid"), - method="filter_had_klantcontact_uuid", + field_name="klantcontact__uuid", ) verstrektedigitaal_adres__adres = filters.CharFilter( help_text=_("Zoek betrokkene object op basis van het digitaaladres adres"), method="filter_digitaaladres_adres", ) - verstrektedigitaal_adres__url = filters.CharFilter( + verstrektedigitaal_adres__url = URLViewFilter( help_text=_("Zoek betrokkene object op basis van het digitaaladres url"), - method="filter_digitaaladres_url", + field_name="digitaaladres__uuid", ) - verstrektedigitaal_adres__uuid = filters.CharFilter( + verstrektedigitaal_adres__uuid = filters.UUIDFilter( help_text=_("Zoek betrokkene object op basis van het digitaaladres uuid"), - method="filter_digitaaladres_uuid", + field_name="digitaaladres__uuid", ) was_partij__nummer = filters.CharFilter( help_text=_("Zoek betrokkene object op basis van het partij nummer"), method="filter_partij_nummer", ) - was_partij__url = filters.CharFilter( + was_partij__url = URLViewFilter( help_text=_("Zoek betrokkene object op basis van het partij url"), - method="filter_partij_url", + field_name="partij__uuid", ) - was_partij__uuid = filters.CharFilter( + was_partij__uuid = filters.UUIDFilter( help_text=_("Zoek betrokkene object op basis van het partij uuid"), - method="filter_partij_uuid", + field_name="partij__uuid", ) class Meta: @@ -172,20 +144,6 @@ class Meta: "organisatienaam", ) - def filter_had_klantcontact_url(self, queryset, name, value): - try: - url_uuid = uuid.UUID(value.rstrip("/").split("/")[-1]) - return queryset.filter(klantcontact__uuid=url_uuid) - except ValueError: - return queryset.none() - - def filter_had_klantcontact_uuid(self, queryset, name, value): - try: - klantcontact_uuid = uuid.UUID(value) - return queryset.filter(klantcontact__uuid=klantcontact_uuid) - except ValueError: - return queryset.none() - def filter_had_klantcontact_nummer(self, queryset, name, value): try: return queryset.filter(klantcontact__nummer=value) @@ -195,48 +153,20 @@ def filter_had_klantcontact_nummer(self, queryset, name, value): def filter_digitaaladres_adres(self, queryset, name, value): return queryset.filter(digitaaladres__adres=value) - def filter_digitaaladres_url(self, queryset, name, value): - try: - url_uuid = uuid.UUID(value.rstrip("/").split("/")[-1]) - return queryset.filter(digitaaladres__uuid=url_uuid) - except ValueError: - return queryset.none() - - def filter_digitaaladres_uuid(self, queryset, name, value): - try: - digitaaladres_uuid = uuid.UUID(value) - return queryset.filter(digitaaladres__uuid=digitaaladres_uuid) - except ValueError: - return queryset.none() - def filter_partij_nummer(self, queryset, name, value): return queryset.filter(partij__nummer=value) - def filter_partij_url(self, queryset, name, value): - try: - url_uuid = uuid.UUID(value.rstrip("/").split("/")[-1]) - return queryset.filter(partij__uuid=url_uuid) - except ValueError: - return queryset.none() - - def filter_partij_uuid(self, queryset, name, value): - try: - partij_uuid = uuid.UUID(value) - return queryset.filter(partij__uuid=partij_uuid) - except ValueError: - return queryset.none() - class ActorKlantcontactFilterSet(FilterSet): - actor__url = filters.CharFilter( + actor__url = URLViewFilter( help_text=_("Zoek actor klantcontract object op basis van het actor url"), - method="filter_actor_url", + field_name="actor__uuid", ) - klantcontact__url = filters.CharFilter( + klantcontact__url = URLViewFilter( help_text=_( "Zoek actor klantcontract object op basis van het klantcontact url" ), - method="filter_klantcontact_url", + field_name="klantcontact__uuid", ) class Meta: @@ -247,17 +177,3 @@ class Meta: "klantcontact__uuid", "klantcontact__url", ) - - def filter_actor_url(self, queryset, name, value): - try: - url_uuid = uuid.UUID(value.rstrip("/").split("/")[-1]) - return queryset.filter(actor__uuid=url_uuid) - except ValueError: - return queryset.none() - - def filter_klantcontact_url(self, queryset, name, value): - try: - url_uuid = uuid.UUID(value.rstrip("/").split("/")[-1]) - return queryset.filter(klantcontact__uuid=url_uuid) - except ValueError: - return queryset.none() diff --git a/src/openklant/components/klantinteracties/api/filterset/partijen.py b/src/openklant/components/klantinteracties/api/filterset/partijen.py index 2c59471c..c311781d 100644 --- a/src/openklant/components/klantinteracties/api/filterset/partijen.py +++ b/src/openklant/components/klantinteracties/api/filterset/partijen.py @@ -1,5 +1,3 @@ -import uuid - from django.utils.translation import gettext_lazy as _ from django_filters.rest_framework import FilterSet, filters @@ -14,6 +12,8 @@ ) from openklant.components.utils.filters import ExpandFilter +from .filters import URLViewFilter + class PartijDetailFilterSet(FilterSet): expand = ExpandFilter(serializer_class=PartijSerializer) @@ -26,11 +26,11 @@ class PartijFilterSet(FilterSet): ), field_name="vertegenwoordigde__vertegenwoordigende_partij__uuid", ) - vertegenwoordigde_partij__url = filters.CharFilter( + vertegenwoordigde_partij__url = URLViewFilter( help_text=_( "Zoek partij object op basis van het vertegenwoordigde partij url." ), - method="filter_vertegenwoordigde_partij_url", + field_name="vertegenwoordigde__vertegenwoordigende_partij__uuid", ) partij_identificator__code_objecttype = filters.CharFilter( help_text=_( @@ -90,15 +90,6 @@ class Meta: "correspondentieadres_land", ) - def filter_vertegenwoordigde_partij_url(self, queryset, name, value): - try: - url_uuid = uuid.UUID(value.rstrip("/").split("/")[-1]) - return queryset.filter( - vertegenwoordigde__vertegenwoordigende_partij__uuid=url_uuid - ) - except ValueError: - return queryset.none() - def filter_identificator_code_objecttype(self, queryset, name, value): try: return queryset.filter( @@ -142,17 +133,17 @@ def filter_categorierelatie_categorie_naam(self, queryset, name, value): class VertegenwoordigdenFilterSet(FilterSet): - vertegenwoordigende_partij__url = filters.CharFilter( + vertegenwoordigende_partij__url = URLViewFilter( help_text=_( "Zoek Vertegenwoordigden object op basis van het vertegenwoordigende partij url." ), - method="filter_vertegenwoordigende_partij_url", + field_name="vertegenwoordigende_partij__uuid", ) - vertegenwoordigde_partij__url = filters.CharFilter( + vertegenwoordigde_partij__url = URLViewFilter( help_text=_( "Zoek Vertegenwoordigden object op basis van het vertegenwoordigde partij url." ), - method="filter_vertegenwoordigde_partij_url", + field_name="vertegenwoordigde_partij__uuid", ) class Meta: @@ -164,29 +155,14 @@ class Meta: "vertegenwoordigde_partij__url", ) - def filter_vertegenwoordigende_partij_url(self, queryset, name, value): - try: - url_uuid = uuid.UUID(value.rstrip("/").split("/")[-1]) - return queryset.filter(vertegenwoordigende_partij__uuid=url_uuid) - except ValueError: - return queryset.none() - - def filter_vertegenwoordigde_partij_url(self, queryset, name, value): - try: - url_uuid = uuid.UUID(value.rstrip("/").split("/")[-1]) - return queryset.filter(vertegenwoordigde_partij__uuid=url_uuid) - except ValueError: - return queryset.none() - class CategorieRelatieFilterSet(FilterSet): - partij__url = filters.CharFilter( + partij__url = URLViewFilter( help_text=_("Zoek categorie relatie object op basis van de partij url."), - method="filter_partij_url", + field_name="partij__uuid", ) - partij__uuid = filters.CharFilter( + partij__uuid = filters.UUIDFilter( help_text=_("Zoek categorie relatie object op basis van de partij uuid."), - method="filter_partij_uuid", ) partij__nummer = filters.CharFilter( help_text=_("Zoek categorie relatie object op basis van het partij nummer."), @@ -196,13 +172,12 @@ class CategorieRelatieFilterSet(FilterSet): help_text=_("Zoek categorie relatie object op basis van de categorie naam."), method="filter_categorie_naam", ) - categorie__uuid = filters.CharFilter( + categorie__uuid = filters.UUIDFilter( help_text=_("Zoek categorie relatie object op basis van de categorie uuid."), - method="filter_categorie_uuid", ) - categorie__url = filters.CharFilter( + categorie__url = URLViewFilter( help_text=_("Zoek categorie relatie object op basis van de categorie url."), - method="filter_categorie_url", + field_name="categorie__uuid", ) class Meta: @@ -218,40 +193,12 @@ class Meta: "eind_datum", ) - def filter_partij_uuid(self, queryset, name, value): - try: - partij_uuid = uuid.UUID(value) - return queryset.filter(partij__uuid=partij_uuid) - except ValueError: - return queryset.none() - - def filter_partij_url(self, queryset, name, value): - try: - url_uuid = uuid.UUID(value.rstrip("/").split("/")[-1]) - return queryset.filter(partij__uuid=url_uuid) - except ValueError: - return queryset.none() - def filter_partij_nummer(self, queryset, name, value): try: return queryset.filter(partij__nummer=value) except ValueError: return queryset.none() - def filter_categorie_uuid(self, queryset, name, value): - try: - categorie_uuid = uuid.UUID(value) - return queryset.filter(categorie__uuid=categorie_uuid) - except ValueError: - return queryset.none() - - def filter_categorie_url(self, queryset, name, value): - try: - url_uuid = uuid.UUID(value.rstrip("/").split("/")[-1]) - return queryset.filter(categorie__uuid=url_uuid) - except ValueError: - return queryset.none() - def filter_categorie_naam(self, queryset, name, value): try: return queryset.filter(categorie__naam=value) diff --git a/src/openklant/components/klantinteracties/api/tests/test_filters.py b/src/openklant/components/klantinteracties/api/tests/test_filters.py index 9788911b..6e4f36c0 100644 --- a/src/openklant/components/klantinteracties/api/tests/test_filters.py +++ b/src/openklant/components/klantinteracties/api/tests/test_filters.py @@ -108,9 +108,7 @@ def setUp(self): ) def test_filter_partij_url(self): - partij_url = ( - f"http://testserver/klantinteracties/api/v1/klantcontact/{self.partij.uuid}" - ) + partij_url = f"https://testserver.com/klantinteracties/api/v1/klantcontact/{self.partij.uuid}" response = self.client.get( self.url, {"hadBetrokkene__wasPartij__url": partij_url}, @@ -121,28 +119,23 @@ def test_filter_partij_url(self): self.assertEqual(str(self.klantcontact.uuid), data[0]["uuid"]) with self.subTest("no_matches_found_return_nothing"): + url = f"https://testserver.com/klantinteracties/api/v1/klantcontact/{str(uuid4())}" response = self.client.get( self.url, - { - "hadBetrokkene__url": f"http://testserver/klantinteracties/api/v1/klantcontact/{str(uuid4())}" - }, + {"hadBetrokkene__wasPartij__url": url}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.json()["count"], 0) - with self.subTest("invalid_value_returns_empty_query"): + with self.subTest("invalid_url_results_in_400"): response = self.client.get(self.url, {"hadBetrokkene__url": "ValueError"}) - self.assertEqual(response.status_code, status.HTTP_200_OK) - - self.assertEqual(response.json()["count"], 0) + self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_filter_partij_uuid(self): response = self.client.get( self.url, - { - "hadBetrokkene__wasPartij__uuid": str(self.partij.uuid) - }, + {"hadBetrokkene__wasPartij__uuid": str(self.partij.uuid)}, ) data = response.json()["results"] @@ -150,11 +143,10 @@ def test_filter_partij_uuid(self): self.assertEqual(str(self.klantcontact.uuid), data[0]["uuid"]) def test_filter_betrokkene_url(self): + url = f"https://testserver.com/klantinteracties/api/v1/klantcontact/{self.betrokkene.uuid}" response = self.client.get( self.url, - { - "hadBetrokkene__url": f"http://testserver/klantinteracties/api/v1/klantcontact/{self.betrokkene.uuid}" - }, + {"hadBetrokkene__url": url}, ) data = response.json()["results"] @@ -165,21 +157,19 @@ def test_filter_betrokkene_url(self): response = self.client.get( self.url, { - "hadBetrokkene__url": f"http://testserver/klantinteracties/api/v1/klantcontact/{str(uuid4())}" + "hadBetrokkene__url": f"https://testserver.com/klantinteracties/api/v1/klantcontact/{str(uuid4())}" }, ) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.json()["count"], 0) - with self.subTest("invalid_value_returns_empty_query"): + with self.subTest("invalid_url_results_in_400"): response = self.client.get(self.url, {"hadBetrokkene__url": "ValueError"}) - self.assertEqual(response.status_code, status.HTTP_200_OK) - - self.assertEqual(response.json()["count"], 0) + self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_filter_onderwerpobject__url(self): - url = f"http://testserver/klantinteracties/api/v1/onderwerpobjecten/{self.onderwerpobject5.uuid}" + url = f"https://testserver.com/klantinteracties/api/v1/onderwerpobjecten/{self.onderwerpobject5.uuid}" response = self.client.get( self.url, {"onderwerpobject__url": url}, @@ -190,7 +180,7 @@ def test_filter_onderwerpobject__url(self): self.assertEqual(str(self.klantcontact5.uuid), data[0]["uuid"]) with self.subTest("no_matches_found_return_nothing"): - url = f"http://testserver/klantinteracties/api/v1/onderwerpobjecten/{str(uuid4())}" + url = f"https://testserver.com/klantinteracties/api/v1/onderwerpobjecten/{str(uuid4())}" response = self.client.get( self.url, {"onderwerpobject__url": url}, @@ -199,14 +189,12 @@ def test_filter_onderwerpobject__url(self): self.assertEqual(response.json()["count"], 0) - with self.subTest("invalid_value_returns_empty_query"): + with self.subTest("invalid_url_results_in_400"): response = self.client.get(self.url, {"onderwerpobject__url": "ValueError"}) - self.assertEqual(response.status_code, status.HTTP_200_OK) - - self.assertEqual(response.json()["count"], 0) + self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_filter_was_onderwerpobject__url(self): - url = f"http://testserver/klantinteracties/api/v1/onderwerpobjecten/{self.onderwerpobject5.uuid}" + url = f"https://testserver.com/klantinteracties/api/v1/onderwerpobjecten/{self.onderwerpobject5.uuid}" response = self.client.get( self.url, {"wasOnderwerpobject__url": url}, @@ -217,7 +205,7 @@ def test_filter_was_onderwerpobject__url(self): self.assertEqual(str(self.klantcontact4.uuid), data[0]["uuid"]) with self.subTest("no_matches_found_return_nothing"): - url = f"http://testserver/klantinteracties/api/v1/onderwerpobjecten/{str(uuid4())}" + url = f"https://testserver.com/klantinteracties/api/v1/onderwerpobjecten/{str(uuid4())}" response = self.client.get( self.url, {"wasOnderwerpobject__url": url}, @@ -226,13 +214,11 @@ def test_filter_was_onderwerpobject__url(self): self.assertEqual(response.json()["count"], 0) - with self.subTest("invalid_value_returns_empty_query"): + with self.subTest("invalid_url_results_in_400"): response = self.client.get( self.url, {"wasOnderwerpobject__url": "ValueError"} ) - self.assertEqual(response.status_code, status.HTTP_200_OK) - - self.assertEqual(response.json()["count"], 0) + self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) class BetrokkeneFilterSetTests(APITestCase): @@ -266,7 +252,7 @@ def setUp(self): DigitaalAdresFactory.create(betrokkene=betrokkene5) def test_filter_had_klantcontact_url(self): - klantcontact_url = f"http://testserver/klantinteracties/api/v1/klantcontact/{self.klantcontact.uuid}" + klantcontact_url = f"https://testserver.com/klantinteracties/api/v1/klantcontact/{self.klantcontact.uuid}" response = self.client.get( self.url, {"hadKlantcontact__url": klantcontact_url}, @@ -279,21 +265,18 @@ def test_filter_had_klantcontact_url(self): self.assertEqual(str(self.betrokkene.uuid), data[0]["uuid"]) with self.subTest("no_matches_found_return_nothing"): + url = f"https://testserver.com/klantinteracties/api/v1/klantcontact/{str(uuid4())}" response = self.client.get( self.url, - { - "hadKlantcontact__url": f"http://testserver/klantinteracties/api/v1/klantcontact/{str(uuid4())}" - }, + {"hadKlantcontact__url": url}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.json()["count"], 0) - with self.subTest("invalid_value_returns_empty_query"): + with self.subTest("invalid_url_results_in_400"): response = self.client.get(self.url, {"hadKlantcontact__url": "ValueError"}) - self.assertEqual(response.status_code, status.HTTP_200_OK) - - self.assertEqual(response.json()["count"], 0) + self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_filter_had_klantcontact_uuid(self): response = self.client.get( @@ -316,13 +299,11 @@ def test_filter_had_klantcontact_uuid(self): self.assertEqual(response.json()["count"], 0) - with self.subTest("invalid_value_returns_empty_query"): + with self.subTest("invalid_url_results_in_400"): response = self.client.get( self.url, {"hadKlantcontact__uuid": "ValueError"} ) - self.assertEqual(response.status_code, status.HTTP_200_OK) - - self.assertEqual(response.json()["count"], 0) + self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_filter_had_klantcontact_nummer(self): response = self.client.get( @@ -346,10 +327,10 @@ def test_filter_had_klantcontact_nummer(self): self.assertEqual(response.json()["count"], 0) def test_filter_verstrektedigitaal_adres_url(self): - digitaal_adres_url = f"http://testserver/klantinteracties/api/v1/digitaal_adres/{self.digitaal_adres.uuid}" + url = f"https://testserver.com/klantinteracties/api/v1/digitaal_adres/{self.digitaal_adres.uuid}" response = self.client.get( self.url, - {"verstrektedigitaalAdres__url": digitaal_adres_url}, + {"verstrektedigitaalAdres__url": url}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -359,7 +340,7 @@ def test_filter_verstrektedigitaal_adres_url(self): self.assertEqual(str(self.betrokkene.uuid), data[0]["uuid"]) with self.subTest("no_matches_found_return_nothing"): - none_existing_url = f"http://testserver/klantinteracties/api/v1/digitaal_adres/{str(uuid4())}" + none_existing_url = f"https://testserver.com/klantinteracties/api/v1/digitaal_adres/{str(uuid4())}" response = self.client.get( self.url, {"verstrektedigitaalAdres__url": none_existing_url}, @@ -368,13 +349,11 @@ def test_filter_verstrektedigitaal_adres_url(self): self.assertEqual(response.json()["count"], 0) - with self.subTest("invalid_value_returns_empty_query"): + with self.subTest("invalid_url_results_in_400"): response = self.client.get( self.url, {"verstrektedigitaalAdres__url": "ValueError"} ) - self.assertEqual(response.status_code, status.HTTP_200_OK) - - self.assertEqual(response.json()["count"], 0) + self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_filter_verstrektedigitaal_adres_uuid(self): response = self.client.get( @@ -397,13 +376,11 @@ def test_filter_verstrektedigitaal_adres_uuid(self): self.assertEqual(response.json()["count"], 0) - with self.subTest("invalid_value_returns_empty_query"): + with self.subTest("invalid_url_results_in_400"): response = self.client.get( self.url, {"verstrektedigitaalAdres__uuid": "ValueError"} ) - self.assertEqual(response.status_code, status.HTTP_200_OK) - - self.assertEqual(response.json()["count"], 0) + self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_filter_verstrektedigitaal_adres_adres(self): response = self.client.get( @@ -430,7 +407,7 @@ def test_filter_was_partij_url(self): response = self.client.get( self.url, { - "wasPartij__url": f"http://testserver/klantinteracties/api/v1/partij/{self.partij.uuid}" + "wasPartij__url": f"https://testserver.com/klantinteracties/api/v1/partij/{self.partij.uuid}" }, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -444,18 +421,16 @@ def test_filter_was_partij_url(self): response = self.client.get( self.url, { - "wasPartij__url": f"http://testserver/klantinteracties/api/v1/partij/{str(uuid4())}" + "wasPartij__url": f"https://testserver.com/klantinteracties/api/v1/partij/{str(uuid4())}" }, ) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.json()["count"], 0) - with self.subTest("invalid_value_returns_empty_query"): + with self.subTest("invalid_url_results_in_400"): response = self.client.get(self.url, {"wasPartij__url": "ValueError"}) - self.assertEqual(response.status_code, status.HTTP_200_OK) - - self.assertEqual(response.json()["count"], 0) + self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_filter_was_partij_uuid(self): response = self.client.get( @@ -478,11 +453,9 @@ def test_filter_was_partij_uuid(self): self.assertEqual(response.json()["count"], 0) - with self.subTest("invalid_value_returns_empty_query"): + with self.subTest("invalid_url_results_in_400"): response = self.client.get(self.url, {"wasPartij__uuid": "ValueError"}) - self.assertEqual(response.status_code, status.HTTP_200_OK) - - self.assertEqual(response.json()["count"], 0) + self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_filter_was_partij_nummer(self): response = self.client.get( @@ -576,7 +549,7 @@ def setUp(self): ) def test_filter_vertegenwoordigde_partij_url(self): - partij_url = f"http://testserver/klantinteracties/api/v1/partijen/{str(self.partij5.uuid)}" + partij_url = f"https://testserver.com/klantinteracties/api/v1/partijen/{str(self.partij5.uuid)}" response = self.client.get( self.url, {"vertegenwoordigdePartij__url": partij_url} ) @@ -588,9 +561,7 @@ def test_filter_vertegenwoordigde_partij_url(self): self.assertEqual(str(self.partij.uuid), data[0]["uuid"]) with self.subTest("no_matches_found_return_nothing"): - partij_url = ( - f"http://testserver/klantinteracties/api/v1/partijen/{str(uuid4())}" - ) + partij_url = f"https://testserver.com/klantinteracties/api/v1/partijen/{str(uuid4())}" response = self.client.get( self.url, {"vertegenwoordigdePartij__url": partij_url}, @@ -599,13 +570,11 @@ def test_filter_vertegenwoordigde_partij_url(self): self.assertEqual(response.json()["count"], 0) - with self.subTest("invalid_value_returns_empty_query"): + with self.subTest("invalid_url_results_in_400"): response = self.client.get( self.url, {"vertegenwoordigdePartij__url": "ValueError"} ) - self.assertEqual(response.status_code, status.HTTP_200_OK) - - self.assertEqual(response.json()["count"], 0) + self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_filter_partij_identificator_nummer(self): response = self.client.get( @@ -768,7 +737,7 @@ def setUp(self): ) def test_filter_partij_url(self): - partij_url = f"http://testserver/klantinteracties/api/v1/partijen/{str(self.partij5.uuid)}" + partij_url = f"https://testserver.com/klantinteracties/api/v1/partijen/{str(self.partij5.uuid)}" response = self.client.get(self.url, {"partij__url": partij_url}) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -781,18 +750,16 @@ def test_filter_partij_url(self): response = self.client.get( self.url, { - "partij__url": f"http://testserver/klantinteracties/api/v1/partijen/{str(uuid4())}" + "partij__url": f"https://testserver.com/klantinteracties/api/v1/partijen/{str(uuid4())}" }, ) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.json()["count"], 0) - with self.subTest("invalid_value_returns_empty_query"): + with self.subTest("invalid_url_results_in_400"): response = self.client.get(self.url, {"partij__url": "ValueError"}) - self.assertEqual(response.status_code, status.HTTP_200_OK) - - self.assertEqual(response.json()["count"], 0) + self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_filter_partij_uuid(self): response = self.client.get( @@ -815,11 +782,9 @@ def test_filter_partij_uuid(self): self.assertEqual(response.json()["count"], 0) - with self.subTest("invalid_value_returns_empty_query"): + with self.subTest("invalid_url_results_in_400"): response = self.client.get(self.url, {"partij__uuid": "ValueError"}) - self.assertEqual(response.status_code, status.HTTP_200_OK) - - self.assertEqual(response.json()["count"], 0) + self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_filter_partij_nummer(self): response = self.client.get( @@ -843,7 +808,7 @@ def test_filter_partij_nummer(self): self.assertEqual(response.json()["count"], 0) def test_filter_categorie_url(self): - categorie_url = f"http://testserver/klantinteracties/api/v1/categorieen/{str(self.categorie5.uuid)}" + categorie_url = f"https://testserver.com/klantinteracties/api/v1/categorieen/{str(self.categorie5.uuid)}" response = self.client.get(self.url, {"categorie__url": categorie_url}) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -856,18 +821,16 @@ def test_filter_categorie_url(self): response = self.client.get( self.url, { - "categorie__url": f"http://testserver/klantinteracties/api/v1/categorieen/{str(uuid4())}" + "categorie__url": f"https://testserver.com/klantinteracties/api/v1/categorieen/{str(uuid4())}" }, ) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.json()["count"], 0) - with self.subTest("invalid_value_returns_empty_query"): + with self.subTest("invalid_url_results_in_400"): response = self.client.get(self.url, {"categorie__url": "ValueError"}) - self.assertEqual(response.status_code, status.HTTP_200_OK) - - self.assertEqual(response.json()["count"], 0) + self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_filter_categorie_uuid(self): response = self.client.get( @@ -890,11 +853,9 @@ def test_filter_categorie_uuid(self): self.assertEqual(response.json()["count"], 0) - with self.subTest("invalid_value_returns_empty_query"): + with self.subTest("invalid_url_results_in_400"): response = self.client.get(self.url, {"categorie__uuid": "ValueError"}) - self.assertEqual(response.status_code, status.HTTP_200_OK) - - self.assertEqual(response.json()["count"], 0) + self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_filter_categorie_naam(self): response = self.client.get( @@ -955,8 +916,8 @@ def setUp(self): ) def test_filter_klantcontact_url(self): - klantcontact_url = f"http://testserver/klantinteracties/api/v1/klantcontacten/{str(self.klantcontact5.uuid)}" - response = self.client.get(self.url, {"klantcontact__url": klantcontact_url}) + url = f"https://testserver.com/klantinteracties/api/v1/klantcontacten/{str(self.klantcontact5.uuid)}" + response = self.client.get(self.url, {"klantcontact__url": url}) self.assertEqual(response.status_code, status.HTTP_200_OK) data = response.json()["results"] @@ -965,26 +926,21 @@ def test_filter_klantcontact_url(self): self.assertEqual(str(self.actor_klantcontact5.uuid), data[0]["uuid"]) with self.subTest("no_matches_found_return_nothing"): + url = f"https://testserver.com/klantinteracties/api/v1/klantcontacten/{str(uuid4())}" response = self.client.get( self.url, - { - "klantcontact__url": f"http://testserver/klantinteracties/api/v1/klantcontacten/{str(uuid4())}" - }, + {"klantcontact__url": url}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.json()["count"], 0) - with self.subTest("invalid_value_returns_empty_query"): + with self.subTest("invalid_url_results_in_400"): response = self.client.get(self.url, {"klantcontact__url": "ValueError"}) - self.assertEqual(response.status_code, status.HTTP_200_OK) - - self.assertEqual(response.json()["count"], 0) + self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_filter_actor_url(self): - actor_url = ( - f"http://testserver/klantinteracties/api/v1/actoren/{str(self.actor5.uuid)}" - ) + actor_url = f"https://testserver.com/klantinteracties/api/v1/actoren/{str(self.actor5.uuid)}" response = self.client.get(self.url, {"actor__url": actor_url}) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -997,18 +953,16 @@ def test_filter_actor_url(self): response = self.client.get( self.url, { - "actor__url": f"http://testserver/klantinteracties/api/v1/klantcontacten/{str(uuid4())}" + "actor__url": f"https://testserver.com/klantinteracties/api/v1/klantcontacten/{str(uuid4())}" }, ) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.json()["count"], 0) - with self.subTest("invalid_value_returns_empty_query"): + with self.subTest("invalid_url_results_in_400"): response = self.client.get(self.url, {"actor__url": "ValueError"}) - self.assertEqual(response.status_code, status.HTTP_200_OK) - - self.assertEqual(response.json()["count"], 0) + self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) class VertegenwoordigdenFiltersetTests(APITestCase): @@ -1044,7 +998,7 @@ def setUp(self): ) def test_filter_vertegenwoordigende_partij_url(self): - partij_url = f"http://testserver/klantinteracties/api/v1/partijen/{str(self.partij5.uuid)}" + partij_url = f"https://testserver.com/klantinteracties/api/v1/partijen/{str(self.partij5.uuid)}" response = self.client.get( self.url, {"vertegenwoordigendePartij__url": partij_url} ) @@ -1056,27 +1010,21 @@ def test_filter_vertegenwoordigende_partij_url(self): self.assertEqual(str(self.vertegenwoordigde5.uuid), data[0]["uuid"]) with self.subTest("no_matches_found_return_nothing"): - vertegenwoordigde_partij_url = ( - f"http://testserver/klantinteracties/api/v1/partijen/{str(uuid4())}" - ) + vertegenwoordigde_partij_url = f"https://testserver.com/klantinteracties/api/v1/partijen/{str(uuid4())}" response = self.client.get( self.url, {"vertegenwoordigendePartij__url": vertegenwoordigde_partij_url}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) - self.assertEqual(response.json()["count"], 0) - - with self.subTest("invalid_value_returns_empty_query"): + with self.subTest("invalid_url_results_in_400"): response = self.client.get( self.url, {"vertegenwoordigendePartij__url": "ValueError"} ) - self.assertEqual(response.status_code, status.HTTP_200_OK) - - self.assertEqual(response.json()["count"], 0) + self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_filter_vertegenwoordigde_partij_url(self): - partij_url = f"http://testserver/klantinteracties/api/v1/partijen/{str(self.partij5.uuid)}" + partij_url = f"https://testserver.com/klantinteracties/api/v1/partijen/{str(self.partij5.uuid)}" response = self.client.get( self.url, {"vertegenwoordigdePartij__url": partij_url} ) @@ -1088,9 +1036,7 @@ def test_filter_vertegenwoordigde_partij_url(self): self.assertEqual(str(self.vertegenwoordigde4.uuid), data[0]["uuid"]) with self.subTest("no_matches_found_return_nothing"): - partij_url = ( - f"http://testserver/klantinteracties/api/v1/partijen/{str(uuid4())}" - ) + partij_url = f"https://testserver.com/klantinteracties/api/v1/partijen/{str(uuid4())}" response = self.client.get( self.url, {"vertegenwoordigdePartij__url": partij_url}, @@ -1099,13 +1045,11 @@ def test_filter_vertegenwoordigde_partij_url(self): self.assertEqual(response.json()["count"], 0) - with self.subTest("invalid_value_returns_empty_query"): + with self.subTest("invalid_url_results_in_400"): response = self.client.get( self.url, {"vertegenwoordigdePartij__url": "ValueError"} ) - self.assertEqual(response.status_code, status.HTTP_200_OK) - - self.assertEqual(response.json()["count"], 0) + self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) class InterneTaakFilterSetTests(APITestCase): @@ -1144,9 +1088,7 @@ def setUp(self): ) def test_filter_toegewezen_aan_actor_url(self): - actor_url = ( - f"http://testserver/klantinteracties/api/v1/actoren/{str(self.actor5.uuid)}" - ) + actor_url = f"https://testserver.com/klantinteracties/api/v1/actoren/{str(self.actor5.uuid)}" response = self.client.get(self.url, {"toegewezenAanActor__url": actor_url}) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -1159,26 +1101,22 @@ def test_filter_toegewezen_aan_actor_url(self): response = self.client.get( self.url, { - "toegewezenAanActor__url": f"http://testserver/klantinteracties/api/v1/actoren/{str(uuid4())}" + "toegewezenAanActor__url": f"https://testserver.com/klantinteracties/api/v1/actoren/{str(uuid4())}" }, ) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.json()["count"], 0) - with self.subTest("invalid_value_returns_empty_query"): + with self.subTest("invalid_url_results_in_400"): response = self.client.get( self.url, {"toegewezenAanActor__url": "ValueError"} ) - self.assertEqual(response.status_code, status.HTTP_200_OK) - - self.assertEqual(response.json()["count"], 0) + self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_filter_aanleidinggevend_klantcontact_url(self): - klantcontact_url = f"http://testserver/klantinteracties/api/v1/klantcontacten/{str(self.klantcontact5.uuid)}" - response = self.client.get( - self.url, {"aanleidinggevendKlantcontact__url": klantcontact_url} - ) + url = f"https://testserver.com/klantinteracties/api/v1/klantcontacten/{str(self.klantcontact5.uuid)}" + response = self.client.get(self.url, {"aanleidinggevendKlantcontact__url": url}) self.assertEqual(response.status_code, status.HTTP_200_OK) data = response.json()["results"] @@ -1187,7 +1125,7 @@ def test_filter_aanleidinggevend_klantcontact_url(self): self.assertEqual(str(self.internetaak5.uuid), data[0]["uuid"]) with self.subTest("no_matches_found_return_nothing"): - klantcontacten_url = f"http://testserver/klantinteracties/api/v1/klantcontacten/{str(uuid4())}" + klantcontacten_url = f"https://testserver.com/klantinteracties/api/v1/klantcontacten/{str(uuid4())}" response = self.client.get( self.url, {"aanleidinggevendKlantcontact__url": klantcontacten_url}, @@ -1196,13 +1134,11 @@ def test_filter_aanleidinggevend_klantcontact_url(self): self.assertEqual(response.json()["count"], 0) - with self.subTest("invalid_value_returns_empty_query"): + with self.subTest("invalid_url_results_in_400"): response = self.client.get( self.url, {"aanleidinggevendKlantcontact__url": "ValueError"} ) - self.assertEqual(response.status_code, status.HTTP_200_OK) - - self.assertEqual(response.json()["count"], 0) + self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) class DigitaalAdresFilterSetTests(APITestCase): @@ -1241,7 +1177,7 @@ def setUp(self): ) def test_filter_verstrekt_door_betrokkene_url(self): - betrokkene_url = f"http://testserver/klantinteracties/api/v1/betrokkenen/{str(self.betrokkene5.uuid)}" + betrokkene_url = f"https://testserver.com/klantinteracties/api/v1/betrokkenen/{str(self.betrokkene5.uuid)}" response = self.client.get( self.url, {"verstrektDoorBetrokkene__url": betrokkene_url} ) @@ -1253,9 +1189,7 @@ def test_filter_verstrekt_door_betrokkene_url(self): self.assertEqual(str(self.digitaal_adres5.uuid), data[0]["uuid"]) with self.subTest("no_matches_found_return_nothing"): - betrokkene_url = ( - f"http://testserver/klantinteracties/api/v1/betrokkenen/{str(uuid4())}" - ) + betrokkene_url = f"https://testserver.com/klantinteracties/api/v1/betrokkenen/{str(uuid4())}" response = self.client.get( self.url, {"verstrektDoorBetrokkene__url": betrokkene_url}, @@ -1264,16 +1198,14 @@ def test_filter_verstrekt_door_betrokkene_url(self): self.assertEqual(response.json()["count"], 0) - with self.subTest("invalid_value_returns_empty_query"): + with self.subTest("invalid_url_results_in_400"): response = self.client.get( self.url, {"verstrektDoorBetrokkene__url": "ValueError"} ) - self.assertEqual(response.status_code, status.HTTP_200_OK) - - self.assertEqual(response.json()["count"], 0) + self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) def test_filter_verstrekt_door_partij_url(self): - partij_url = f"http://testserver/klantinteracties/api/v1/partijen/{str(self.partij5.uuid)}" + partij_url = f"https://testserver.com/klantinteracties/api/v1/partijen/{str(self.partij5.uuid)}" response = self.client.get(self.url, {"verstrektDoorPartij__url": partij_url}) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -1283,20 +1215,17 @@ def test_filter_verstrekt_door_partij_url(self): self.assertEqual(str(self.digitaal_adres5.uuid), data[0]["uuid"]) with self.subTest("no_matches_found_return_nothing"): + url = f"https://testserver.com/klantinteracties/api/v1/partijen/{str(uuid4())}" response = self.client.get( self.url, - { - "verstrektDoorPartij__url": f"http://testserver/klantinteracties/api/v1/partijen/{str(uuid4())}" - }, + {"verstrektDoorPartij__url": url}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.json()["count"], 0) - with self.subTest("invalid_value_returns_empty_query"): + with self.subTest("invalid_url_results_in_400"): response = self.client.get( self.url, {"verstrektDoorPartij__url": "ValueError"} ) - self.assertEqual(response.status_code, status.HTTP_200_OK) - - self.assertEqual(response.json()["count"], 0) + self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) diff --git a/src/openklant/components/klantinteracties/openapi.yaml b/src/openklant/components/klantinteracties/openapi.yaml index 4437faac..a347ca2e 100644 --- a/src/openklant/components/klantinteracties/openapi.yaml +++ b/src/openklant/components/klantinteracties/openapi.yaml @@ -208,7 +208,7 @@ paths: name: actor__url schema: type: string - description: Zoek actor klantcontract object op basis van het actor url + format: uri - in: query name: actor__uuid schema: @@ -218,8 +218,7 @@ paths: name: klantcontact__url schema: type: string - description: Zoek actor klantcontract object op basis van het klantcontact - url + format: uri - in: query name: klantcontact__uuid schema: @@ -400,11 +399,12 @@ paths: name: hadKlantcontact__url schema: type: string - description: Zoek betrokkene object op basis van het klantcontact url + format: uri - in: query name: hadKlantcontact__uuid schema: type: string + format: uuid description: Zoek betrokkene object op basis van het klantcontact uuid - in: query name: organisatienaam @@ -431,11 +431,12 @@ paths: name: verstrektedigitaalAdres__url schema: type: string - description: Zoek betrokkene object op basis van het digitaaladres url + format: uri - in: query name: verstrektedigitaalAdres__uuid schema: type: string + format: uuid description: Zoek betrokkene object op basis van het digitaaladres uuid - in: query name: wasPartij__nummer @@ -446,11 +447,12 @@ paths: name: wasPartij__url schema: type: string - description: Zoek betrokkene object op basis van het partij url + format: uri - in: query name: wasPartij__uuid schema: type: string + format: uuid description: Zoek betrokkene object op basis van het partij uuid tags: - betrokkenen @@ -774,11 +776,12 @@ paths: name: categorie__url schema: type: string - description: Zoek categorie relatie object op basis van de categorie url. + format: uri - in: query name: categorie__uuid schema: type: string + format: uuid description: Zoek categorie relatie object op basis van de categorie uuid. - in: query name: eindDatum @@ -806,11 +809,12 @@ paths: name: partij__url schema: type: string - description: Zoek categorie relatie object op basis van de partij url. + format: uri - in: query name: partij__uuid schema: type: string + format: uuid description: Zoek categorie relatie object op basis van de partij uuid. tags: - categorie relaties @@ -1165,8 +1169,7 @@ paths: name: verstrektDoorBetrokkene__url schema: type: string - description: Zoek digitaal adres(sen) object(en) op basis van de betrokkene - url. + format: uri - in: query name: verstrektDoorBetrokkene__uuid schema: @@ -1187,7 +1190,7 @@ paths: name: verstrektDoorPartij__url schema: type: string - description: Zoek digitaal adres(sen) object(en) op basis van de partij url. + format: uri - in: query name: verstrektDoorPartij__uuid schema: @@ -1351,8 +1354,7 @@ paths: name: aanleidinggevendKlantcontact__url schema: type: string - description: Zoek internetaak object op basis van het aanleidingevende klantcontact - url. + format: uri - in: query name: aanleidinggevendKlantcontact__uuid schema: @@ -1403,7 +1405,7 @@ paths: name: toegewezenAanActor__url schema: type: string - description: Zoek internetaak object op basis van het toegewezen actor url. + format: uri - in: query name: toegewezenAanActor__uuid schema: @@ -1575,7 +1577,7 @@ paths: name: hadBetrokkene__url schema: type: string - description: Zoek klantcontact object op basis van het betrokkene url. + format: uri - in: query name: hadBetrokkene__uuid schema: @@ -1586,7 +1588,7 @@ paths: name: hadBetrokkene__wasPartij__url schema: type: string - description: Zoek klantcontact object op basis van de partij url. + format: uri - in: query name: hadBetrokkene__wasPartij__uuid schema: @@ -1635,7 +1637,7 @@ paths: name: onderwerpobject__url schema: type: string - description: Zoek klantcontact object op basis van het onderwerpobject url. + format: uri - in: query name: onderwerpobject__uuid schema: @@ -1682,8 +1684,7 @@ paths: name: wasOnderwerpobject__url schema: type: string - description: Zoek was klantcontact object op basis van het onderwerpobject - url. + format: uri - in: query name: wasOnderwerpobject__uuid schema: @@ -2329,8 +2330,7 @@ paths: name: vertegenwoordigdePartij__url schema: type: string - description: Zoek partij object op basis van het vertegenwoordigde partij - url. + format: uri - in: query name: vertegenwoordigdePartij__uuid schema: @@ -2671,8 +2671,7 @@ paths: name: vertegenwoordigdePartij__url schema: type: string - description: Zoek Vertegenwoordigden object op basis van het vertegenwoordigde - partij url. + format: uri - in: query name: vertegenwoordigdePartij__uuid schema: @@ -2682,8 +2681,7 @@ paths: name: vertegenwoordigendePartij__url schema: type: string - description: Zoek Vertegenwoordigden object op basis van het vertegenwoordigende - partij url. + format: uri - in: query name: vertegenwoordigendePartij__uuid schema: