diff --git a/requirements/base.in b/requirements/base.in index 06e6d59c..026d80bd 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -35,6 +35,7 @@ django-jsonform # API libraries djangorestframework djangorestframework-inclusions +djangorestframework-camel-case drf-spectacular commonground-api-common diff --git a/requirements/base.txt b/requirements/base.txt index e99e8093..8de15bb0 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -34,7 +34,7 @@ celery==5.2.7 # -r requirements/base.in # flower # notifications-api-common -certifi==2023.11.17 +certifi==2024.2.2 # via # django-simple-certmanager # elastic-apm @@ -64,13 +64,13 @@ coreapi==2.3.3 # via commonground-api-common coreschema==0.0.4 # via coreapi -cryptography==41.0.7 +cryptography==42.0.2 # via # django-simple-certmanager # josepy # mozilla-django-oidc # pyopenssl -django==3.2.23 +django==3.2.24 # via # -r requirements/base.in # commonground-api-common @@ -116,7 +116,7 @@ django-extra-views==0.14.0 # via -r requirements/base.in django-filter==23.5 # via commonground-api-common -django-jsonform==2.21.4 +django-jsonform==2.21.5 # via # -r requirements/base.in # mozilla-django-oidc-db @@ -158,15 +158,16 @@ djangorestframework==3.12.4 # drf-spectacular # drf-yasg # notifications-api-common -djangorestframework-camel-case==1.2.0 +djangorestframework-camel-case==1.4.2 # via + # -r requirements/base.in # commonground-api-common # notifications-api-common djangorestframework-inclusions==1.2.0 # via -r requirements/base.in drf-nested-routers==0.93.4 # via commonground-api-common -drf-spectacular==0.27.0 +drf-spectacular==0.27.1 # via -r requirements/base.in drf-yasg==1.21.7 # via commonground-api-common @@ -178,7 +179,7 @@ exceptiongroup==1.2.0 # via cattrs face==20.1.1 # via glom -faker==22.2.0 +faker==23.1.0 # via zgw-consumers flower==2.0.1 # via -r requirements/base.in @@ -210,7 +211,7 @@ josepy==1.14.0 # via mozilla-django-oidc jq==1.6.0 # via -r requirements/base.in -jsonschema==4.21.0 +jsonschema==4.21.1 # via # -r requirements/base.in # drf-spectacular @@ -220,11 +221,11 @@ kombu==5.3.5 # via celery markdown==3.5.2 # via -r requirements/base.in -markupsafe==2.1.3 +markupsafe==2.1.5 # via jinja2 mozilla-django-oidc==4.0.0 # via mozilla-django-oidc-db -mozilla-django-oidc-db==0.14.1 +mozilla-django-oidc-db==0.15.0 # via -r requirements/base.in notifications-api-common==0.2.2 # via commonground-api-common @@ -232,7 +233,7 @@ oyaml==1.0 # via commonground-api-common packaging==23.2 # via drf-yasg -platformdirs==4.1.0 +platformdirs==4.2.0 # via requests-cache polib==1.2.0 # via django-rosetta @@ -248,7 +249,7 @@ pyjwt==2.8.0 # via # commonground-api-common # gemma-zds-client -pyopenssl==23.3.0 +pyopenssl==24.0.0 # via # django-simple-certmanager # josepy @@ -260,9 +261,9 @@ python-dateutil==2.8.2 # faker python-decouple==3.8 # via -r requirements/base.in -python-dotenv==1.0.0 +python-dotenv==1.0.1 # via -r requirements/base.in -pytz==2023.3.post1 +pytz==2024.1 # via # celery # django @@ -277,7 +278,7 @@ pyyaml==6.0.1 # oyaml redis==5.0.1 # via django-redis -referencing==0.32.1 +referencing==0.33.0 # via # jsonschema # jsonschema-specifications @@ -303,7 +304,7 @@ rpds-py==0.17.1 # referencing self-certifi==1.0.0 # via -r requirements/base.in -sentry-sdk==1.39.2 +sentry-sdk==1.40.3 # via -r requirements/base.in six==1.16.0 # via @@ -328,13 +329,13 @@ uritemplate==4.1.1 # drf-yasg url-normalize==1.4.3 # via requests-cache -urllib3==2.1.0 +urllib3==2.2.0 # via # elastic-apm # requests # requests-cache # sentry-sdk -uwsgi==2.0.23 +uwsgi==2.0.24 # via -r requirements/base.in vine==5.1.0 # via diff --git a/requirements/ci.txt b/requirements/ci.txt index 05479f59..698cdb11 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -17,7 +17,7 @@ asgiref==3.7.2 # -r requirements/base.txt # django # django-cors-headers -astroid==3.0.2 +astroid==3.0.3 # via pylint async-timeout==4.0.3 # via @@ -35,14 +35,14 @@ attrs==23.2.0 # requests-cache babel==2.14.0 # via sphinx -beautifulsoup4==4.12.2 +beautifulsoup4==4.12.3 # via webtest billiard==3.6.4.0 # via # -c requirements/base.txt # -r requirements/base.txt # celery -black==23.12.1 +black==24.1.1 # via -r requirements/test-tools.in bleach==6.1.0 # via @@ -65,7 +65,7 @@ celery==5.2.7 # -r requirements/base.txt # flower # notifications-api-common -certifi==2023.11.17 +certifi==2024.2.2 # via # -c requirements/base.txt # -r requirements/base.txt @@ -126,7 +126,7 @@ coreschema==0.0.4 # coreapi coverage==4.5.4 # via -r requirements/test-tools.in -cryptography==41.0.7 +cryptography==42.0.2 # via # -c requirements/base.txt # -r requirements/base.txt @@ -134,9 +134,9 @@ cryptography==41.0.7 # josepy # mozilla-django-oidc # pyopenssl -dill==0.3.7 +dill==0.3.8 # via pylint -django==3.2.23 +django==3.2.24 # via # -c requirements/base.txt # -r requirements/base.txt @@ -202,7 +202,7 @@ django-filter==23.5 # commonground-api-common django-jenkins==0.110.0 # via -r requirements/test-tools.in -django-jsonform==2.21.4 +django-jsonform==2.21.5 # via # -c requirements/base.txt # -r requirements/base.txt @@ -278,7 +278,7 @@ djangorestframework==3.12.4 # drf-spectacular # drf-yasg # notifications-api-common -djangorestframework-camel-case==1.2.0 +djangorestframework-camel-case==1.4.2 # via # -c requirements/base.txt # -r requirements/base.txt @@ -288,7 +288,7 @@ djangorestframework-inclusions==1.2.0 # via # -c requirements/base.txt # -r requirements/base.txt -docutils==0.18.1 +docutils==0.20.1 # via # recommonmark # sphinx @@ -299,7 +299,7 @@ drf-nested-routers==0.93.4 # -c requirements/base.txt # -r requirements/base.txt # commonground-api-common -drf-spectacular==0.27.0 +drf-spectacular==0.27.1 # via # -c requirements/base.txt # -r requirements/base.txt @@ -329,7 +329,7 @@ face==20.1.1 # glom factory-boy==3.3.0 # via -r requirements/test-tools.in -faker==22.2.0 +faker==23.1.0 # via # -c requirements/base.txt # -r requirements/base.txt @@ -407,7 +407,7 @@ jq==1.6.0 # via # -c requirements/base.txt # -r requirements/base.txt -jsonschema==4.21.0 +jsonschema==4.21.1 # via # -c requirements/base.txt # -r requirements/base.txt @@ -427,7 +427,7 @@ markdown==3.5.2 # -c requirements/base.txt # -r requirements/base.txt # sphinx-markdown-tables -markupsafe==2.1.3 +markupsafe==2.1.5 # via # -c requirements/base.txt # -r requirements/base.txt @@ -441,7 +441,7 @@ mozilla-django-oidc==4.0.0 # -c requirements/base.txt # -r requirements/base.txt # mozilla-django-oidc-db -mozilla-django-oidc-db==0.14.1 +mozilla-django-oidc-db==0.15.0 # via # -c requirements/base.txt # -r requirements/base.txt @@ -468,7 +468,7 @@ pathspec==0.12.1 # via black pep8==1.7.1 # via -r requirements/test-tools.in -platformdirs==4.1.0 +platformdirs==4.2.0 # via # -c requirements/base.txt # -r requirements/base.txt @@ -515,7 +515,7 @@ pyjwt==2.8.0 # gemma-zds-client pylint==3.0.3 # via -r requirements/test-tools.in -pyopenssl==23.3.0 +pyopenssl==24.0.0 # via # -c requirements/base.txt # -r requirements/base.txt @@ -533,11 +533,11 @@ python-decouple==3.8 # via # -c requirements/base.txt # -r requirements/base.txt -python-dotenv==1.0.0 +python-dotenv==1.0.1 # via # -c requirements/base.txt # -r requirements/base.txt -pytz==2023.3.post1 +pytz==2024.1 # via # -c requirements/base.txt # -r requirements/base.txt @@ -561,7 +561,7 @@ redis==5.0.1 # -c requirements/base.txt # -r requirements/base.txt # django-redis -referencing==0.32.1 +referencing==0.33.0 # via # -c requirements/base.txt # -r requirements/base.txt @@ -601,7 +601,7 @@ self-certifi==1.0.0 # via # -c requirements/base.txt # -r requirements/base.txt -sentry-sdk==1.39.2 +sentry-sdk==1.40.3 # via # -c requirements/base.txt # -r requirements/base.txt @@ -630,7 +630,7 @@ sphinx-markdown-tables==0.0.17 # via -r requirements/docs.in sphinx-rtd-theme==2.0.0 # via -r requirements/docs.in -sphinx-tabs==3.4.4 +sphinx-tabs==3.4.5 # via -r requirements/docs.in sphinxcontrib-applehelp==1.0.8 # via sphinx @@ -684,7 +684,7 @@ url-normalize==1.4.3 # -c requirements/base.txt # -r requirements/base.txt # requests-cache -urllib3==2.1.0 +urllib3==2.2.0 # via # -c requirements/base.txt # -r requirements/base.txt @@ -692,7 +692,7 @@ urllib3==2.1.0 # requests # requests-cache # sentry-sdk -uwsgi==2.0.23 +uwsgi==2.0.24 # via # -c requirements/base.txt # -r requirements/base.txt @@ -703,7 +703,7 @@ vine==5.1.0 # amqp # celery # kombu -waitress==2.1.2 +waitress==3.0.0 # via # -r requirements/test-tools.in # webtest diff --git a/requirements/dev.txt b/requirements/dev.txt index 27770296..695b6a90 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -20,7 +20,7 @@ asgiref==3.7.2 # -r requirements/ci.txt # django # django-cors-headers -astroid==3.0.2 +astroid==3.0.3 # via # -c requirements/ci.txt # -r requirements/ci.txt @@ -44,7 +44,7 @@ babel==2.14.0 # -c requirements/ci.txt # -r requirements/ci.txt # sphinx -beautifulsoup4==4.12.2 +beautifulsoup4==4.12.3 # via # -c requirements/ci.txt # -r requirements/ci.txt @@ -54,7 +54,7 @@ billiard==3.6.4.0 # -c requirements/ci.txt # -r requirements/ci.txt # celery -black==23.12.1 +black==24.1.1 # via # -c requirements/ci.txt # -r requirements/ci.txt @@ -81,7 +81,7 @@ celery==5.2.7 # -r requirements/ci.txt # flower # notifications-api-common -certifi==2023.11.17 +certifi==2024.2.2 # via # -c requirements/ci.txt # -r requirements/ci.txt @@ -148,7 +148,7 @@ coverage==4.5.4 # via # -c requirements/ci.txt # -r requirements/ci.txt -cryptography==41.0.7 +cryptography==42.0.2 # via # -c requirements/ci.txt # -r requirements/ci.txt @@ -158,12 +158,12 @@ cryptography==41.0.7 # pyopenssl ddt-api-calls==0.3.2 # via -r requirements/dev.in -dill==0.3.7 +dill==0.3.8 # via # -c requirements/ci.txt # -r requirements/ci.txt # pylint -django==3.2.23 +django==3.2.24 # via # -c requirements/ci.txt # -r requirements/ci.txt @@ -221,7 +221,7 @@ django-db-logger==0.1.13 # via # -c requirements/ci.txt # -r requirements/ci.txt -django-debug-toolbar==4.2.0 +django-debug-toolbar==4.3.0 # via -r requirements/dev.in django-extensions==3.2.3 # via -r requirements/dev.in @@ -238,7 +238,7 @@ django-jenkins==0.110.0 # via # -c requirements/ci.txt # -r requirements/ci.txt -django-jsonform==2.21.4 +django-jsonform==2.21.5 # via # -c requirements/ci.txt # -r requirements/ci.txt @@ -316,7 +316,7 @@ djangorestframework==3.12.4 # drf-spectacular # drf-yasg # notifications-api-common -djangorestframework-camel-case==1.2.0 +djangorestframework-camel-case==1.4.2 # via # -c requirements/ci.txt # -r requirements/ci.txt @@ -326,7 +326,7 @@ djangorestframework-inclusions==1.2.0 # via # -c requirements/ci.txt # -r requirements/ci.txt -docutils==0.18.1 +docutils==0.20.1 # via # -c requirements/ci.txt # -r requirements/ci.txt @@ -339,7 +339,7 @@ drf-nested-routers==0.93.4 # -c requirements/ci.txt # -r requirements/ci.txt # commonground-api-common -drf-spectacular==0.27.0 +drf-spectacular==0.27.1 # via # -c requirements/ci.txt # -r requirements/ci.txt @@ -371,7 +371,7 @@ factory-boy==3.3.0 # via # -c requirements/ci.txt # -r requirements/ci.txt -faker==22.2.0 +faker==23.1.0 # via # -c requirements/ci.txt # -r requirements/ci.txt @@ -457,7 +457,7 @@ jq==1.6.0 # via # -c requirements/ci.txt # -r requirements/ci.txt -jsonschema==4.21.0 +jsonschema==4.21.1 # via # -c requirements/ci.txt # -r requirements/ci.txt @@ -477,7 +477,7 @@ markdown==3.5.2 # -c requirements/ci.txt # -r requirements/ci.txt # sphinx-markdown-tables -markupsafe==2.1.3 +markupsafe==2.1.5 # via # -c requirements/ci.txt # -r requirements/ci.txt @@ -493,7 +493,7 @@ mozilla-django-oidc==4.0.0 # -c requirements/ci.txt # -r requirements/ci.txt # mozilla-django-oidc-db -mozilla-django-oidc-db==0.14.1 +mozilla-django-oidc-db==0.15.0 # via # -c requirements/ci.txt # -r requirements/ci.txt @@ -531,7 +531,7 @@ pep8==1.7.1 # -r requirements/ci.txt pip-tools==7.3.0 # via -r requirements/dev.in -platformdirs==4.1.0 +platformdirs==4.2.0 # via # -c requirements/ci.txt # -r requirements/ci.txt @@ -588,7 +588,7 @@ pylint==3.0.3 # via # -c requirements/ci.txt # -r requirements/ci.txt -pyopenssl==23.3.0 +pyopenssl==24.0.0 # via # -c requirements/ci.txt # -r requirements/ci.txt @@ -608,11 +608,11 @@ python-decouple==3.8 # via # -c requirements/ci.txt # -r requirements/ci.txt -python-dotenv==1.0.0 +python-dotenv==1.0.1 # via # -c requirements/ci.txt # -r requirements/ci.txt -pytz==2023.3.post1 +pytz==2024.1 # via # -c requirements/ci.txt # -r requirements/ci.txt @@ -638,7 +638,7 @@ redis==5.0.1 # -c requirements/ci.txt # -r requirements/ci.txt # django-redis -referencing==0.32.1 +referencing==0.33.0 # via # -c requirements/ci.txt # -r requirements/ci.txt @@ -679,7 +679,7 @@ self-certifi==1.0.0 # via # -c requirements/ci.txt # -r requirements/ci.txt -sentry-sdk==1.39.2 +sentry-sdk==1.40.3 # via # -c requirements/ci.txt # -r requirements/ci.txt @@ -721,7 +721,7 @@ sphinx-rtd-theme==2.0.0 # -c requirements/ci.txt # -r requirements/ci.txt # -r requirements/dev.in -sphinx-tabs==3.4.4 +sphinx-tabs==3.4.5 # via # -c requirements/ci.txt # -r requirements/ci.txt @@ -809,7 +809,7 @@ url-normalize==1.4.3 # -c requirements/ci.txt # -r requirements/ci.txt # requests-cache -urllib3==2.1.0 +urllib3==2.2.0 # via # -c requirements/ci.txt # -r requirements/ci.txt @@ -817,7 +817,7 @@ urllib3==2.1.0 # requests # requests-cache # sentry-sdk -uwsgi==2.0.23 +uwsgi==2.0.24 # via # -c requirements/ci.txt # -r requirements/ci.txt @@ -828,7 +828,7 @@ vine==5.1.0 # amqp # celery # kombu -waitress==2.1.2 +waitress==3.0.0 # via # -c requirements/ci.txt # -r requirements/ci.txt diff --git a/src/openklant/components/klantinteracties/admin/partijen.py b/src/openklant/components/klantinteracties/admin/partijen.py index f37f53db..e6ff0080 100644 --- a/src/openklant/components/klantinteracties/admin/partijen.py +++ b/src/openklant/components/klantinteracties/admin/partijen.py @@ -10,6 +10,7 @@ Contactpersoon, Organisatie, Partij, + PartijIdentificator, Persoon, Vertegenwoordigden, ) @@ -28,6 +29,12 @@ class CategorieRelatieInlineAdmin(admin.StackedInline): extra = 0 +class PartijIdentificatorInlineAdmin(admin.StackedInline): + readonly_fields = ("uuid",) + model = PartijIdentificator + extra = 0 + + class BetrokkeneInlineAdmin(admin.StackedInline): readonly_fields = ("uuid",) model = Betrokkene @@ -85,6 +92,7 @@ class PartijAdmin(admin.ModelAdmin): DigitaalAdresInlineAdmin, BetrokkeneInlineAdmin, VertegenwoordigdenInlineAdmin, + PartijIdentificatorInlineAdmin, ) search_fields = ("partij",) autocomplete_fields = ("voorkeurs_digitaal_adres",) diff --git a/src/openklant/components/klantinteracties/api/tests/test_filters.py b/src/openklant/components/klantinteracties/api/tests/test_filters.py index f0c0f8f7..b0a0c5ba 100644 --- a/src/openklant/components/klantinteracties/api/tests/test_filters.py +++ b/src/openklant/components/klantinteracties/api/tests/test_filters.py @@ -96,7 +96,7 @@ def test_filter_betrokkene_url(self): response = self.client.get( self.url, { - "had_betrokkene__url": f"http://testserver/klantinteracties/api/v1/klantcontact/{self.betrokkene.uuid}" + "hadBetrokkene__url": f"http://testserver/klantinteracties/api/v1/klantcontact/{self.betrokkene.uuid}" }, ) data = response.json()["results"] @@ -108,7 +108,7 @@ def test_filter_betrokkene_url(self): response = self.client.get( self.url, { - "had_betrokkene__url": f"http://testserver/klantinteracties/api/v1/klantcontact/{str(uuid4())}" + "hadBetrokkene__url": f"http://testserver/klantinteracties/api/v1/klantcontact/{str(uuid4())}" }, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -116,7 +116,7 @@ def test_filter_betrokkene_url(self): self.assertEqual(response.json()["count"], 0) with self.subTest("invalid_value_returns_empty_query"): - response = self.client.get(self.url, {"had_betrokkene__url": "ValueError"}) + response = self.client.get(self.url, {"hadBetrokkene__url": "ValueError"}) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.json()["count"], 0) @@ -152,7 +152,7 @@ def test_filter_was_onderwerpobject__url(self): url = f"http://testserver/klantinteracties/api/v1/onderwerpobjecten/{self.onderwerpobject5.uuid}" response = self.client.get( self.url, - {"was_onderwerpobject__url": url}, + {"wasOnderwerpobject__url": url}, ) data = response.json()["results"] @@ -163,7 +163,7 @@ def test_filter_was_onderwerpobject__url(self): url = f"http://testserver/klantinteracties/api/v1/onderwerpobjecten/{str(uuid4())}" response = self.client.get( self.url, - {"was_onderwerpobject__url": url}, + {"wasOnderwerpobject__url": url}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -171,7 +171,7 @@ def test_filter_was_onderwerpobject__url(self): with self.subTest("invalid_value_returns_empty_query"): response = self.client.get( - self.url, {"was_onderwerpobject__url": "ValueError"} + self.url, {"wasOnderwerpobject__url": "ValueError"} ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -209,11 +209,10 @@ 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}" response = self.client.get( self.url, - { - "had_klantcontact__url": f"http://testserver/klantinteracties/api/v1/klantcontact/{self.klantcontact.uuid}" - }, + {"hadKlantcontact__url": klantcontact_url}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -226,7 +225,7 @@ def test_filter_had_klantcontact_url(self): response = self.client.get( self.url, { - "had_klantcontact__url": f"http://testserver/klantinteracties/api/v1/klantcontact/{str(uuid4())}" + "hadKlantcontact__url": f"http://testserver/klantinteracties/api/v1/klantcontact/{str(uuid4())}" }, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -234,9 +233,7 @@ def test_filter_had_klantcontact_url(self): self.assertEqual(response.json()["count"], 0) with self.subTest("invalid_value_returns_empty_query"): - response = self.client.get( - self.url, {"had_klantcontact__url": "ValueError"} - ) + response = self.client.get(self.url, {"hadKlantcontact__url": "ValueError"}) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.json()["count"], 0) @@ -244,7 +241,7 @@ def test_filter_had_klantcontact_url(self): def test_filter_had_klantcontact_uuid(self): response = self.client.get( self.url, - {"had_klantcontact__uuid": str(self.klantcontact.uuid)}, + {"hadKlantcontact__uuid": str(self.klantcontact.uuid)}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -256,7 +253,7 @@ def test_filter_had_klantcontact_uuid(self): with self.subTest("no_matches_found_return_nothing"): response = self.client.get( self.url, - {"had_klantcontact__uuid": str(uuid4())}, + {"hadKlantcontact__uuid": str(uuid4())}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -264,7 +261,7 @@ def test_filter_had_klantcontact_uuid(self): with self.subTest("invalid_value_returns_empty_query"): response = self.client.get( - self.url, {"had_klantcontact__uuid": "ValueError"} + self.url, {"hadKlantcontact__uuid": "ValueError"} ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -273,7 +270,7 @@ def test_filter_had_klantcontact_uuid(self): def test_filter_had_klantcontact_nummer(self): response = self.client.get( self.url, - {"had_klantcontact__nummer": str(6237172371)}, + {"hadKlantcontact__nummer": str(6237172371)}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -285,7 +282,7 @@ def test_filter_had_klantcontact_nummer(self): with self.subTest("no_matches_found_return_nothing"): response = self.client.get( self.url, - {"had_klantcontact__nummer": "8584395394"}, + {"hadKlantcontact__nummer": "8584395394"}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -295,7 +292,7 @@ def test_filter_verstrektedigitaal_adres_url(self): digitaal_adres_url = f"http://testserver/klantinteracties/api/v1/digitaal_adres/{self.digitaal_adres.uuid}" response = self.client.get( self.url, - {"verstrektedigitaal_adres__url": digitaal_adres_url}, + {"verstrektedigitaalAdres__url": digitaal_adres_url}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -308,7 +305,7 @@ def test_filter_verstrektedigitaal_adres_url(self): none_existing_url = f"http://testserver/klantinteracties/api/v1/digitaal_adres/{str(uuid4())}" response = self.client.get( self.url, - {"verstrektedigitaal_adres__url": none_existing_url}, + {"verstrektedigitaalAdres__url": none_existing_url}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -316,7 +313,7 @@ def test_filter_verstrektedigitaal_adres_url(self): with self.subTest("invalid_value_returns_empty_query"): response = self.client.get( - self.url, {"verstrektedigitaal_adres__url": "ValueError"} + self.url, {"verstrektedigitaalAdres__url": "ValueError"} ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -325,7 +322,7 @@ def test_filter_verstrektedigitaal_adres_url(self): def test_filter_verstrektedigitaal_adres_uuid(self): response = self.client.get( self.url, - {"verstrektedigitaal_adres__uuid": str(self.digitaal_adres.uuid)}, + {"verstrektedigitaalAdres__uuid": str(self.digitaal_adres.uuid)}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -337,7 +334,7 @@ def test_filter_verstrektedigitaal_adres_uuid(self): with self.subTest("no_matches_found_return_nothing"): response = self.client.get( self.url, - {"verstrektedigitaal_adres__uuid": str(uuid4())}, + {"verstrektedigitaalAdres__uuid": str(uuid4())}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -345,7 +342,7 @@ def test_filter_verstrektedigitaal_adres_uuid(self): with self.subTest("invalid_value_returns_empty_query"): response = self.client.get( - self.url, {"verstrektedigitaal_adres__uuid": "ValueError"} + self.url, {"verstrektedigitaalAdres__uuid": "ValueError"} ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -354,7 +351,7 @@ def test_filter_verstrektedigitaal_adres_uuid(self): def test_filter_verstrektedigitaal_adres_adres(self): response = self.client.get( self.url, - {"verstrektedigitaal_adres__adres": "search_param_adres"}, + {"verstrektedigitaalAdres__adres": "search_param_adres"}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -366,7 +363,7 @@ def test_filter_verstrektedigitaal_adres_adres(self): with self.subTest("no_matches_found_return_nothing"): response = self.client.get( self.url, - {"verstrektedigitaal_adres__adres": "none_existing_adres"}, + {"verstrektedigitaalAdres__adres": "none_existing_adres"}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -376,7 +373,7 @@ def test_filter_was_partij_url(self): response = self.client.get( self.url, { - "was_partij__url": f"http://testserver/klantinteracties/api/v1/partij/{self.partij.uuid}" + "wasPartij__url": f"http://testserver/klantinteracties/api/v1/partij/{self.partij.uuid}" }, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -390,7 +387,7 @@ def test_filter_was_partij_url(self): response = self.client.get( self.url, { - "was_partij__url": f"http://testserver/klantinteracties/api/v1/partij/{str(uuid4())}" + "wasPartij__url": f"http://testserver/klantinteracties/api/v1/partij/{str(uuid4())}" }, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -398,7 +395,7 @@ def test_filter_was_partij_url(self): self.assertEqual(response.json()["count"], 0) with self.subTest("invalid_value_returns_empty_query"): - response = self.client.get(self.url, {"was_partij__url": "ValueError"}) + response = self.client.get(self.url, {"wasPartij__url": "ValueError"}) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.json()["count"], 0) @@ -406,7 +403,7 @@ def test_filter_was_partij_url(self): def test_filter_was_partij_uuid(self): response = self.client.get( self.url, - {"was_partij__uuid": str(self.partij.uuid)}, + {"wasPartij__uuid": str(self.partij.uuid)}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -418,14 +415,14 @@ def test_filter_was_partij_uuid(self): with self.subTest("no_matches_found_return_nothing"): response = self.client.get( self.url, - {"was_partij__uuid": str(uuid4())}, + {"wasPartij__uuid": 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"): - response = self.client.get(self.url, {"was_partij__uuid": "ValueError"}) + response = self.client.get(self.url, {"wasPartij__uuid": "ValueError"}) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.json()["count"], 0) @@ -433,7 +430,7 @@ def test_filter_was_partij_uuid(self): def test_filter_was_partij_nummer(self): response = self.client.get( self.url, - {"was_partij__nummer": "8123973457"}, + {"wasPartij__nummer": "8123973457"}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -445,7 +442,7 @@ def test_filter_was_partij_nummer(self): with self.subTest("no_matches_found_return_nothing"): response = self.client.get( self.url, - {"was_partij__nummer": "2348238482"}, + {"wasPartij__nummer": "2348238482"}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -525,7 +522,7 @@ def test_filter_vertegenwoordigde_partij_url(self): partij_url = f"http://testserver/klantinteracties/api/v1/partijen/{str(self.partij5.uuid)}" response = self.client.get( self.url, - {"vertegenwoordigde_partij__url": partij_url}, + {"vertegenwoordigdePartij__url": partij_url}, content_type="application/json", ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -541,7 +538,7 @@ def test_filter_vertegenwoordigde_partij_url(self): ) response = self.client.get( self.url, - {"vertegenwoordigde_partij__url": partij_url}, + {"vertegenwoordigdePartij__url": partij_url}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -549,7 +546,7 @@ def test_filter_vertegenwoordigde_partij_url(self): with self.subTest("invalid_value_returns_empty_query"): response = self.client.get( - self.url, {"vertegenwoordigde_partij__url": "ValueError"} + self.url, {"vertegenwoordigdePartij__url": "ValueError"} ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -559,7 +556,7 @@ def test_filter_partij_identificator_nummer(self): response = self.client.get( self.url, { - "partij_identificator__code_objecttype": f"objecttype-{self.partij5.nummer}" + "partijIdentificator__codeObjecttype": f"objecttype-{self.partij5.nummer}" }, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -572,7 +569,7 @@ def test_filter_partij_identificator_nummer(self): with self.subTest("no_matches_found_return_nothing"): response = self.client.get( self.url, - {"partij_identificator__code_objecttype": "objecttype-8584395394"}, + {"partijIdentificator__codeObjecttype": "objecttype-8584395394"}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -582,7 +579,7 @@ def test_filter_identificator_soort_object_id(self): response = self.client.get( self.url, { - "partij_identificator__code_soort_object_id": f"soort-object-id-{self.partij5.nummer}" + "partijIdentificator__codeSoortObjectId": f"soort-object-id-{self.partij5.nummer}" }, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -596,7 +593,7 @@ def test_filter_identificator_soort_object_id(self): response = self.client.get( self.url, { - "partij_identificator__code_soort_object_id": "soort-object-id-8584395394" + "partijIdentificator__codeSoortObjectId": "soort-object-id-8584395394" }, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -606,7 +603,7 @@ def test_filter_identificator_soort_object_id(self): def test_filter_identificator_object_id(self): response = self.client.get( self.url, - {"partij_identificator__object_id": f"object-id-{self.partij5.nummer}"}, + {"partijIdentificator__objectId": f"object-id-{self.partij5.nummer}"}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -618,7 +615,7 @@ def test_filter_identificator_object_id(self): with self.subTest("no_matches_found_return_nothing"): response = self.client.get( self.url, - {"partij_identificator__object_id": "object-id-8584395394"}, + {"partijIdentificator__objectId": "object-id-8584395394"}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -627,7 +624,7 @@ def test_filter_identificator_object_id(self): def test_filter_identificator_register(self): response = self.client.get( self.url, - {"partij_identificator__code_register": f"register-{self.partij5.nummer}"}, + {"partijIdentificator__codeRegister": f"register-{self.partij5.nummer}"}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -639,7 +636,7 @@ def test_filter_identificator_register(self): with self.subTest("no_matches_found_return_nothing"): response = self.client.get( self.url, - {"partij_identificator__code_register": "register-8584395394"}, + {"partijIdentificator__codeRegister": "register-8584395394"}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -1011,7 +1008,7 @@ def test_filter_vertegenwoordigende_partij_url(self): partij_url = f"http://testserver/klantinteracties/api/v1/partijen/{str(self.partij5.uuid)}" response = self.client.get( self.url, - {"vertegenwoordigende_partij__url": partij_url}, + {"vertegenwoordigendePartij__url": partij_url}, content_type="application/json", ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -1027,7 +1024,7 @@ def test_filter_vertegenwoordigende_partij_url(self): ) response = self.client.get( self.url, - {"vertegenwoordigende_partij__url": vertegenwoordigde_partij_url}, + {"vertegenwoordigendePartij__url": vertegenwoordigde_partij_url}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -1035,7 +1032,7 @@ def test_filter_vertegenwoordigende_partij_url(self): with self.subTest("invalid_value_returns_empty_query"): response = self.client.get( - self.url, {"vertegenwoordigende_partij__url": "ValueError"} + self.url, {"vertegenwoordigendePartij__url": "ValueError"} ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -1045,7 +1042,7 @@ def test_filter_vertegenwoordigde_partij_url(self): partij_url = f"http://testserver/klantinteracties/api/v1/partijen/{str(self.partij5.uuid)}" response = self.client.get( self.url, - {"vertegenwoordigde_partij__url": partij_url}, + {"vertegenwoordigdePartij__url": partij_url}, content_type="application/json", ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -1061,7 +1058,7 @@ def test_filter_vertegenwoordigde_partij_url(self): ) response = self.client.get( self.url, - {"vertegenwoordigde_partij__url": partij_url}, + {"vertegenwoordigdePartij__url": partij_url}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -1069,7 +1066,7 @@ def test_filter_vertegenwoordigde_partij_url(self): with self.subTest("invalid_value_returns_empty_query"): response = self.client.get( - self.url, {"vertegenwoordigde_partij__url": "ValueError"} + self.url, {"vertegenwoordigdePartij__url": "ValueError"} ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -1117,7 +1114,7 @@ def test_filter_toegewezen_aan_actor_url(self): ) response = self.client.get( self.url, - {"toegewezen_aan_actor__url": actor_url}, + {"toegewezenAanActor__url": actor_url}, content_type="application/json", ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -1131,7 +1128,7 @@ def test_filter_toegewezen_aan_actor_url(self): response = self.client.get( self.url, { - "toegewezen_aan_actor__url": f"http://testserver/klantinteracties/api/v1/actoren/{str(uuid4())}" + "toegewezenAanActor__url": f"http://testserver/klantinteracties/api/v1/actoren/{str(uuid4())}" }, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -1140,17 +1137,17 @@ def test_filter_toegewezen_aan_actor_url(self): with self.subTest("invalid_value_returns_empty_query"): response = self.client.get( - self.url, {"toegewezen_aan_actor__url": "ValueError"} + self.url, {"toegewezenAanActor__url": "ValueError"} ) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.json()["count"], 0) def test_filter_aanleidinggevend_klantcontact_url(self): - actor_url = f"http://testserver/klantinteracties/api/v1/klantcontacten/{str(self.klantcontact5.uuid)}" + klantcontact_url = f"http://testserver/klantinteracties/api/v1/klantcontacten/{str(self.klantcontact5.uuid)}" response = self.client.get( self.url, - {"aanleidinggevend_klantcontact__url": actor_url}, + {"aanleidinggevendKlantcontact__url": klantcontact_url}, content_type="application/json", ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -1161,11 +1158,10 @@ 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())}" response = self.client.get( self.url, - { - "aanleidinggevend_klantcontact__url": f"http://testserver/klantinteracties/api/v1/klantcontacten/{str(uuid4())}" - }, + {"aanleidinggevendKlantcontact__url": klantcontacten_url}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @@ -1173,7 +1169,7 @@ def test_filter_aanleidinggevend_klantcontact_url(self): with self.subTest("invalid_value_returns_empty_query"): response = self.client.get( - self.url, {"aanleidinggevend_klantcontact__url": "ValueError"} + self.url, {"aanleidinggevendKlantcontact__url": "ValueError"} ) self.assertEqual(response.status_code, status.HTTP_200_OK) diff --git a/src/openklant/components/klantinteracties/migrations/0011_auto_20240208_1510.py b/src/openklant/components/klantinteracties/migrations/0011_auto_20240208_1510.py deleted file mode 100644 index d8069359..00000000 --- a/src/openklant/components/klantinteracties/migrations/0011_auto_20240208_1510.py +++ /dev/null @@ -1,154 +0,0 @@ -# Generated by Django 3.2.23 on 2024-02-08 15:10 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("klantinteracties", "0010_auto_20240207_1416"), - ] - - operations = [ - migrations.RenameField( - model_name="actor", - old_name="objectidentificator_object_id", - new_name="actoridentificator_object_id", - ), - migrations.RenameField( - model_name="bijlage", - old_name="objectidentificator_object_id", - new_name="bijlageidentificator_object_id", - ), - migrations.RenameField( - model_name="onderwerpobject", - old_name="objectidentificator_object_id", - new_name="onderwerpobjectidentificator_object_id", - ), - migrations.RemoveField( - model_name="actor", - name="objectidentificator_objecttype", - ), - migrations.RemoveField( - model_name="actor", - name="objectidentificator_register", - ), - migrations.RemoveField( - model_name="actor", - name="objectidentificator_soort_object_id", - ), - migrations.RemoveField( - model_name="bijlage", - name="objectidentificator_objecttype", - ), - migrations.RemoveField( - model_name="bijlage", - name="objectidentificator_register", - ), - migrations.RemoveField( - model_name="bijlage", - name="objectidentificator_soort_object_id", - ), - migrations.RemoveField( - model_name="onderwerpobject", - name="objectidentificator_objecttype", - ), - migrations.RemoveField( - model_name="onderwerpobject", - name="objectidentificator_register", - ), - migrations.RemoveField( - model_name="onderwerpobject", - name="objectidentificator_soort_object_id", - ), - migrations.AddField( - model_name="actor", - name="actoridentificator_code_objecttype", - field=models.CharField( - blank=True, - help_text="Type van het object, bijvoorbeeld: 'INGESCHREVEN NATUURLIJK PERSOON'.", - max_length=200, - verbose_name="code objecttype", - ), - ), - migrations.AddField( - model_name="actor", - name="actoridentificator_code_register", - field=models.CharField( - blank=True, - help_text="Binnen het landschap van registers unieke omschrijving van het register waarin het object is geregistreerd, bijvoorbeeld: 'BRP'.", - max_length=200, - verbose_name="code register", - ), - ), - migrations.AddField( - model_name="actor", - name="actoridentificator_code_soort_object_id", - field=models.CharField( - blank=True, - help_text="Naam van de eigenschap die het object identificeert, bijvoorbeeld: 'Burgerservicenummer'.", - max_length=200, - verbose_name="code soort object ID", - ), - ), - migrations.AddField( - model_name="bijlage", - name="bijlageidentificator_code_objecttype", - field=models.CharField( - blank=True, - help_text="Type van het object, bijvoorbeeld: 'INGESCHREVEN NATUURLIJK PERSOON'.", - max_length=200, - verbose_name="code objecttype", - ), - ), - migrations.AddField( - model_name="bijlage", - name="bijlageidentificator_code_register", - field=models.CharField( - blank=True, - help_text="Binnen het landschap van registers unieke omschrijving van het register waarin het object is geregistreerd, bijvoorbeeld: 'BRP'.", - max_length=200, - verbose_name="code register", - ), - ), - migrations.AddField( - model_name="bijlage", - name="bijlageidentificator_code_soort_object_id", - field=models.CharField( - blank=True, - help_text="Naam van de eigenschap die het object identificeert, bijvoorbeeld: 'Burgerservicenummer'.", - max_length=200, - verbose_name="code soort object ID", - ), - ), - migrations.AddField( - model_name="onderwerpobject", - name="onderwerpobjectidentificator_code_objecttype", - field=models.CharField( - blank=True, - help_text="Type van het object, bijvoorbeeld: 'INGESCHREVEN NATUURLIJK PERSOON'.", - max_length=200, - verbose_name="code objecttype", - ), - ), - migrations.AddField( - model_name="onderwerpobject", - name="onderwerpobjectidentificator_code_register", - field=models.CharField( - blank=True, - help_text="Binnen het landschap van registers unieke omschrijving van het register waarin het object is geregistreerd, bijvoorbeeld: 'BRP'.", - max_length=200, - verbose_name="code register", - ), - ), - migrations.AddField( - model_name="onderwerpobject", - name="onderwerpobjectidentificator_code_soort_object_id", - field=models.CharField( - blank=True, - help_text="Naam van de eigenschap die het object identificeert, bijvoorbeeld: 'Burgerservicenummer'.", - max_length=200, - verbose_name="code soort object ID", - ), - ), - ] diff --git a/src/openklant/components/klantinteracties/migrations/0011_auto_20240209_0928.py b/src/openklant/components/klantinteracties/migrations/0011_auto_20240209_0928.py index 3c217a45..6eb74067 100644 --- a/src/openklant/components/klantinteracties/migrations/0011_auto_20240209_0928.py +++ b/src/openklant/components/klantinteracties/migrations/0011_auto_20240209_0928.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("klantinteracties", "0010_auto_20240207_1416"), ] diff --git a/src/openklant/components/klantinteracties/openapi.yaml b/src/openklant/components/klantinteracties/openapi.yaml index a737ca8c..06b27914 100644 --- a/src/openklant/components/klantinteracties/openapi.yaml +++ b/src/openklant/components/klantinteracties/openapi.yaml @@ -19,23 +19,23 @@ paths: summary: Alle actoren opvragen. parameters: - in: query - name: actoridentificator_code_objecttype + name: actoridentificatorCodeObjecttype schema: type: string - in: query - name: actoridentificator_code_register + name: actoridentificatorCodeRegister schema: type: string - in: query - name: actoridentificator_code_soort_object_id + name: actoridentificatorCodeSoortObjectId schema: type: string - in: query - name: actoridentificator_object_id + name: actoridentificatorObjectId schema: type: string - in: query - name: indicatie_actief + name: indicatieActief schema: type: boolean - in: query @@ -50,7 +50,7 @@ paths: schema: type: integer - in: query - name: soort_actor + name: soortActor schema: type: string enum: @@ -367,33 +367,33 @@ paths: summary: Alle betrokkenen opvragen. parameters: - in: query - name: contactnaam_achternaam + name: contactnaamAchternaam schema: type: string - in: query - name: contactnaam_voorletters + name: contactnaamVoorletters schema: type: string - in: query - name: contactnaam_voornaam + name: contactnaamVoornaam schema: type: string - in: query - name: contactnaam_voorvoegsel_achternaam + name: contactnaamVoorvoegselAchternaam schema: type: string - in: query - name: had_klantcontact__nummer + name: hadKlantcontact__nummer schema: type: string description: Zoek betrokkene object op basis van het klantcontact nummer - in: query - name: had_klantcontact__url + name: hadKlantcontact__url schema: type: string description: Zoek betrokkene object op basis van het klantcontact url - in: query - name: had_klantcontact__uuid + name: hadKlantcontact__uuid schema: type: string description: Zoek betrokkene object op basis van het klantcontact uuid @@ -408,32 +408,32 @@ paths: schema: type: integer - in: query - name: verstrektedigitaal_adres__adres + name: verstrektedigitaalAdres__adres schema: type: string description: Zoek betrokkene object op basis van het digitaaladres adres - in: query - name: verstrektedigitaal_adres__url + name: verstrektedigitaalAdres__url schema: type: string description: Zoek betrokkene object op basis van het digitaaladres url - in: query - name: verstrektedigitaal_adres__uuid + name: verstrektedigitaalAdres__uuid schema: type: string description: Zoek betrokkene object op basis van het digitaaladres uuid - in: query - name: was_partij__nummer + name: wasPartij__nummer schema: type: string description: Zoek betrokkene object op basis van het partij nummer - in: query - name: was_partij__url + name: wasPartij__url schema: type: string description: Zoek betrokkene object op basis van het partij url - in: query - name: was_partij__uuid + name: wasPartij__uuid schema: type: string description: Zoek betrokkene object op basis van het partij uuid @@ -580,19 +580,19 @@ paths: summary: Alle bijlagen opvragen. parameters: - in: query - name: bijlageidentificator_code_objecttype + name: bijlageidentificatorCodeObjecttype schema: type: string - in: query - name: bijlageidentificator_code_register + name: bijlageidentificatorCodeRegister schema: type: string - in: query - name: bijlageidentificator_code_soort_object_id + name: bijlageidentificatorCodeSoortObjectId schema: type: string - in: query - name: bijlageidentificator_object_id + name: bijlageidentificatorObjectId schema: type: string - name: page @@ -740,7 +740,7 @@ paths: summary: Alle categorie relaties opvragen. parameters: - in: query - name: begin_datum + name: beginDatum schema: type: string format: date @@ -760,7 +760,7 @@ paths: type: string description: Zoek categorie relatie object op basis van de categorie uuid. - in: query - name: eind_datum + name: eindDatum schema: type: string format: date @@ -1213,13 +1213,13 @@ paths: summary: Alle interne taken opvragen. parameters: - in: query - name: aanleidinggevend_klantcontact__url + name: aanleidinggevendKlantcontact__url schema: type: string description: Zoek internetaak object op basis van het aanleidingevende klantcontact url - in: query - name: aanleidinggevend_klantcontact__uuid + name: aanleidinggevendKlantcontact__uuid schema: type: string format: uuid @@ -1261,18 +1261,18 @@ paths: * `te_verwerken` - Het verzoek is afgehandeld. * `verwerkt` - Het verzoek ID buiten behandeling gesteld. - in: query - name: toegewezen_aan_actor__url + name: toegewezenAanActor__url schema: type: string description: Zoek internetaak object op basis van het toegewezen actor url - in: query - name: toegewezen_aan_actor__uuid + name: toegewezenAanActor__uuid schema: type: string format: uuid description: Zoek internetaak object op basis van het toegewezen actor uuid - in: query - name: toegewezen_op + name: toegewezenOp schema: type: string format: date-time @@ -1439,18 +1439,18 @@ paths: explode: false style: form - in: query - name: had_betrokkene__url + name: hadBetrokkene__url schema: type: string description: Zoek klantcontact object op basis van het betrokkene url - in: query - name: had_betrokkene__uuid + name: hadBetrokkene__uuid schema: type: string format: uuid description: Zoek klantcontact object op basis van het betrokkene uuid - in: query - name: indicatie_contact_gelukt + name: indicatieContactGelukt schema: type: boolean - in: query @@ -1472,19 +1472,19 @@ paths: type: string description: Zoek klantcontacten met specifieke tekst in onderwerp - in: query - name: onderwerpobject__onderwerpobjectidentificator_code_objecttype + name: onderwerpobject__onderwerpobjectidentificatorCodeObjecttype schema: type: string - in: query - name: onderwerpobject__onderwerpobjectidentificator_code_register + name: onderwerpobject__onderwerpobjectidentificatorCodeRegister schema: type: string - in: query - name: onderwerpobject__onderwerpobjectidentificator_code_soort_object_id + name: onderwerpobject__onderwerpobjectidentificatorCodeSoortObjectId schema: type: string - in: query - name: onderwerpobject__onderwerpobjectidentificator_object_id + name: onderwerpobject__onderwerpobjectidentificatorObjectId schema: type: string - in: query @@ -1504,7 +1504,7 @@ paths: schema: type: integer - in: query - name: plaatsgevonden_op + name: plaatsgevondenOp schema: type: string format: date-time @@ -1513,29 +1513,29 @@ paths: schema: type: boolean - in: query - name: was_onderwerpobject__onderwerpobjectidentificator_code_objecttype + name: wasOnderwerpobject__onderwerpobjectidentificatorCodeObjecttype schema: type: string - in: query - name: was_onderwerpobject__onderwerpobjectidentificator_code_register + name: wasOnderwerpobject__onderwerpobjectidentificatorCodeRegister schema: type: string - in: query - name: was_onderwerpobject__onderwerpobjectidentificator_code_soort_object_id + name: wasOnderwerpobject__onderwerpobjectidentificatorCodeSoortObjectId schema: type: string - in: query - name: was_onderwerpobject__onderwerpobjectidentificator_object_id + name: wasOnderwerpobject__onderwerpobjectidentificatorObjectId schema: type: string - in: query - name: was_onderwerpobject__url + name: wasOnderwerpobject__url schema: type: string description: Zoek was klantcontact object op basis van het onderwerpobject url - in: query - name: was_onderwerpobject__uuid + name: wasOnderwerpobject__uuid schema: type: string format: uuid @@ -1682,19 +1682,19 @@ paths: summary: Alle onderwerpobject opvragen. parameters: - in: query - name: onderwerpobjectidentificator_code_objecttype + name: onderwerpobjectidentificatorCodeObjecttype schema: type: string - in: query - name: onderwerpobjectidentificator_code_register + name: onderwerpobjectidentificatorCodeRegister schema: type: string - in: query - name: onderwerpobjectidentificator_code_soort_object_id + name: onderwerpobjectidentificatorCodeSoortObjectId schema: type: string - in: query - name: onderwerpobjectidentificator_object_id + name: onderwerpobjectidentificatorObjectId schema: type: string - name: page @@ -1842,7 +1842,7 @@ paths: summary: Alle partij-identificatoren opvragen. parameters: - in: query - name: andere_partij_identificator + name: anderePartijIdentificator schema: type: string - name: page @@ -1852,19 +1852,19 @@ paths: schema: type: integer - in: query - name: partij_identificator_code_objecttype + name: partijIdentificatorCodeObjecttype schema: type: string - in: query - name: partij_identificator_code_register + name: partijIdentificatorCodeRegister schema: type: string - in: query - name: partij_identificator_code_soort_object_id + name: partijIdentificatorCodeSoortObjectId schema: type: string - in: query - name: partij_identificator_object_id + name: partijIdentificatorObjectId schema: type: string tags: @@ -2006,23 +2006,23 @@ paths: summary: Alle partijen opvragen. parameters: - in: query - name: bezoekadres_adresregel1 + name: bezoekadresAdresregel1 schema: type: string - in: query - name: bezoekadres_adresregel2 + name: bezoekadresAdresregel2 schema: type: string - in: query - name: bezoekadres_adresregel3 + name: bezoekadresAdresregel3 schema: type: string - in: query - name: bezoekadres_land + name: bezoekadresLand schema: type: string - in: query - name: bezoekadres_nummeraanduiding_id + name: bezoekadresNummeraanduidingId schema: type: string - in: query @@ -2031,23 +2031,23 @@ paths: type: string description: Zoek partij object op basis van categorie namen. - in: query - name: correspondentieadres_adresregel1 + name: correspondentieadresAdresregel1 schema: type: string - in: query - name: correspondentieadres_adresregel2 + name: correspondentieadresAdresregel2 schema: type: string - in: query - name: correspondentieadres_adresregel3 + name: correspondentieadresAdresregel3 schema: type: string - in: query - name: correspondentieadres_land + name: correspondentieadresLand schema: type: string - in: query - name: correspondentieadres_nummeraanduiding_id + name: correspondentieadresNummeraanduidingId schema: type: string - in: query @@ -2071,11 +2071,11 @@ paths: explode: false style: form - in: query - name: indicatie_actief + name: indicatieActief schema: type: boolean - in: query - name: indicatie_geheimhouding + name: indicatieGeheimhouding schema: type: boolean - in: query @@ -2089,29 +2089,29 @@ paths: schema: type: integer - in: query - name: partij_identificator__code_objecttype + name: partijIdentificator__codeObjecttype schema: type: string description: Zoek partij object op basis van het partij identificator objecttype - in: query - name: partij_identificator__code_register + name: partijIdentificator__codeRegister schema: type: string description: Zoek partij object op basis van het partij identificator register - in: query - name: partij_identificator__code_soort_object_id + name: partijIdentificator__codeSoortObjectId schema: type: string description: Zoek partij object op basis van het partij identificator soort object ID - in: query - name: partij_identificator__object_id + name: partijIdentificator__objectId schema: type: string description: Zoek partij object op basis van het partij identificator object ID - in: query - name: soort_partij + name: soortPartij schema: type: string enum: @@ -2125,13 +2125,13 @@ paths: * `organisatie` - Organisatie * `contactpersoon` - Contactpersoon - in: query - name: vertegenwoordigde_partij__url + name: vertegenwoordigdePartij__url schema: type: string description: Zoek partij object op basis van het vertegenwoordigde partij url - in: query - name: vertegenwoordigde_partij__uuid + name: vertegenwoordigdePartij__uuid schema: type: string format: uuid @@ -2282,24 +2282,24 @@ paths: schema: type: integer - in: query - name: vertegenwoordigde_partij__url + name: vertegenwoordigdePartij__url schema: type: string description: Zoek Vertegenwoordigden object op basis van het vertegenwoordigde partij url - in: query - name: vertegenwoordigde_partij__uuid + name: vertegenwoordigdePartij__uuid schema: type: string format: uuid - in: query - name: vertegenwoordigende_partij__url + name: vertegenwoordigendePartij__url schema: type: string description: Zoek Vertegenwoordigden object op basis van het vertegenwoordigende partij url - in: query - name: vertegenwoordigende_partij__uuid + name: vertegenwoordigendePartij__uuid schema: type: string format: uuid diff --git a/src/openklant/components/utils/camilize.py b/src/openklant/components/utils/camilize.py deleted file mode 100644 index 39a9860b..00000000 --- a/src/openklant/components/utils/camilize.py +++ /dev/null @@ -1,48 +0,0 @@ -import re -from collections import OrderedDict - -from django.utils.encoding import force_text -from django.utils.functional import Promise - -from djangorestframework_camel_case.settings import api_settings -from djangorestframework_camel_case.util import is_iterable, underscore_to_camel -from rest_framework.utils.serializer_helpers import ReturnDict - -camelize_re = re.compile(r"[a-z0-9]?_[a-z0-9]") - - -def camelize(data, **options): - # Handle lazy translated strings. - ignore_fields = options.get("ignore_fields") or () - ignore_keys = options.get("ignore_keys") or () - - if isinstance(data, Promise): - data = force_text(data) - if isinstance(data, dict): - if isinstance(data, ReturnDict): - new_dict = ReturnDict(serializer=data.serializer) - else: - new_dict = OrderedDict() - for key, value in data.items(): - if isinstance(key, Promise): - key = force_text(key) - # added ignore_keys validation check - if key not in ignore_keys and isinstance(key, str) and "_" in key: - new_key = re.sub(camelize_re, underscore_to_camel, key) - else: - new_key = key - if key not in ignore_fields and new_key not in ignore_fields: - new_dict[new_key] = camelize(value, **options) - else: - new_dict[new_key] = value - return new_dict - if is_iterable(data) and not isinstance(data, str): - return [camelize(item, **options) for item in data] - return data - - -class CamelCaseJSONRenderer(api_settings.RENDERER_CLASS): - def render(self, data, *args, **kwargs): - return super().render( - camelize(data, **api_settings.JSON_UNDERSCOREIZE), *args, **kwargs - ) diff --git a/src/openklant/components/utils/expansion.py b/src/openklant/components/utils/expansion.py index 10b18ed2..88c099ec 100644 --- a/src/openklant/components/utils/expansion.py +++ b/src/openklant/components/utils/expansion.py @@ -6,6 +6,7 @@ from django.db import models from django.utils.module_loading import import_string +from djangorestframework_camel_case.render import CamelCaseJSONRenderer from rest_framework.serializers import ( BaseSerializer, Field, @@ -24,8 +25,6 @@ snake_to_camel_converter, ) -from .camilize import CamelCaseJSONRenderer - logger = logging.getLogger(__name__) EXPAND_KEY = "_expand" diff --git a/src/openklant/utils/apps.py b/src/openklant/utils/apps.py index 7f7511a2..1e2844d3 100644 --- a/src/openklant/utils/apps.py +++ b/src/openklant/utils/apps.py @@ -5,4 +5,4 @@ class UtilsConfig(AppConfig): name = "openklant.utils" def ready(self): - from . import checks # noqa + from . import checks, query # noqa diff --git a/src/openklant/utils/query.py b/src/openklant/utils/query.py new file mode 100644 index 00000000..2fd3b3c2 --- /dev/null +++ b/src/openklant/utils/query.py @@ -0,0 +1,21 @@ +# SPDX-License-Identifier: EUPL-1.2 +# Copyright (C) 2024 Dimpact +from drf_spectacular.contrib.django_filters import DjangoFilterExtension +from vng_api_common.utils import underscore_to_camel + + +class CamelizeFilterExtension(DjangoFilterExtension): + priority = 1 + + def get_schema_operation_parameters(self, auto_schema, *args, **kwargs): + """ + camelize query parameters + """ + parameters = super().get_schema_operation_parameters( + auto_schema, *args, **kwargs + ) + + for parameter in parameters: + parameter["name"] = underscore_to_camel(parameter["name"]) + + return parameters