Skip to content

Commit e848392

Browse files
Feature/233 fix values partij identificatoren (#291)
* [#233] Fix values partij identificatoren [#233] Fix tests [#233] Install django-digid-eherkenning [#233] Fix tests [#233] Improve Validator [#233] Fix tests [#233] Isort and Flake8 [#233] Improvements [#233] Remove django-digid-eherkenning [#233] Fix requirements [#233] Fix requirements 2 [#233] Fix tests [#233] Flake8 [#233] Fix validation errors [#233] Update class [#233] Remove unused import [#233] Update klantinteracties.json and help_text in migrations [#233] Update overig constants [#233] Pass variables through constructor [#233] Change PartijIdentificatorValidator call [#233] Use validators from vng_api_commons [#233] Fix import [#233] Fix validate api [#233] Fix REGISTERS structure [#233] Fix tests [#233] Improve validator [#233] Fix messages [#233] Fix Flake [#233] Update kvk_nummer naming [#233] Update vestigingsnummer naming [#233] Update some names [#233] Update some names [#233] Update migration file [#233] Update naming [#233] Fix test messages [#233] Fix some tests [#233] Improve error message [#233] Fix third level check [#233] Fix partij_identificator_object_id message [#233] Fix tests and pre-merge [#233] Update migrations [#233] bin/generate_schema_for_component.sh klantinteracties and contactgegevens [#233] Fix test [#233] Fix test messages and create new [#233] Change dict in list * [#233] Fix master conflicts
1 parent f3aed0d commit e848392

File tree

14 files changed

+1516
-541
lines changed

14 files changed

+1516
-541
lines changed

requirements/base.txt

+6-16
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ click-plugins==1.1.1
5757
# via celery
5858
click-repl==0.3.0
5959
# via celery
60-
commonground-api-common==2.1.2
60+
commonground-api-common==2.4.1
6161
# via open-api-framework
6262
coreapi==2.3.3
6363
# via commonground-api-common
@@ -100,7 +100,6 @@ django==4.2.17
100100
# drf-nested-routers
101101
# drf-spectacular
102102
# drf-spectacular-sidecar
103-
# drf-yasg
104103
# maykin-2fa
105104
# mozilla-django-oidc
106105
# mozilla-django-oidc-db
@@ -172,7 +171,6 @@ djangorestframework==3.15.2
172171
# djangorestframework-inclusions
173172
# drf-nested-routers
174173
# drf-spectacular
175-
# drf-yasg
176174
# notifications-api-common
177175
# open-api-framework
178176
djangorestframework-camel-case==1.4.2
@@ -186,11 +184,11 @@ djangorestframework-inclusions==1.2.0
186184
drf-nested-routers==0.94.1
187185
# via commonground-api-common
188186
drf-spectacular==0.27.2
189-
# via open-api-framework
187+
# via
188+
# commonground-api-common
189+
# open-api-framework
190190
drf-spectacular-sidecar==2024.7.1
191191
# via drf-spectacular
192-
drf-yasg==1.21.7
193-
# via commonground-api-common
194192
ecs-logging==2.2.0
195193
# via elastic-apm
196194
elastic-apm==6.23.0
@@ -208,9 +206,7 @@ humanize==4.10.0
208206
idna==3.7
209207
# via requests
210208
inflection==0.5.1
211-
# via
212-
# drf-spectacular
213-
# drf-yasg
209+
# via drf-spectacular
214210
iso-639==0.4.5
215211
# via commonground-api-common
216212
isodate==0.6.1
@@ -245,8 +241,6 @@ orderedmultidict==1.0.1
245241
# via furl
246242
oyaml==1.0
247243
# via commonground-api-common
248-
packaging==24.1
249-
# via drf-yasg
250244
phonenumberslite==8.13.42
251245
# via django-two-factor-auth
252246
prometheus-client==0.20.0
@@ -286,13 +280,10 @@ python-dotenv==1.0.1
286280
# open-api-framework
287281
# pydantic-settings
288282
pytz==2024.1
289-
# via
290-
# drf-yasg
291-
# flower
283+
# via flower
292284
pyyaml==6.0.1
293285
# via
294286
# drf-spectacular
295-
# drf-yasg
296287
# oyaml
297288
# pydantic-settings
298289
qrcode==7.4.2
@@ -345,7 +336,6 @@ uritemplate==4.1.1
345336
# via
346337
# coreapi
347338
# drf-spectacular
348-
# drf-yasg
349339
urllib3==2.2.2
350340
# via
351341
# elastic-apm

requirements/ci.txt

+2-15
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ click-repl==0.3.0
117117
# celery
118118
codecov==2.1.13
119119
# via -r requirements/test-tools.in
120-
commonground-api-common==2.1.2
120+
commonground-api-common==2.4.1
121121
# via
122122
# -c requirements/base.txt
123123
# -r requirements/base.txt
@@ -181,7 +181,6 @@ django==4.2.17
181181
# drf-nested-routers
182182
# drf-spectacular
183183
# drf-spectacular-sidecar
184-
# drf-yasg
185184
# maykin-2fa
186185
# mozilla-django-oidc
187186
# mozilla-django-oidc-db
@@ -320,7 +319,6 @@ djangorestframework==3.15.2
320319
# djangorestframework-inclusions
321320
# drf-nested-routers
322321
# drf-spectacular
323-
# drf-yasg
324322
# notifications-api-common
325323
# open-api-framework
326324
djangorestframework-camel-case==1.4.2
@@ -354,17 +352,13 @@ drf-spectacular==0.27.2
354352
# via
355353
# -c requirements/base.txt
356354
# -r requirements/base.txt
355+
# commonground-api-common
357356
# open-api-framework
358357
drf-spectacular-sidecar==2024.7.1
359358
# via
360359
# -c requirements/base.txt
361360
# -r requirements/base.txt
362361
# drf-spectacular
363-
drf-yasg==1.21.7
364-
# via
365-
# -c requirements/base.txt
366-
# -r requirements/base.txt
367-
# commonground-api-common
368362
ecs-logging==2.2.0
369363
# via
370364
# -c requirements/base.txt
@@ -421,7 +415,6 @@ inflection==0.5.1
421415
# -c requirements/base.txt
422416
# -r requirements/base.txt
423417
# drf-spectacular
424-
# drf-yasg
425418
iniconfig==2.0.0
426419
# via pytest
427420
iso-639==0.4.5
@@ -522,10 +515,7 @@ oyaml==1.0
522515
# commonground-api-common
523516
packaging==24.1
524517
# via
525-
# -c requirements/base.txt
526-
# -r requirements/base.txt
527518
# black
528-
# drf-yasg
529519
# pytest
530520
# sphinx
531521
pathspec==0.12.1
@@ -633,14 +623,12 @@ pytz==2024.1
633623
# via
634624
# -c requirements/base.txt
635625
# -r requirements/base.txt
636-
# drf-yasg
637626
# flower
638627
pyyaml==6.0.1
639628
# via
640629
# -c requirements/base.txt
641630
# -r requirements/base.txt
642631
# drf-spectacular
643-
# drf-yasg
644632
# oyaml
645633
# pydantic-settings
646634
# vcrpy
@@ -768,7 +756,6 @@ uritemplate==4.1.1
768756
# -r requirements/base.txt
769757
# coreapi
770758
# drf-spectacular
771-
# drf-yasg
772759
urllib3==2.2.2
773760
# via
774761
# -c requirements/base.txt

requirements/dev.txt

+2-13
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ codecov==2.1.13
138138
# via
139139
# -c requirements/ci.txt
140140
# -r requirements/ci.txt
141-
commonground-api-common==2.1.2
141+
commonground-api-common==2.4.1
142142
# via
143143
# -c requirements/ci.txt
144144
# -r requirements/ci.txt
@@ -216,7 +216,6 @@ django==4.2.17
216216
# drf-nested-routers
217217
# drf-spectacular
218218
# drf-spectacular-sidecar
219-
# drf-yasg
220219
# maykin-2fa
221220
# mozilla-django-oidc
222221
# mozilla-django-oidc-db
@@ -361,7 +360,6 @@ djangorestframework==3.15.2
361360
# djangorestframework-inclusions
362361
# drf-nested-routers
363362
# drf-spectacular
364-
# drf-yasg
365363
# notifications-api-common
366364
# open-api-framework
367365
djangorestframework-camel-case==1.4.2
@@ -397,17 +395,13 @@ drf-spectacular==0.27.2
397395
# via
398396
# -c requirements/ci.txt
399397
# -r requirements/ci.txt
398+
# commonground-api-common
400399
# open-api-framework
401400
drf-spectacular-sidecar==2024.7.1
402401
# via
403402
# -c requirements/ci.txt
404403
# -r requirements/ci.txt
405404
# drf-spectacular
406-
drf-yasg==1.21.7
407-
# via
408-
# -c requirements/ci.txt
409-
# -r requirements/ci.txt
410-
# commonground-api-common
411405
ecs-logging==2.2.0
412406
# via
413407
# -c requirements/ci.txt
@@ -480,7 +474,6 @@ inflection==0.5.1
480474
# -c requirements/ci.txt
481475
# -r requirements/ci.txt
482476
# drf-spectacular
483-
# drf-yasg
484477
iniconfig==2.0.0
485478
# via
486479
# -c requirements/ci.txt
@@ -603,7 +596,6 @@ packaging==24.1
603596
# -r requirements/ci.txt
604597
# black
605598
# build
606-
# drf-yasg
607599
# pytest
608600
# sphinx
609601
pathspec==0.12.1
@@ -743,14 +735,12 @@ pytz==2024.1
743735
# via
744736
# -c requirements/ci.txt
745737
# -r requirements/ci.txt
746-
# drf-yasg
747738
# flower
748739
pyyaml==6.0.1
749740
# via
750741
# -c requirements/ci.txt
751742
# -r requirements/ci.txt
752743
# drf-spectacular
753-
# drf-yasg
754744
# oyaml
755745
# pydantic-settings
756746
# vcrpy
@@ -923,7 +913,6 @@ uritemplate==4.1.1
923913
# -r requirements/ci.txt
924914
# coreapi
925915
# drf-spectacular
926-
# drf-yasg
927916
urllib3==2.2.2
928917
# via
929918
# -c requirements/ci.txt

src/openklant/components/contactgegevens/openapi.yaml

+8-24
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,8 @@ components:
340340
format: uri
341341
readOnly: true
342342
description: De unieke URL van deze actor binnen deze API.
343+
minLength: 1
344+
maxLength: 1000
343345
handelsnaam:
344346
type: string
345347
description: De naam waaronder een bedrijf of vestiging handelt.
@@ -375,18 +377,6 @@ components:
375377
- uuid
376378
OrganisatieAdres:
377379
type: object
378-
description: |-
379-
Generate a serializer out of a GegevensGroepType.
380-
381-
Usage::
382-
383-
>>> class VerlengingSerializer(GegevensGroepSerializer):
384-
... class Meta:
385-
... model = Zaak
386-
... gegevensgroep = 'verlenging'
387-
>>>
388-
389-
Where ``Zaak.verlenging`` is a :class:``GegevensGroepType``.
390380
properties:
391381
nummeraanduidingId:
392382
type: string
@@ -477,6 +467,8 @@ components:
477467
format: uri
478468
readOnly: true
479469
description: De unieke URL van deze actor binnen deze API.
470+
minLength: 1
471+
maxLength: 1000
480472
handelsnaam:
481473
type: string
482474
description: De naam waaronder een bedrijf of vestiging handelt.
@@ -523,6 +515,8 @@ components:
523515
format: uri
524516
readOnly: true
525517
description: De unieke URL van deze organisatie binnen deze API.
518+
minLength: 1
519+
maxLength: 1000
526520
geboortedatum:
527521
type: string
528522
format: date
@@ -587,6 +581,8 @@ components:
587581
format: uri
588582
readOnly: true
589583
description: De unieke URL van deze organisatie binnen deze API.
584+
minLength: 1
585+
maxLength: 1000
590586
geboortedatum:
591587
type: string
592588
format: date
@@ -641,18 +637,6 @@ components:
641637
- uuid
642638
PersoonAdres:
643639
type: object
644-
description: |-
645-
Generate a serializer out of a GegevensGroepType.
646-
647-
Usage::
648-
649-
>>> class VerlengingSerializer(GegevensGroepSerializer):
650-
... class Meta:
651-
... model = Zaak
652-
... gegevensgroep = 'verlenging'
653-
>>>
654-
655-
Where ``Zaak.verlenging`` is a :class:``GegevensGroepType``.
656640
properties:
657641
nummeraanduidingId:
658642
type: string

src/openklant/components/klantinteracties/api/serializers/partijen.py

+14
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@
4242
Vertegenwoordigden,
4343
)
4444
from openklant.components.klantinteracties.models.rekeningnummers import Rekeningnummer
45+
from openklant.components.klantinteracties.models.validators import (
46+
PartijIdentificatorValidator,
47+
)
48+
from openklant.utils.serializers import get_field_value
4549

4650

4751
class PartijForeignkeyBaseSerializer(serializers.HyperlinkedModelSerializer):
@@ -399,6 +403,16 @@ class Meta:
399403
},
400404
}
401405

406+
def validate(self, attrs):
407+
partij_identificator = get_field_value(self, attrs, "partij_identificator")
408+
PartijIdentificatorValidator(
409+
code_register=partij_identificator["code_register"],
410+
code_objecttype=partij_identificator["code_objecttype"],
411+
code_soort_object_id=partij_identificator["code_soort_object_id"],
412+
object_id=partij_identificator["object_id"],
413+
).validate()
414+
return super().validate(attrs)
415+
402416
@transaction.atomic
403417
def update(self, instance, validated_data):
404418
if "partij" in validated_data:

0 commit comments

Comments
 (0)