Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Feature/233 fix values partij identificatoren #291

Merged
merged 2 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 6 additions & 16 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ click-plugins==1.1.1
# via celery
click-repl==0.3.0
# via celery
commonground-api-common==2.1.2
commonground-api-common==2.4.1
# via open-api-framework
coreapi==2.3.3
# via commonground-api-common
Expand Down Expand Up @@ -100,7 +100,6 @@ django==4.2.17
# drf-nested-routers
# drf-spectacular
# drf-spectacular-sidecar
# drf-yasg
# maykin-2fa
# mozilla-django-oidc
# mozilla-django-oidc-db
Expand Down Expand Up @@ -172,7 +171,6 @@ djangorestframework==3.15.2
# djangorestframework-inclusions
# drf-nested-routers
# drf-spectacular
# drf-yasg
# notifications-api-common
# open-api-framework
djangorestframework-camel-case==1.4.2
Expand All @@ -186,11 +184,11 @@ djangorestframework-inclusions==1.2.0
drf-nested-routers==0.94.1
# via commonground-api-common
drf-spectacular==0.27.2
# via open-api-framework
# via
# commonground-api-common
# open-api-framework
drf-spectacular-sidecar==2024.7.1
# via drf-spectacular
drf-yasg==1.21.7
# via commonground-api-common
ecs-logging==2.2.0
# via elastic-apm
elastic-apm==6.23.0
Expand All @@ -208,9 +206,7 @@ humanize==4.10.0
idna==3.7
# via requests
inflection==0.5.1
# via
# drf-spectacular
# drf-yasg
# via drf-spectacular
iso-639==0.4.5
# via commonground-api-common
isodate==0.6.1
Expand Down Expand Up @@ -245,8 +241,6 @@ orderedmultidict==1.0.1
# via furl
oyaml==1.0
# via commonground-api-common
packaging==24.1
# via drf-yasg
phonenumberslite==8.13.42
# via django-two-factor-auth
prometheus-client==0.20.0
Expand Down Expand Up @@ -286,13 +280,10 @@ python-dotenv==1.0.1
# open-api-framework
# pydantic-settings
pytz==2024.1
# via
# drf-yasg
# flower
# via flower
pyyaml==6.0.1
# via
# drf-spectacular
# drf-yasg
# oyaml
# pydantic-settings
qrcode==7.4.2
Expand Down Expand Up @@ -345,7 +336,6 @@ uritemplate==4.1.1
# via
# coreapi
# drf-spectacular
# drf-yasg
urllib3==2.2.2
# via
# elastic-apm
Expand Down
17 changes: 2 additions & 15 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ click-repl==0.3.0
# celery
codecov==2.1.13
# via -r requirements/test-tools.in
commonground-api-common==2.1.2
commonground-api-common==2.4.1
# via
# -c requirements/base.txt
# -r requirements/base.txt
Expand Down Expand Up @@ -181,7 +181,6 @@ django==4.2.17
# drf-nested-routers
# drf-spectacular
# drf-spectacular-sidecar
# drf-yasg
# maykin-2fa
# mozilla-django-oidc
# mozilla-django-oidc-db
Expand Down Expand Up @@ -320,7 +319,6 @@ djangorestframework==3.15.2
# djangorestframework-inclusions
# drf-nested-routers
# drf-spectacular
# drf-yasg
# notifications-api-common
# open-api-framework
djangorestframework-camel-case==1.4.2
Expand Down Expand Up @@ -354,17 +352,13 @@ drf-spectacular==0.27.2
# via
# -c requirements/base.txt
# -r requirements/base.txt
# commonground-api-common
# open-api-framework
drf-spectacular-sidecar==2024.7.1
# via
# -c requirements/base.txt
# -r requirements/base.txt
# drf-spectacular
drf-yasg==1.21.7
# via
# -c requirements/base.txt
# -r requirements/base.txt
# commonground-api-common
ecs-logging==2.2.0
# via
# -c requirements/base.txt
Expand Down Expand Up @@ -421,7 +415,6 @@ inflection==0.5.1
# -c requirements/base.txt
# -r requirements/base.txt
# drf-spectacular
# drf-yasg
iniconfig==2.0.0
# via pytest
iso-639==0.4.5
Expand Down Expand Up @@ -522,10 +515,7 @@ oyaml==1.0
# commonground-api-common
packaging==24.1
# via
# -c requirements/base.txt
# -r requirements/base.txt
# black
# drf-yasg
# pytest
# sphinx
pathspec==0.12.1
Expand Down Expand Up @@ -633,14 +623,12 @@ pytz==2024.1
# via
# -c requirements/base.txt
# -r requirements/base.txt
# drf-yasg
# flower
pyyaml==6.0.1
# via
# -c requirements/base.txt
# -r requirements/base.txt
# drf-spectacular
# drf-yasg
# oyaml
# pydantic-settings
# vcrpy
Expand Down Expand Up @@ -768,7 +756,6 @@ uritemplate==4.1.1
# -r requirements/base.txt
# coreapi
# drf-spectacular
# drf-yasg
urllib3==2.2.2
# via
# -c requirements/base.txt
Expand Down
15 changes: 2 additions & 13 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ codecov==2.1.13
# via
# -c requirements/ci.txt
# -r requirements/ci.txt
commonground-api-common==2.1.2
commonground-api-common==2.4.1
# via
# -c requirements/ci.txt
# -r requirements/ci.txt
Expand Down Expand Up @@ -216,7 +216,6 @@ django==4.2.17
# drf-nested-routers
# drf-spectacular
# drf-spectacular-sidecar
# drf-yasg
# maykin-2fa
# mozilla-django-oidc
# mozilla-django-oidc-db
Expand Down Expand Up @@ -361,7 +360,6 @@ djangorestframework==3.15.2
# djangorestframework-inclusions
# drf-nested-routers
# drf-spectacular
# drf-yasg
# notifications-api-common
# open-api-framework
djangorestframework-camel-case==1.4.2
Expand Down Expand Up @@ -397,17 +395,13 @@ drf-spectacular==0.27.2
# via
# -c requirements/ci.txt
# -r requirements/ci.txt
# commonground-api-common
# open-api-framework
drf-spectacular-sidecar==2024.7.1
# via
# -c requirements/ci.txt
# -r requirements/ci.txt
# drf-spectacular
drf-yasg==1.21.7
# via
# -c requirements/ci.txt
# -r requirements/ci.txt
# commonground-api-common
ecs-logging==2.2.0
# via
# -c requirements/ci.txt
Expand Down Expand Up @@ -480,7 +474,6 @@ inflection==0.5.1
# -c requirements/ci.txt
# -r requirements/ci.txt
# drf-spectacular
# drf-yasg
iniconfig==2.0.0
# via
# -c requirements/ci.txt
Expand Down Expand Up @@ -603,7 +596,6 @@ packaging==24.1
# -r requirements/ci.txt
# black
# build
# drf-yasg
# pytest
# sphinx
pathspec==0.12.1
Expand Down Expand Up @@ -743,14 +735,12 @@ pytz==2024.1
# via
# -c requirements/ci.txt
# -r requirements/ci.txt
# drf-yasg
# flower
pyyaml==6.0.1
# via
# -c requirements/ci.txt
# -r requirements/ci.txt
# drf-spectacular
# drf-yasg
# oyaml
# pydantic-settings
# vcrpy
Expand Down Expand Up @@ -923,7 +913,6 @@ uritemplate==4.1.1
# -r requirements/ci.txt
# coreapi
# drf-spectacular
# drf-yasg
urllib3==2.2.2
# via
# -c requirements/ci.txt
Expand Down
32 changes: 8 additions & 24 deletions src/openklant/components/contactgegevens/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,8 @@ components:
format: uri
readOnly: true
description: De unieke URL van deze actor binnen deze API.
minLength: 1
maxLength: 1000
handelsnaam:
type: string
description: De naam waaronder een bedrijf of vestiging handelt.
Expand Down Expand Up @@ -375,18 +377,6 @@ components:
- uuid
OrganisatieAdres:
type: object
description: |-
Generate a serializer out of a GegevensGroepType.

Usage::

>>> class VerlengingSerializer(GegevensGroepSerializer):
... class Meta:
... model = Zaak
... gegevensgroep = 'verlenging'
>>>

Where ``Zaak.verlenging`` is a :class:``GegevensGroepType``.
properties:
nummeraanduidingId:
type: string
Expand Down Expand Up @@ -477,6 +467,8 @@ components:
format: uri
readOnly: true
description: De unieke URL van deze actor binnen deze API.
minLength: 1
maxLength: 1000
handelsnaam:
type: string
description: De naam waaronder een bedrijf of vestiging handelt.
Expand Down Expand Up @@ -523,6 +515,8 @@ components:
format: uri
readOnly: true
description: De unieke URL van deze organisatie binnen deze API.
minLength: 1
maxLength: 1000
geboortedatum:
type: string
format: date
Expand Down Expand Up @@ -587,6 +581,8 @@ components:
format: uri
readOnly: true
description: De unieke URL van deze organisatie binnen deze API.
minLength: 1
maxLength: 1000
geboortedatum:
type: string
format: date
Expand Down Expand Up @@ -641,18 +637,6 @@ components:
- uuid
PersoonAdres:
type: object
description: |-
Generate a serializer out of a GegevensGroepType.

Usage::

>>> class VerlengingSerializer(GegevensGroepSerializer):
... class Meta:
... model = Zaak
... gegevensgroep = 'verlenging'
>>>

Where ``Zaak.verlenging`` is a :class:``GegevensGroepType``.
properties:
nummeraanduidingId:
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
Vertegenwoordigden,
)
from openklant.components.klantinteracties.models.rekeningnummers import Rekeningnummer
from openklant.components.klantinteracties.models.validators import (
PartijIdentificatorValidator,
)
from openklant.utils.serializers import get_field_value


class PartijForeignkeyBaseSerializer(serializers.HyperlinkedModelSerializer):
Expand Down Expand Up @@ -399,6 +403,16 @@ class Meta:
},
}

def validate(self, attrs):
partij_identificator = get_field_value(self, attrs, "partij_identificator")
PartijIdentificatorValidator(
code_register=partij_identificator["code_register"],
code_objecttype=partij_identificator["code_objecttype"],
code_soort_object_id=partij_identificator["code_soort_object_id"],
object_id=partij_identificator["object_id"],
).validate()
return super().validate(attrs)

@transaction.atomic
def update(self, instance, validated_data):
if "partij" in validated_data:
Expand Down
Loading
Loading