Skip to content

Commit 06541ab

Browse files
authored
Merge pull request #1521 from maykinmedia/task/2923-openklant2-update
[#2923] Update OpenKlant2 code/tests for OpenKlant v2.4
2 parents a28b61a + e2cff67 commit 06541ab

File tree

70 files changed

+7796
-11176
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+7796
-11176
lines changed

src/open_inwoner/openklant/services.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,7 @@ def filter_digitale_addressen_for_partij(
10541054
def get_or_create_digitaal_adres(
10551055
self,
10561056
partij_uuid: str,
1057-
soortAdres: Literal["email", "telefoon"],
1057+
soortAdres: Literal["email", "telefoonnummer"],
10581058
adres: str,
10591059
) -> tuple[DigitaalAdres, bool]:
10601060
digitale_adressen = self.filter_digitale_addressen_for_partij(
@@ -1092,7 +1092,7 @@ def update_user_from_partij(self, partij_uuid: str, user: User):
10921092
update_data["email"] = email
10931093

10941094
if phone_adressen := self.filter_digitale_addressen_for_partij(
1095-
partij_uuid, soortDigitaalAdres="telefoon", adressen=adressen
1095+
partij_uuid, soortDigitaalAdres="telefoonnummer", adressen=adressen
10961096
):
10971097
update_data["phonenumber"] = phone_adressen[0]["adres"]
10981098

@@ -1108,7 +1108,10 @@ def update_user_from_partij(self, partij_uuid: str, user: User):
11081108

11091109
def update_partij_from_user(self, partij_uuid: str, user: User):
11101110
updated_fields = []
1111-
for attr, soort_adres in (("email", "email"), ("phonenumber", "telefoon")):
1111+
for attr, soort_adres in (
1112+
("email", "email"),
1113+
("phonenumber", "telefoonnummer"),
1114+
):
11121115
_, created = self.get_or_create_digitaal_adres(
11131116
partij_uuid,
11141117
soort_adres,

src/open_inwoner/openklant/tests/cassettes/Openklant2ServiceTest.test_cannot_use_existing_user_email_when_updating_user_from_partij.yaml

+47-17
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ interactions:
1616
uri: http://localhost:8338/klantinteracties/api/v1/partijen
1717
response:
1818
body:
19-
string: '{"uuid":"89424a8a-fc4e-41f2-81ed-d5cc21675c2b","url":"http://localhost:8338/klantinteracties/api/v1/partijen/89424a8a-fc4e-41f2-81ed-d5cc21675c2b","nummer":"0000000001","interneNotitie":"","betrokkenen":[],"categorieRelaties":[],"digitaleAdressen":[],"voorkeursDigitaalAdres":null,"vertegenwoordigden":[],"rekeningnummers":[],"voorkeursRekeningnummer":null,"partijIdentificatoren":[],"soortPartij":"persoon","indicatieGeheimhouding":false,"voorkeurstaal":"crp","indicatieActief":true,"bezoekadres":{"nummeraanduidingId":"","adresregel1":"","adresregel2":"","adresregel3":"","land":""},"correspondentieadres":{"nummeraanduidingId":"","adresregel1":"","adresregel2":"","adresregel3":"","land":""},"partijIdentificatie":{"contactnaam":{"voorletters":"Dr.","voornaam":"Test
19+
string: '{"uuid":"1e341bcb-d8e5-47be-b8c4-3ba0ddc205cd","url":"http://localhost:8338/klantinteracties/api/v1/partijen/1e341bcb-d8e5-47be-b8c4-3ba0ddc205cd","nummer":"0000000001","interneNotitie":"","betrokkenen":[],"categorieRelaties":[],"digitaleAdressen":[],"voorkeursDigitaalAdres":null,"vertegenwoordigden":[],"rekeningnummers":[],"voorkeursRekeningnummer":null,"partijIdentificatoren":[],"soortPartij":"persoon","indicatieGeheimhouding":false,"voorkeurstaal":"crp","indicatieActief":true,"bezoekadres":{"nummeraanduidingId":"","adresregel1":"","adresregel2":"","adresregel3":"","land":""},"correspondentieadres":{"nummeraanduidingId":"","adresregel1":"","adresregel2":"","adresregel3":"","land":""},"partijIdentificatie":{"contactnaam":{"voorletters":"Dr.","voornaam":"Test
2020
Persoon","voorvoegselAchternaam":"Mrs.","achternaam":"Gamble"},"volledigeNaam":"Test
2121
Persoon Mrs. Gamble"}}'
2222
headers:
@@ -26,12 +26,18 @@ interactions:
2626
- GET, POST, HEAD, OPTIONS
2727
Content-Length:
2828
- '877'
29+
Content-Security-Policy:
30+
- 'img-src ''self'' data: cdn.redoc.ly; base-uri ''self''; worker-src ''self''
31+
blob:; form-action ''self''; default-src ''self''; frame-ancestors ''none'';
32+
frame-src ''self''; font-src ''self'' fonts.gstatic.com; script-src ''self''
33+
''unsafe-inline''; object-src ''none''; style-src ''self'' ''unsafe-inline''
34+
fonts.googleapis.com'
2935
Content-Type:
3036
- application/json
3137
Cross-Origin-Opener-Policy:
3238
- same-origin
3339
Location:
34-
- http://localhost:8338/klantinteracties/api/v1/partijen/89424a8a-fc4e-41f2-81ed-d5cc21675c2b
40+
- http://localhost:8338/klantinteracties/api/v1/partijen/1e341bcb-d8e5-47be-b8c4-3ba0ddc205cd
3541
Referrer-Policy:
3642
- same-origin
3743
Vary:
@@ -44,7 +50,7 @@ interactions:
4450
code: 201
4551
message: Created
4652
- request:
47-
body: '{"identificeerdePartij": {"uuid": "89424a8a-fc4e-41f2-81ed-d5cc21675c2b"},
53+
body: '{"identificeerdePartij": {"uuid": "1e341bcb-d8e5-47be-b8c4-3ba0ddc205cd"},
4854
"partijIdentificator": {"codeObjecttype": "bsn", "codeSoortObjectId": "inp",
4955
"objectId": "123456789", "codeRegister": "brp"}, "anderePartijIdentificator":
5056
"optional_identifier_123"}'
@@ -59,20 +65,26 @@ interactions:
5965
uri: http://localhost:8338/klantinteracties/api/v1/partij-identificatoren
6066
response:
6167
body:
62-
string: '{"uuid":"350ed1a7-7551-4ed5-8fdf-cc95942d67e2","url":"http://localhost:8338/klantinteracties/api/v1/partij-identificatoren/350ed1a7-7551-4ed5-8fdf-cc95942d67e2","identificeerdePartij":{"uuid":"89424a8a-fc4e-41f2-81ed-d5cc21675c2b","url":"http://localhost:8338/klantinteracties/api/v1/partijen/89424a8a-fc4e-41f2-81ed-d5cc21675c2b"},"anderePartijIdentificator":"optional_identifier_123","partijIdentificator":{"codeObjecttype":"bsn","codeSoortObjectId":"inp","objectId":"123456789","codeRegister":"brp"}}'
68+
string: '{"uuid":"4a89747e-a56b-48d5-b90a-6b172f77e828","url":"http://localhost:8338/klantinteracties/api/v1/partij-identificatoren/4a89747e-a56b-48d5-b90a-6b172f77e828","identificeerdePartij":{"uuid":"1e341bcb-d8e5-47be-b8c4-3ba0ddc205cd","url":"http://localhost:8338/klantinteracties/api/v1/partijen/1e341bcb-d8e5-47be-b8c4-3ba0ddc205cd"},"anderePartijIdentificator":"optional_identifier_123","partijIdentificator":{"codeObjecttype":"bsn","codeSoortObjectId":"inp","objectId":"123456789","codeRegister":"brp"}}'
6369
headers:
6470
API-version:
6571
- 0.0.3
6672
Allow:
6773
- GET, POST, HEAD, OPTIONS
6874
Content-Length:
6975
- '503'
76+
Content-Security-Policy:
77+
- 'img-src ''self'' data: cdn.redoc.ly; base-uri ''self''; worker-src ''self''
78+
blob:; form-action ''self''; default-src ''self''; frame-ancestors ''none'';
79+
frame-src ''self''; font-src ''self'' fonts.gstatic.com; script-src ''self''
80+
''unsafe-inline''; object-src ''none''; style-src ''self'' ''unsafe-inline''
81+
fonts.googleapis.com'
7082
Content-Type:
7183
- application/json
7284
Cross-Origin-Opener-Policy:
7385
- same-origin
7486
Location:
75-
- http://localhost:8338/klantinteracties/api/v1/partij-identificatoren/350ed1a7-7551-4ed5-8fdf-cc95942d67e2
87+
- http://localhost:8338/klantinteracties/api/v1/partij-identificatoren/4a89747e-a56b-48d5-b90a-6b172f77e828
7688
Referrer-Policy:
7789
- same-origin
7890
Vary:
@@ -90,19 +102,25 @@ interactions:
90102
Authorization:
91103
- Token b2eb1da9861da88743d72a3fb4344288fe2cba44
92104
method: GET
93-
uri: http://localhost:8338/klantinteracties/api/v1/partijen/89424a8a-fc4e-41f2-81ed-d5cc21675c2b?expand=digitaleAdressen
105+
uri: http://localhost:8338/klantinteracties/api/v1/partijen/1e341bcb-d8e5-47be-b8c4-3ba0ddc205cd?expand=digitaleAdressen
94106
response:
95107
body:
96-
string: '{"uuid":"89424a8a-fc4e-41f2-81ed-d5cc21675c2b","url":"http://localhost:8338/klantinteracties/api/v1/partijen/89424a8a-fc4e-41f2-81ed-d5cc21675c2b","nummer":"0000000001","interneNotitie":"","betrokkenen":[],"categorieRelaties":[],"digitaleAdressen":[],"voorkeursDigitaalAdres":null,"vertegenwoordigden":[],"rekeningnummers":[],"voorkeursRekeningnummer":null,"partijIdentificatoren":[{"uuid":"350ed1a7-7551-4ed5-8fdf-cc95942d67e2","url":"http://localhost:8338/klantinteracties/api/v1/partij-identificatoren/350ed1a7-7551-4ed5-8fdf-cc95942d67e2"}],"soortPartij":"persoon","indicatieGeheimhouding":false,"voorkeurstaal":"crp","indicatieActief":true,"bezoekadres":{"nummeraanduidingId":"","adresregel1":"","adresregel2":"","adresregel3":"","land":""},"correspondentieadres":{"nummeraanduidingId":"","adresregel1":"","adresregel2":"","adresregel3":"","land":""},"partijIdentificatie":{"contactnaam":{"voorletters":"Dr.","voornaam":"Test
108+
string: '{"uuid":"1e341bcb-d8e5-47be-b8c4-3ba0ddc205cd","url":"http://localhost:8338/klantinteracties/api/v1/partijen/1e341bcb-d8e5-47be-b8c4-3ba0ddc205cd","nummer":"0000000001","interneNotitie":"","betrokkenen":[],"categorieRelaties":[],"digitaleAdressen":[],"voorkeursDigitaalAdres":null,"vertegenwoordigden":[],"rekeningnummers":[],"voorkeursRekeningnummer":null,"partijIdentificatoren":[{"uuid":"4a89747e-a56b-48d5-b90a-6b172f77e828","url":"http://localhost:8338/klantinteracties/api/v1/partij-identificatoren/4a89747e-a56b-48d5-b90a-6b172f77e828"}],"soortPartij":"persoon","indicatieGeheimhouding":false,"voorkeurstaal":"crp","indicatieActief":true,"bezoekadres":{"nummeraanduidingId":"","adresregel1":"","adresregel2":"","adresregel3":"","land":""},"correspondentieadres":{"nummeraanduidingId":"","adresregel1":"","adresregel2":"","adresregel3":"","land":""},"partijIdentificatie":{"contactnaam":{"voorletters":"Dr.","voornaam":"Test
97109
Persoon","voorvoegselAchternaam":"Mrs.","achternaam":"Gamble"},"volledigeNaam":"Test
98-
Persoon Mrs. Gamble"}}'
110+
Persoon Mrs. Gamble"},"_expand":{"digitaleAdressen":[]}}'
99111
headers:
100112
API-version:
101113
- 0.0.3
102114
Allow:
103115
- GET, PUT, PATCH, DELETE, HEAD, OPTIONS
104116
Content-Length:
105-
- '1038'
117+
- '1072'
118+
Content-Security-Policy:
119+
- 'img-src ''self'' data: cdn.redoc.ly; base-uri ''self''; worker-src ''self''
120+
blob:; form-action ''self''; default-src ''self''; frame-ancestors ''none'';
121+
frame-src ''self''; font-src ''self'' fonts.gstatic.com; script-src ''self''
122+
''unsafe-inline''; object-src ''none''; style-src ''self'' ''unsafe-inline''
123+
fonts.googleapis.com'
106124
Content-Type:
107125
- application/json
108126
Cross-Origin-Opener-Policy:
@@ -120,7 +138,7 @@ interactions:
120138
message: OK
121139
- request:
122140
body: '{"adres": "[email protected]", "soortDigitaalAdres": "email", "verstrektDoorPartij":
123-
{"uuid": "89424a8a-fc4e-41f2-81ed-d5cc21675c2b"}, "verstrektDoorBetrokkene":
141+
{"uuid": "1e341bcb-d8e5-47be-b8c4-3ba0ddc205cd"}, "verstrektDoorBetrokkene":
124142
null, "omschrijving": "OIP profiel"}'
125143
headers:
126144
Authorization:
@@ -133,21 +151,27 @@ interactions:
133151
uri: http://localhost:8338/klantinteracties/api/v1/digitaleadressen
134152
response:
135153
body:
136-
string: '{"uuid":"3cc1c616-a8dc-4d23-9ce4-8a3d15871309","url":"http://localhost:8338/klantinteracties/api/v1/digitaleadressen/3cc1c616-a8dc-4d23-9ce4-8a3d15871309","verstrektDoorBetrokkene":null,"verstrektDoorPartij":{"uuid":"89424a8a-fc4e-41f2-81ed-d5cc21675c2b","url":"http://localhost:8338/klantinteracties/api/v1/partijen/89424a8a-fc4e-41f2-81ed-d5cc21675c2b"},"adres":"[email protected]","soortDigitaalAdres":"email","omschrijving":"OIP
154+
string: '{"uuid":"2839f9df-b719-46ca-99bf-1ddbf576e250","url":"http://localhost:8338/klantinteracties/api/v1/digitaleadressen/2839f9df-b719-46ca-99bf-1ddbf576e250","verstrektDoorBetrokkene":null,"verstrektDoorPartij":{"uuid":"1e341bcb-d8e5-47be-b8c4-3ba0ddc205cd","url":"http://localhost:8338/klantinteracties/api/v1/partijen/1e341bcb-d8e5-47be-b8c4-3ba0ddc205cd"},"adres":"[email protected]","soortDigitaalAdres":"email","isStandaardAdres":false,"omschrijving":"OIP
137155
profiel"}'
138156
headers:
139157
API-version:
140158
- 0.0.3
141159
Allow:
142160
- GET, POST, HEAD, OPTIONS
143161
Content-Length:
144-
- '445'
162+
- '470'
163+
Content-Security-Policy:
164+
- 'img-src ''self'' data: cdn.redoc.ly; base-uri ''self''; worker-src ''self''
165+
blob:; form-action ''self''; default-src ''self''; frame-ancestors ''none'';
166+
frame-src ''self''; font-src ''self'' fonts.gstatic.com; script-src ''self''
167+
''unsafe-inline''; object-src ''none''; style-src ''self'' ''unsafe-inline''
168+
fonts.googleapis.com'
145169
Content-Type:
146170
- application/json
147171
Cross-Origin-Opener-Policy:
148172
- same-origin
149173
Location:
150-
- http://localhost:8338/klantinteracties/api/v1/digitaleadressen/3cc1c616-a8dc-4d23-9ce4-8a3d15871309
174+
- http://localhost:8338/klantinteracties/api/v1/digitaleadressen/2839f9df-b719-46ca-99bf-1ddbf576e250
151175
Referrer-Policy:
152176
- same-origin
153177
Vary:
@@ -165,20 +189,26 @@ interactions:
165189
Authorization:
166190
- Token b2eb1da9861da88743d72a3fb4344288fe2cba44
167191
method: GET
168-
uri: http://localhost:8338/klantinteracties/api/v1/partijen/89424a8a-fc4e-41f2-81ed-d5cc21675c2b?expand=digitaleAdressen
192+
uri: http://localhost:8338/klantinteracties/api/v1/partijen/1e341bcb-d8e5-47be-b8c4-3ba0ddc205cd?expand=digitaleAdressen
169193
response:
170194
body:
171-
string: '{"uuid":"89424a8a-fc4e-41f2-81ed-d5cc21675c2b","url":"http://localhost:8338/klantinteracties/api/v1/partijen/89424a8a-fc4e-41f2-81ed-d5cc21675c2b","nummer":"0000000001","interneNotitie":"","betrokkenen":[],"categorieRelaties":[],"digitaleAdressen":[{"uuid":"3cc1c616-a8dc-4d23-9ce4-8a3d15871309","url":"http://localhost:8338/klantinteracties/api/v1/digitaleadressen/3cc1c616-a8dc-4d23-9ce4-8a3d15871309"}],"voorkeursDigitaalAdres":null,"vertegenwoordigden":[],"rekeningnummers":[],"voorkeursRekeningnummer":null,"partijIdentificatoren":[{"uuid":"350ed1a7-7551-4ed5-8fdf-cc95942d67e2","url":"http://localhost:8338/klantinteracties/api/v1/partij-identificatoren/350ed1a7-7551-4ed5-8fdf-cc95942d67e2"}],"soortPartij":"persoon","indicatieGeheimhouding":false,"voorkeurstaal":"crp","indicatieActief":true,"bezoekadres":{"nummeraanduidingId":"","adresregel1":"","adresregel2":"","adresregel3":"","land":""},"correspondentieadres":{"nummeraanduidingId":"","adresregel1":"","adresregel2":"","adresregel3":"","land":""},"partijIdentificatie":{"contactnaam":{"voorletters":"Dr.","voornaam":"Test
195+
string: '{"uuid":"1e341bcb-d8e5-47be-b8c4-3ba0ddc205cd","url":"http://localhost:8338/klantinteracties/api/v1/partijen/1e341bcb-d8e5-47be-b8c4-3ba0ddc205cd","nummer":"0000000001","interneNotitie":"","betrokkenen":[],"categorieRelaties":[],"digitaleAdressen":[{"uuid":"2839f9df-b719-46ca-99bf-1ddbf576e250","url":"http://localhost:8338/klantinteracties/api/v1/digitaleadressen/2839f9df-b719-46ca-99bf-1ddbf576e250"}],"voorkeursDigitaalAdres":null,"vertegenwoordigden":[],"rekeningnummers":[],"voorkeursRekeningnummer":null,"partijIdentificatoren":[{"uuid":"4a89747e-a56b-48d5-b90a-6b172f77e828","url":"http://localhost:8338/klantinteracties/api/v1/partij-identificatoren/4a89747e-a56b-48d5-b90a-6b172f77e828"}],"soortPartij":"persoon","indicatieGeheimhouding":false,"voorkeurstaal":"crp","indicatieActief":true,"bezoekadres":{"nummeraanduidingId":"","adresregel1":"","adresregel2":"","adresregel3":"","land":""},"correspondentieadres":{"nummeraanduidingId":"","adresregel1":"","adresregel2":"","adresregel3":"","land":""},"partijIdentificatie":{"contactnaam":{"voorletters":"Dr.","voornaam":"Test
172196
Persoon","voorvoegselAchternaam":"Mrs.","achternaam":"Gamble"},"volledigeNaam":"Test
173-
Persoon Mrs. Gamble"},"_expand":{"digitaleAdressen":[{"uuid":"3cc1c616-a8dc-4d23-9ce4-8a3d15871309","url":"http://localhost:8338/klantinteracties/api/v1/digitaleadressen/3cc1c616-a8dc-4d23-9ce4-8a3d15871309","verstrektDoorBetrokkene":null,"verstrektDoorPartij":{"uuid":"89424a8a-fc4e-41f2-81ed-d5cc21675c2b","url":"http://localhost:8338/klantinteracties/api/v1/partijen/89424a8a-fc4e-41f2-81ed-d5cc21675c2b"},"adres":"[email protected]","soortDigitaalAdres":"email","omschrijving":"OIP
197+
Persoon Mrs. Gamble"},"_expand":{"digitaleAdressen":[{"uuid":"2839f9df-b719-46ca-99bf-1ddbf576e250","url":"http://localhost:8338/klantinteracties/api/v1/digitaleadressen/2839f9df-b719-46ca-99bf-1ddbf576e250","verstrektDoorBetrokkene":null,"verstrektDoorPartij":{"uuid":"1e341bcb-d8e5-47be-b8c4-3ba0ddc205cd","url":"http://localhost:8338/klantinteracties/api/v1/partijen/1e341bcb-d8e5-47be-b8c4-3ba0ddc205cd"},"adres":"[email protected]","soortDigitaalAdres":"email","isStandaardAdres":false,"omschrijving":"OIP
174198
profiel"}]}}'
175199
headers:
176200
API-version:
177201
- 0.0.3
178202
Allow:
179203
- GET, PUT, PATCH, DELETE, HEAD, OPTIONS
180204
Content-Length:
181-
- '1672'
205+
- '1697'
206+
Content-Security-Policy:
207+
- 'img-src ''self'' data: cdn.redoc.ly; base-uri ''self''; worker-src ''self''
208+
blob:; form-action ''self''; default-src ''self''; frame-ancestors ''none'';
209+
frame-src ''self''; font-src ''self'' fonts.gstatic.com; script-src ''self''
210+
''unsafe-inline''; object-src ''none''; style-src ''self'' ''unsafe-inline''
211+
fonts.googleapis.com'
182212
Content-Type:
183213
- application/json
184214
Cross-Origin-Opener-Policy:

0 commit comments

Comments
 (0)