diff --git a/setup.cfg b/setup.cfg index 02bad3c915..1d9525fc51 100644 --- a/setup.cfg +++ b/setup.cfg @@ -63,3 +63,4 @@ exclude_also = \.\.\. pass$ if settings.DEBUG: + assert_never\(.*\) diff --git a/src/openforms/formio/typing/__init__.py b/src/openforms/formio/typing/__init__.py index 8283e31bee..e029da21ba 100644 --- a/src/openforms/formio/typing/__init__.py +++ b/src/openforms/formio/typing/__init__.py @@ -16,6 +16,7 @@ EditGridComponent, FieldsetComponent, FileComponent, + FileValue, RadioComponent, SelectBoxesComponent, SelectComponent, @@ -31,6 +32,7 @@ "TextFieldComponent", "DateComponent", "DatetimeComponent", + "FileValue", "FileComponent", "SelectComponent", "SelectBoxesComponent", diff --git a/src/openforms/formio/typing/vanilla.py b/src/openforms/formio/typing/vanilla.py index 31633393a4..0deff5c676 100644 --- a/src/openforms/formio/typing/vanilla.py +++ b/src/openforms/formio/typing/vanilla.py @@ -22,6 +22,29 @@ class FileComponent(Component): maxNumberOfFiles: NotRequired[int] +class FileData(TypedDict): + url: str + form: Literal[""] + name: str + size: int + baseUrl: str + project: Literal[""] + + +class SingleFileValue(TypedDict): + # Source of truth: https://github.com/open-formulieren/types/blob/main/src/formio/components/file.ts + name: str + originalName: str + size: int + storage: Literal["url"] + type: str + url: str + data: FileData + + +type FileValue = list[SingleFileValue] + + class SelectData(TypedDict, total=False): values: list[OptionDict] diff --git a/src/openforms/registrations/contrib/objects_api/handlers/v2.py b/src/openforms/registrations/contrib/objects_api/handlers/v2.py index c1399cbef2..f1e9efab8d 100644 --- a/src/openforms/registrations/contrib/objects_api/handlers/v2.py +++ b/src/openforms/registrations/contrib/objects_api/handlers/v2.py @@ -5,11 +5,14 @@ from collections.abc import Sequence from dataclasses import dataclass from datetime import date, datetime +from typing import assert_never, cast from glom import Assign, Path, glom from openforms.api.utils import underscore_to_camel -from openforms.formio.typing import Component +from openforms.formio.service import FormioData +from openforms.formio.typing import Component, EditGridComponent +from openforms.formio.typing.vanilla import FileComponent from openforms.typing import JSONObject, JSONValue from ..typing import ObjecttypeVariableMapping @@ -56,7 +59,31 @@ def process_mapped_variable( JSONValue | date | datetime ), # can't narrow it down yet, as the type depends on the component type component: Component | None = None, + attachment_urls: dict[str, list[str]] | None = None, ) -> AssignmentSpec | Sequence[AssignmentSpec]: + """ + Apply post-processing to a mapped variable. + + A mapped variable may have additional options that specify the behaviour of how the + values are translated before they end up in the Objects API record. Often, these + transformations are dependent on the component type being processed. + + :arg mapping: The mapping of form variable to destination path, including possible + component-specific configuration options that influence the mapping behaviour. + :arg value: The raw value of the form variable for the submission being processed. + The type/shape of the value depends on the variable/component data type being + processed and even the component configuration (such as multiple True/False). + :arg component: If the variable corresponds to a Formio component, the component + definition is provided, otherwise ``None``. + :arg attachment_urls: The registration plugin uploads attachments to a Documents API + and provides the API resource URL for each attachment. Keys are the data paths in + the (Formio) submission data, e.g. `myAttachment` or ``repeatingGroups.2.file``. + + :returns: A single assignment spec or collection of assignment specs that specify + which value needs to be written to which "object path" for the record data, for + possible deep assignments. + """ + variable_key = mapping["variable_key"] target_path = Path(*bits) if (bits := mapping.get("target_path")) else None # normalize non-primitive date/datetime values so that they're ready for JSON @@ -95,21 +122,99 @@ def process_mapped_variable( assert target_path is not None return AssignmentSpec(destination=target_path, value=value) - # multiple files - return an array - case {"type": "file", "multiple": True}: - assert isinstance(value, list) - - # single file - return only one element case {"type": "file"}: - assert isinstance(value, list) - value = value[0] if value else "" + assert attachment_urls is not None + value = _transform_file_value( + cast(FileComponent, component), attachment_urls + ) case {"type": "map"}: assert isinstance(value, dict) + case {"type": "editgrid"} if attachment_urls is not None: + assert isinstance(value, list) + value = _transform_editgrid_value( + cast(EditGridComponent, component), + cast(list[JSONObject], value), + attachment_urls=attachment_urls, + key_prefix=variable_key, + ) # not a component or standard behaviour where no transformation is necessary case None | _: pass assert target_path is not None return AssignmentSpec(destination=target_path, value=value) + + +def _transform_file_value( + component: FileComponent, + attachment_urls: dict[str, list[str]], + key_prefix: str = "", +) -> str | list[str]: + """ + Transform a single file component value according to the component configuration. + """ + key = component["key"] + multiple = component.get("multiple", False) + + # it's possible keys are missing because there are no uploads at all for the + # component. + data_path = f"{key_prefix}.{key}" if key_prefix else key + upload_urls = attachment_urls.get(data_path, []) + + match upload_urls: + # if there are no uploads and it's a single component -> normalize to empty string + case [] if not multiple: + return "" + + # if there's an upload and it's a single component -> return the single URL string + case list() if upload_urls and not multiple: + return upload_urls[0] + + # otherwise just return the list of upload URLs + case list(): + assert multiple + return upload_urls + + case _: + assert_never(upload_urls) + + +def _transform_editgrid_value( + component: EditGridComponent, + value: list[JSONObject], + attachment_urls: dict[str, list[str]], + key_prefix: str, +) -> list[JSONObject]: + nested_components = component["components"] + + items: list[JSONObject] = [] + + # process file uploads inside (nested) repeating groups + for index, item in enumerate(value): + item_values = FormioData(item) + + for nested_component in nested_components: + key = nested_component["key"] + + match nested_component: + case {"type": "file"}: + item_values[key] = _transform_file_value( + cast(FileComponent, nested_component), + attachment_urls=attachment_urls, + key_prefix=f"{key_prefix}.{index}", + ) + case {"type": "editgrid"}: + nested_items = item_values[key] + assert isinstance(nested_items, list) + item_values[key] = _transform_editgrid_value( + cast(EditGridComponent, nested_component), + value=cast(list[JSONObject], nested_items), + attachment_urls=attachment_urls, + key_prefix=f"{key_prefix}.{index}.{key}", + ) + + items.append(item_values.data) + + return items diff --git a/src/openforms/registrations/contrib/objects_api/submission_registration.py b/src/openforms/registrations/contrib/objects_api/submission_registration.py index 06e3396758..3f73dbeb8a 100644 --- a/src/openforms/registrations/contrib/objects_api/submission_registration.py +++ b/src/openforms/registrations/contrib/objects_api/submission_registration.py @@ -15,7 +15,9 @@ override, ) -from django.db.models import F +from django.db import models +from django.db.models import F, Value +from django.db.models.functions import Coalesce, NullIf from openforms.authentication.service import AuthAttribute from openforms.contrib.objects_api.clients import ( @@ -478,11 +480,19 @@ def get_attachment_urls_by_key(submission: Submission) -> dict[str, list[str]]: attachments = ObjectsAPISubmissionAttachment.objects.filter( submission_file_attachment__submission_variable__submission=submission ).annotate( - variable_key=F("submission_file_attachment__submission_variable__key") + data_path=Coalesce( + NullIf( + F("submission_file_attachment___component_data_path"), + Value(""), + ), + # fall back to variable/component key if no explicit data path is set + F("submission_file_attachment__submission_variable__key"), + output_field=models.TextField(), + ), ) for attachment_meta in attachments: key: str = ( - attachment_meta.variable_key # pyright: ignore[reportAttributeAccessIssue] + attachment_meta.data_path # pyright: ignore[reportAttributeAccessIssue] ) urls_map[key].append(attachment_meta.document_url) return urls_map @@ -528,28 +538,21 @@ def get_record_data( variable = None value: JSONValue | date | datetime - # special casing documents - we transform the formio file upload data into - # the api resource URLs for the uploaded documents in the Documens API. - # Normalizing to string/array of strings is done later via - # process_mapped_variable which receives the component configuration. - if key in urls_map: - value = urls_map[key] # pyright: ignore[reportAssignmentType] - else: - try: - value = all_values[key] - except KeyError: - logger.info( - "Expected key %s to be present in the submission (%s) variables, " - "but it wasn't. Ignoring it.", - key, - submission.uuid, - extra={ - "submission": submission.uuid, - "key": key, - "mapping_config": mapping, - }, - ) - continue + try: + value = all_values[key] + except KeyError: + logger.info( + "Expected key %s to be present in the submission (%s) variables, " + "but it wasn't. Ignoring it.", + key, + submission.uuid, + extra={ + "submission": submission.uuid, + "key": key, + "mapping_config": mapping, + }, + ) + continue # Look up if the key points to a form component that provides additional # context for how to process the value. @@ -562,7 +565,10 @@ def get_record_data( # process the value so that we can assign it to the record data as requested assignment_spec = process_mapped_variable( - mapping=mapping, value=value, component=component + mapping=mapping, + value=value, + component=component, + attachment_urls=urls_map, ) if isinstance(assignment_spec, AssignmentSpec): assignment_specs.append(assignment_spec) diff --git a/src/openforms/registrations/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIBackendV2Tests/ObjectsAPIBackendV2Tests.test_addressNl_legacy_before_of_30.yaml b/src/openforms/registrations/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIBackendV2Tests/ObjectsAPIBackendV2Tests.test_addressNl_legacy_before_of_30.yaml index 50eb90131c..a040e83dfb 100644 --- a/src/openforms/registrations/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIBackendV2Tests/ObjectsAPIBackendV2Tests.test_addressNl_legacy_before_of_30.yaml +++ b/src/openforms/registrations/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIBackendV2Tests/ObjectsAPIBackendV2Tests.test_addressNl_legacy_before_of_30.yaml @@ -20,7 +20,7 @@ interactions: everything","namePlural":"Accepts everything","description":"","dataClassification":"open","maintainerOrganization":"","maintainerDepartment":"","contactPerson":"","contactEmail":"","source":"","updateFrequency":"unknown","providerOrganization":"","documentationUrl":"","labels":{},"createdAt":"2024-07-22","modifiedAt":"2024-07-22","allowGeometry":true,"versions":["http://objecttypes-web:8000/api/v2/objecttypes/8faed0fa-7864-4409-aa6d-533a37616a9e/versions/1"]},{"url":"http://objecttypes-web:8000/api/v2/objecttypes/644ab597-e88c-43c0-8321-f12113510b0e","uuid":"644ab597-e88c-43c0-8321-f12113510b0e","name":"Fieldset component","namePlural":"Fieldset component","description":"","dataClassification":"confidential","maintainerOrganization":"","maintainerDepartment":"","contactPerson":"","contactEmail":"","source":"","updateFrequency":"unknown","providerOrganization":"","documentationUrl":"","labels":{},"createdAt":"2024-02-08","modifiedAt":"2024-02-08","allowGeometry":true,"versions":["http://objecttypes-web:8000/api/v2/objecttypes/644ab597-e88c-43c0-8321-f12113510b0e/versions/1"]},{"url":"http://objecttypes-web:8000/api/v2/objecttypes/f1dde4fe-b7f9-46dc-84ae-429ae49e3705","uuid":"f1dde4fe-b7f9-46dc-84ae-429ae49e3705","name":"Geo in data","namePlural":"Geo in data","description":"","dataClassification":"confidential","maintainerOrganization":"","maintainerDepartment":"","contactPerson":"","contactEmail":"","source":"","updateFrequency":"unknown","providerOrganization":"","documentationUrl":"","labels":{},"createdAt":"2024-02-08","modifiedAt":"2024-02-08","allowGeometry":true,"versions":["http://objecttypes-web:8000/api/v2/objecttypes/f1dde4fe-b7f9-46dc-84ae-429ae49e3705/versions/1"]},{"url":"http://objecttypes-web:8000/api/v2/objecttypes/527b8408-7421-4808-a744-43ccb7bdaaa2","uuid":"527b8408-7421-4808-a744-43ccb7bdaaa2","name":"File - Uploads","namePlural":"File Uploads","description":"","dataClassification":"confidential","maintainerOrganization":"","maintainerDepartment":"","contactPerson":"","contactEmail":"","source":"","updateFrequency":"unknown","providerOrganization":"","documentationUrl":"","labels":{},"createdAt":"2024-02-08","modifiedAt":"2024-02-08","allowGeometry":true,"versions":["http://objecttypes-web:8000/api/v2/objecttypes/527b8408-7421-4808-a744-43ccb7bdaaa2/versions/1"]},{"url":"http://objecttypes-web:8000/api/v2/objecttypes/3edfdaf7-f469-470b-a391-bb7ea015bd6f","uuid":"3edfdaf7-f469-470b-a391-bb7ea015bd6f","name":"Tree","namePlural":"Trees","description":"","dataClassification":"confidential","maintainerOrganization":"","maintainerDepartment":"","contactPerson":"","contactEmail":"","source":"","updateFrequency":"unknown","providerOrganization":"","documentationUrl":"","labels":{},"createdAt":"2024-02-08","modifiedAt":"2024-02-08","allowGeometry":true,"versions":["http://objecttypes-web:8000/api/v2/objecttypes/3edfdaf7-f469-470b-a391-bb7ea015bd6f/versions/1"]},{"url":"http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48","uuid":"8e46e0a5-b1b4-449b-b9e9-fa3cea655f48","name":"Person","namePlural":"Persons","description":"","dataClassification":"open","maintainerOrganization":"","maintainerDepartment":"","contactPerson":"","contactEmail":"","source":"","updateFrequency":"unknown","providerOrganization":"","documentationUrl":"","labels":{},"createdAt":"2023-10-24","modifiedAt":"2024-11-25","allowGeometry":true,"versions":["http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48/versions/1","http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48/versions/2","http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48/versions/3","http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48/versions/4"]}]}' + Uploads","namePlural":"File Uploads","description":"","dataClassification":"confidential","maintainerOrganization":"","maintainerDepartment":"","contactPerson":"","contactEmail":"","source":"","updateFrequency":"unknown","providerOrganization":"","documentationUrl":"","labels":{},"createdAt":"2024-02-08","modifiedAt":"2024-02-08","allowGeometry":true,"versions":["http://objecttypes-web:8000/api/v2/objecttypes/527b8408-7421-4808-a744-43ccb7bdaaa2/versions/1"]},{"url":"http://objecttypes-web:8000/api/v2/objecttypes/3edfdaf7-f469-470b-a391-bb7ea015bd6f","uuid":"3edfdaf7-f469-470b-a391-bb7ea015bd6f","name":"Tree","namePlural":"Trees","description":"","dataClassification":"confidential","maintainerOrganization":"","maintainerDepartment":"","contactPerson":"","contactEmail":"","source":"","updateFrequency":"unknown","providerOrganization":"","documentationUrl":"","labels":{},"createdAt":"2024-02-08","modifiedAt":"2024-02-08","allowGeometry":true,"versions":["http://objecttypes-web:8000/api/v2/objecttypes/3edfdaf7-f469-470b-a391-bb7ea015bd6f/versions/1"]},{"url":"http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48","uuid":"8e46e0a5-b1b4-449b-b9e9-fa3cea655f48","name":"Person","namePlural":"Persons","description":"","dataClassification":"open","maintainerOrganization":"","maintainerDepartment":"","contactPerson":"","contactEmail":"","source":"","updateFrequency":"unknown","providerOrganization":"","documentationUrl":"","labels":{},"createdAt":"2023-10-24","modifiedAt":"2024-11-25","allowGeometry":true,"versions":["http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48/versions/2","http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48/versions/3","http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48/versions/1","http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48/versions/4"]}]}' headers: Allow: - GET, POST, HEAD, OPTIONS @@ -33,11 +33,11 @@ interactions: Cross-Origin-Opener-Policy: - same-origin Date: - - Thu, 19 Dec 2024 08:19:29 GMT + - Wed, 29 Jan 2025 17:01:16 GMT Referrer-Policy: - same-origin Server: - - nginx/1.27.0 + - nginx/1.27.3 Vary: - origin X-Content-Type-Options: @@ -77,11 +77,11 @@ interactions: Cross-Origin-Opener-Policy: - same-origin Date: - - Thu, 19 Dec 2024 08:19:29 GMT + - Wed, 29 Jan 2025 17:01:16 GMT Referrer-Policy: - same-origin Server: - - nginx/1.27.0 + - nginx/1.27.3 Vary: - origin X-Content-Type-Options: diff --git a/src/openforms/registrations/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIBackendV2Tests/ObjectsAPIBackendV2Tests.test_submission_with_editgrid_with_nested_files.yaml b/src/openforms/registrations/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIBackendV2Tests/ObjectsAPIBackendV2Tests.test_submission_with_editgrid_with_nested_files.yaml new file mode 100644 index 0000000000..bab3899c51 --- /dev/null +++ b/src/openforms/registrations/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIBackendV2Tests/ObjectsAPIBackendV2Tests.test_submission_with_editgrid_with_nested_files.yaml @@ -0,0 +1,157 @@ +interactions: +- request: + body: '{"informatieobjecttype": "http://localhost:8003/catalogi/api/v1/informatieobjecttypen/531f6c1a-97f7-478c-85f0-67d2f23661c7", + "bronorganisatie": "000000000", "creatiedatum": "2024-03-19", "titel": "Form + 002", "auteur": "Aanvrager", "taal": "nld", "formaat": "application/octet-stream", + "inhoud": "Y29udGVudA==", "status": "definitief", "bestandsnaam": "foo-0.bin", + "ontvangstdatum": "2024-03-17", "beschrijving": "Bijgevoegd document", "indicatieGebruiksrecht": + false, "bestandsomvang": 7}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate, br + Authorization: + - Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ0ZXN0X2NsaWVudF9pZCIsImlhdCI6MTcxMDg1NTYzNCwiY2xpZW50X2lkIjoidGVzdF9jbGllbnRfaWQiLCJ1c2VyX2lkIjoiIiwidXNlcl9yZXByZXNlbnRhdGlvbiI6IiJ9.NJjZEPSwh9eGzntjwUB7rFAiaq_5DqYgVylWuKdtdMA + Connection: + - keep-alive + Content-Length: + - '488' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.2 + method: POST + uri: http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten + response: + body: + string: '{"url":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/4b11e35f-5d76-48c8-a7dc-91b1d8086969","identificatie":"DOCUMENT-2024-0000000165","bronorganisatie":"000000000","creatiedatum":"2024-03-19","titel":"Form + 002","vertrouwelijkheidaanduiding":"openbaar","auteur":"Aanvrager","status":"definitief","formaat":"application/octet-stream","taal":"nld","versie":1,"beginRegistratie":"2025-01-29T17:01:16.380237Z","bestandsnaam":"foo-0.bin","inhoud":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/4b11e35f-5d76-48c8-a7dc-91b1d8086969/download?versie=1","bestandsomvang":7,"link":"","beschrijving":"Bijgevoegd + document","ontvangstdatum":"2024-03-17","verzenddatum":null,"indicatieGebruiksrecht":false,"verschijningsvorm":"","ondertekening":{"soort":"","datum":null},"integriteit":{"algoritme":"","waarde":"","datum":null},"informatieobjecttype":"http://localhost:8003/catalogi/api/v1/informatieobjecttypen/531f6c1a-97f7-478c-85f0-67d2f23661c7","locked":false,"bestandsdelen":[],"trefwoorden":[],"lock":""}' + headers: + API-version: + - 1.4.2 + Allow: + - GET, POST, HEAD, OPTIONS + Content-Length: + - '1044' + Content-Type: + - application/json + Cross-Origin-Opener-Policy: + - same-origin + Location: + - http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/4b11e35f-5d76-48c8-a7dc-91b1d8086969 + Referrer-Policy: + - same-origin + Vary: + - origin + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate, br + Authorization: + - Token 171be5abaf41e7856b423ad513df1ef8f867ff48 + Connection: + - keep-alive + User-Agent: + - python-requests/2.32.2 + method: GET + uri: http://localhost:8001/api/v2/objecttypes/8faed0fa-7864-4409-aa6d-533a37616a9e + response: + body: + string: '{"url":"http://objecttypes-web:8000/api/v2/objecttypes/8faed0fa-7864-4409-aa6d-533a37616a9e","uuid":"8faed0fa-7864-4409-aa6d-533a37616a9e","name":"Accepts + everything","namePlural":"Accepts everything","description":"","dataClassification":"open","maintainerOrganization":"","maintainerDepartment":"","contactPerson":"","contactEmail":"","source":"","updateFrequency":"unknown","providerOrganization":"","documentationUrl":"","labels":{},"createdAt":"2024-07-22","modifiedAt":"2024-07-22","allowGeometry":true,"versions":["http://objecttypes-web:8000/api/v2/objecttypes/8faed0fa-7864-4409-aa6d-533a37616a9e/versions/1"]}' + headers: + Allow: + - GET, PUT, PATCH, DELETE, HEAD, OPTIONS + Connection: + - keep-alive + Content-Length: + - '619' + Content-Type: + - application/json + Cross-Origin-Opener-Policy: + - same-origin + Date: + - Wed, 29 Jan 2025 17:01:16 GMT + Referrer-Policy: + - same-origin + Server: + - nginx/1.27.3 + Vary: + - origin + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + status: + code: 200 + message: OK +- request: + body: '{"type": "http://objecttypes-web:8000/api/v2/objecttypes/8faed0fa-7864-4409-aa6d-533a37616a9e", + "record": {"typeVersion": 1, "data": {"repeatingGroup": [{"nestedRepeatingGroup": + [{"file": "http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/4b11e35f-5d76-48c8-a7dc-91b1d8086969", + "email": "info@example.com"}]}]}, "startAt": "2024-03-19"}}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate, br + Authorization: + - Token 7657474c3d75f56ae0abd0d1bf7994b09964dca9 + Connection: + - keep-alive + Content-Crs: + - EPSG:4326 + Content-Length: + - '357' + Content-Type: + - application/json + User-Agent: + - python-requests/2.32.2 + method: POST + uri: http://localhost:8002/api/v2/objects + response: + body: + string: '{"url":"http://objects-web:8000/api/v2/objects/35ccae85-b9a1-4b1b-8677-8ae9404ba4a2","uuid":"35ccae85-b9a1-4b1b-8677-8ae9404ba4a2","type":"http://objecttypes-web:8000/api/v2/objecttypes/8faed0fa-7864-4409-aa6d-533a37616a9e","record":{"index":1,"typeVersion":1,"data":{"repeatingGroup":[{"nestedRepeatingGroup":[{"file":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/4b11e35f-5d76-48c8-a7dc-91b1d8086969","email":"info@example.com"}]}]},"geometry":null,"startAt":"2024-03-19","endAt":null,"registrationAt":"2025-01-29","correctionFor":null,"correctedBy":null}}' + headers: + Allow: + - GET, POST, HEAD, OPTIONS + Connection: + - keep-alive + Content-Crs: + - EPSG:4326 + Content-Length: + - '583' + Content-Type: + - application/json + Cross-Origin-Opener-Policy: + - same-origin + Date: + - Wed, 29 Jan 2025 17:01:16 GMT + Location: + - http://localhost:8002/api/v2/objects/35ccae85-b9a1-4b1b-8677-8ae9404ba4a2 + Referrer-Policy: + - same-origin + Server: + - nginx/1.27.3 + Vary: + - origin + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + status: + code: 201 + message: Created +version: 1 diff --git a/src/openforms/registrations/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIBackendV2Tests/ObjectsAPIBackendV2Tests.test_submission_with_empty_optional_file.yaml b/src/openforms/registrations/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIBackendV2Tests/ObjectsAPIBackendV2Tests.test_submission_with_empty_optional_file.yaml index fd3dfc398f..3697c4cc5d 100644 --- a/src/openforms/registrations/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIBackendV2Tests/ObjectsAPIBackendV2Tests.test_submission_with_empty_optional_file.yaml +++ b/src/openforms/registrations/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIBackendV2Tests/ObjectsAPIBackendV2Tests.test_submission_with_empty_optional_file.yaml @@ -30,11 +30,11 @@ interactions: Cross-Origin-Opener-Policy: - same-origin Date: - - Thu, 19 Dec 2024 08:19:30 GMT + - Wed, 29 Jan 2025 17:01:16 GMT Referrer-Policy: - same-origin Server: - - nginx/1.27.0 + - nginx/1.27.3 Vary: - origin X-Content-Type-Options: @@ -68,7 +68,7 @@ interactions: uri: http://localhost:8002/api/v2/objects response: body: - string: '{"url":"http://objects-web:8000/api/v2/objects/c277e6c8-02da-4257-9051-a13bb67b3d4e","uuid":"c277e6c8-02da-4257-9051-a13bb67b3d4e","type":"http://objecttypes-web:8000/api/v2/objecttypes/527b8408-7421-4808-a744-43ccb7bdaaa2","record":{"index":1,"typeVersion":1,"data":{"single_file":""},"geometry":null,"startAt":"2024-03-19","endAt":null,"registrationAt":"2024-12-19","correctionFor":null,"correctedBy":null}}' + string: '{"url":"http://objects-web:8000/api/v2/objects/28bb7db5-2806-4291-a731-68ffa0829977","uuid":"28bb7db5-2806-4291-a731-68ffa0829977","type":"http://objecttypes-web:8000/api/v2/objecttypes/527b8408-7421-4808-a744-43ccb7bdaaa2","record":{"index":1,"typeVersion":1,"data":{"single_file":""},"geometry":null,"startAt":"2024-03-19","endAt":null,"registrationAt":"2025-01-29","correctionFor":null,"correctedBy":null}}' headers: Allow: - GET, POST, HEAD, OPTIONS @@ -83,13 +83,13 @@ interactions: Cross-Origin-Opener-Policy: - same-origin Date: - - Thu, 19 Dec 2024 08:19:30 GMT + - Wed, 29 Jan 2025 17:01:16 GMT Location: - - http://localhost:8002/api/v2/objects/c277e6c8-02da-4257-9051-a13bb67b3d4e + - http://localhost:8002/api/v2/objects/28bb7db5-2806-4291-a731-68ffa0829977 Referrer-Policy: - same-origin Server: - - nginx/1.27.0 + - nginx/1.27.3 Vary: - origin X-Content-Type-Options: diff --git a/src/openforms/registrations/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIBackendV2Tests/ObjectsAPIBackendV2Tests.test_submission_with_file_components.yaml b/src/openforms/registrations/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIBackendV2Tests/ObjectsAPIBackendV2Tests.test_submission_with_file_components.yaml index 5899c20307..f49c36e19d 100644 --- a/src/openforms/registrations/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIBackendV2Tests/ObjectsAPIBackendV2Tests.test_submission_with_file_components.yaml +++ b/src/openforms/registrations/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIBackendV2Tests/ObjectsAPIBackendV2Tests.test_submission_with_file_components.yaml @@ -2,9 +2,9 @@ interactions: - request: body: '{"informatieobjecttype": "http://localhost:8003/catalogi/api/v1/informatieobjecttypen/531f6c1a-97f7-478c-85f0-67d2f23661c7", "bronorganisatie": "000000000", "creatiedatum": "2024-03-19", "titel": "Form - 030", "auteur": "Aanvrager", "taal": "nld", "formaat": "application/rdf+xml", - "inhoud": "Y29udGVudA==", "status": "definitief", "bestandsnaam": "attachment1.jpg", - "ontvangstdatum": "2024-03-02", "beschrijving": "Bijgevoegd document", "indicatieGebruiksrecht": + 004", "auteur": "Aanvrager", "taal": "nld", "formaat": "image/png", "inhoud": + "Y29udGVudA==", "status": "definitief", "bestandsnaam": "attachment1.jpg", "ontvangstdatum": + "2024-03-19", "beschrijving": "Bijgevoegd document", "indicatieGebruiksrecht": false, "bestandsomvang": 7}' headers: Accept: @@ -16,7 +16,7 @@ interactions: Connection: - keep-alive Content-Length: - - '489' + - '479' Content-Type: - application/json User-Agent: @@ -25,22 +25,22 @@ interactions: uri: http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten response: body: - string: '{"url":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/33972655-0307-42f7-a62d-3002d974f2e0","identificatie":"DOCUMENT-2024-0000000026","bronorganisatie":"000000000","creatiedatum":"2024-03-19","titel":"Form - 030","vertrouwelijkheidaanduiding":"openbaar","auteur":"Aanvrager","status":"definitief","formaat":"application/rdf+xml","taal":"nld","versie":1,"beginRegistratie":"2024-12-19T08:19:30.290210Z","bestandsnaam":"attachment1.jpg","inhoud":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/33972655-0307-42f7-a62d-3002d974f2e0/download?versie=1","bestandsomvang":7,"link":"","beschrijving":"Bijgevoegd - document","ontvangstdatum":"2024-03-02","verzenddatum":null,"indicatieGebruiksrecht":false,"verschijningsvorm":"","ondertekening":{"soort":"","datum":null},"integriteit":{"algoritme":"","waarde":"","datum":null},"informatieobjecttype":"http://localhost:8003/catalogi/api/v1/informatieobjecttypen/531f6c1a-97f7-478c-85f0-67d2f23661c7","locked":false,"bestandsdelen":[],"trefwoorden":[],"lock":""}' + string: '{"url":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/e512fb79-ae44-4689-8b93-e1ad3e01eb8a","identificatie":"DOCUMENT-2024-0000000166","bronorganisatie":"000000000","creatiedatum":"2024-03-19","titel":"Form + 004","vertrouwelijkheidaanduiding":"openbaar","auteur":"Aanvrager","status":"definitief","formaat":"image/png","taal":"nld","versie":1,"beginRegistratie":"2025-01-29T17:01:16.909815Z","bestandsnaam":"attachment1.jpg","inhoud":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/e512fb79-ae44-4689-8b93-e1ad3e01eb8a/download?versie=1","bestandsomvang":7,"link":"","beschrijving":"Bijgevoegd + document","ontvangstdatum":"2024-03-19","verzenddatum":null,"indicatieGebruiksrecht":false,"verschijningsvorm":"","ondertekening":{"soort":"","datum":null},"integriteit":{"algoritme":"","waarde":"","datum":null},"informatieobjecttype":"http://localhost:8003/catalogi/api/v1/informatieobjecttypen/531f6c1a-97f7-478c-85f0-67d2f23661c7","locked":false,"bestandsdelen":[],"trefwoorden":[],"lock":""}' headers: API-version: - 1.4.2 Allow: - GET, POST, HEAD, OPTIONS Content-Length: - - '1045' + - '1035' Content-Type: - application/json Cross-Origin-Opener-Policy: - same-origin Location: - - http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/33972655-0307-42f7-a62d-3002d974f2e0 + - http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/e512fb79-ae44-4689-8b93-e1ad3e01eb8a Referrer-Policy: - same-origin Vary: @@ -55,9 +55,9 @@ interactions: - request: body: '{"informatieobjecttype": "http://localhost:8003/catalogi/api/v1/informatieobjecttypen/531f6c1a-97f7-478c-85f0-67d2f23661c7", "bronorganisatie": "000000000", "creatiedatum": "2024-03-19", "titel": "Form - 030", "auteur": "Aanvrager", "taal": "nld", "formaat": "video/quicktime", "inhoud": - "Y29udGVudA==", "status": "definitief", "bestandsnaam": "attachment2_1.jpg", - "ontvangstdatum": "2024-03-02", "beschrijving": "Bijgevoegd document", "indicatieGebruiksrecht": + 004", "auteur": "Aanvrager", "taal": "nld", "formaat": "multipart/encrypted", + "inhoud": "Y29udGVudA==", "status": "definitief", "bestandsnaam": "attachment2_1.jpg", + "ontvangstdatum": "2024-03-19", "beschrijving": "Bijgevoegd document", "indicatieGebruiksrecht": false, "bestandsomvang": 7}' headers: Accept: @@ -69,7 +69,7 @@ interactions: Connection: - keep-alive Content-Length: - - '487' + - '491' Content-Type: - application/json User-Agent: @@ -78,22 +78,22 @@ interactions: uri: http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten response: body: - string: '{"url":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/ec46dbda-cbeb-4712-ba70-ea7e28d972c6","identificatie":"DOCUMENT-2024-0000000027","bronorganisatie":"000000000","creatiedatum":"2024-03-19","titel":"Form - 030","vertrouwelijkheidaanduiding":"openbaar","auteur":"Aanvrager","status":"definitief","formaat":"video/quicktime","taal":"nld","versie":1,"beginRegistratie":"2024-12-19T08:19:30.388770Z","bestandsnaam":"attachment2_1.jpg","inhoud":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/ec46dbda-cbeb-4712-ba70-ea7e28d972c6/download?versie=1","bestandsomvang":7,"link":"","beschrijving":"Bijgevoegd - document","ontvangstdatum":"2024-03-02","verzenddatum":null,"indicatieGebruiksrecht":false,"verschijningsvorm":"","ondertekening":{"soort":"","datum":null},"integriteit":{"algoritme":"","waarde":"","datum":null},"informatieobjecttype":"http://localhost:8003/catalogi/api/v1/informatieobjecttypen/531f6c1a-97f7-478c-85f0-67d2f23661c7","locked":false,"bestandsdelen":[],"trefwoorden":[],"lock":""}' + string: '{"url":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/504849d8-1ae1-4615-9095-a3b452359d10","identificatie":"DOCUMENT-2024-0000000167","bronorganisatie":"000000000","creatiedatum":"2024-03-19","titel":"Form + 004","vertrouwelijkheidaanduiding":"openbaar","auteur":"Aanvrager","status":"definitief","formaat":"multipart/encrypted","taal":"nld","versie":1,"beginRegistratie":"2025-01-29T17:01:17.004593Z","bestandsnaam":"attachment2_1.jpg","inhoud":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/504849d8-1ae1-4615-9095-a3b452359d10/download?versie=1","bestandsomvang":7,"link":"","beschrijving":"Bijgevoegd + document","ontvangstdatum":"2024-03-19","verzenddatum":null,"indicatieGebruiksrecht":false,"verschijningsvorm":"","ondertekening":{"soort":"","datum":null},"integriteit":{"algoritme":"","waarde":"","datum":null},"informatieobjecttype":"http://localhost:8003/catalogi/api/v1/informatieobjecttypen/531f6c1a-97f7-478c-85f0-67d2f23661c7","locked":false,"bestandsdelen":[],"trefwoorden":[],"lock":""}' headers: API-version: - 1.4.2 Allow: - GET, POST, HEAD, OPTIONS Content-Length: - - '1043' + - '1047' Content-Type: - application/json Cross-Origin-Opener-Policy: - same-origin Location: - - http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/ec46dbda-cbeb-4712-ba70-ea7e28d972c6 + - http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/504849d8-1ae1-4615-9095-a3b452359d10 Referrer-Policy: - same-origin Vary: @@ -136,11 +136,11 @@ interactions: Cross-Origin-Opener-Policy: - same-origin Date: - - Thu, 19 Dec 2024 08:19:30 GMT + - Wed, 29 Jan 2025 17:01:17 GMT Referrer-Policy: - same-origin Server: - - nginx/1.27.0 + - nginx/1.27.3 Vary: - origin X-Content-Type-Options: @@ -152,8 +152,8 @@ interactions: message: OK - request: body: '{"type": "http://objecttypes-web:8000/api/v2/objecttypes/527b8408-7421-4808-a744-43ccb7bdaaa2", - "record": {"typeVersion": 1, "data": {"single_file": "http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/33972655-0307-42f7-a62d-3002d974f2e0", - "multiple_files": ["http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/ec46dbda-cbeb-4712-ba70-ea7e28d972c6"]}, + "record": {"typeVersion": 1, "data": {"single_file": "http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/e512fb79-ae44-4689-8b93-e1ad3e01eb8a", + "multiple_files": ["http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/504849d8-1ae1-4615-9095-a3b452359d10"]}, "startAt": "2024-03-19"}}' headers: Accept: @@ -176,7 +176,7 @@ interactions: uri: http://localhost:8002/api/v2/objects response: body: - string: '{"url":"http://objects-web:8000/api/v2/objects/c1c94f2a-3b16-45d0-b77f-0b7641e2532f","uuid":"c1c94f2a-3b16-45d0-b77f-0b7641e2532f","type":"http://objecttypes-web:8000/api/v2/objecttypes/527b8408-7421-4808-a744-43ccb7bdaaa2","record":{"index":1,"typeVersion":1,"data":{"single_file":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/33972655-0307-42f7-a62d-3002d974f2e0","multiple_files":["http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/ec46dbda-cbeb-4712-ba70-ea7e28d972c6"]},"geometry":null,"startAt":"2024-03-19","endAt":null,"registrationAt":"2024-12-19","correctionFor":null,"correctedBy":null}}' + string: '{"url":"http://objects-web:8000/api/v2/objects/0d282033-0d7f-4bb2-a075-41603cc2a89c","uuid":"0d282033-0d7f-4bb2-a075-41603cc2a89c","type":"http://objecttypes-web:8000/api/v2/objecttypes/527b8408-7421-4808-a744-43ccb7bdaaa2","record":{"index":1,"typeVersion":1,"data":{"single_file":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/e512fb79-ae44-4689-8b93-e1ad3e01eb8a","multiple_files":["http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/504849d8-1ae1-4615-9095-a3b452359d10"]},"geometry":null,"startAt":"2024-03-19","endAt":null,"registrationAt":"2025-01-29","correctionFor":null,"correctedBy":null}}' headers: Allow: - GET, POST, HEAD, OPTIONS @@ -191,13 +191,13 @@ interactions: Cross-Origin-Opener-Policy: - same-origin Date: - - Thu, 19 Dec 2024 08:19:30 GMT + - Wed, 29 Jan 2025 17:01:17 GMT Location: - - http://localhost:8002/api/v2/objects/c1c94f2a-3b16-45d0-b77f-0b7641e2532f + - http://localhost:8002/api/v2/objects/0d282033-0d7f-4bb2-a075-41603cc2a89c Referrer-Policy: - same-origin Server: - - nginx/1.27.0 + - nginx/1.27.3 Vary: - origin X-Content-Type-Options: diff --git a/src/openforms/registrations/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIBackendV2Tests/ObjectsAPIBackendV2Tests.test_submission_with_file_components_container_variable.yaml b/src/openforms/registrations/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIBackendV2Tests/ObjectsAPIBackendV2Tests.test_submission_with_file_components_container_variable.yaml index 39e2ce81ee..5677fb9849 100644 --- a/src/openforms/registrations/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIBackendV2Tests/ObjectsAPIBackendV2Tests.test_submission_with_file_components_container_variable.yaml +++ b/src/openforms/registrations/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIBackendV2Tests/ObjectsAPIBackendV2Tests.test_submission_with_file_components_container_variable.yaml @@ -2,9 +2,9 @@ interactions: - request: body: '{"informatieobjecttype": "http://localhost:8003/catalogi/api/v1/informatieobjecttypen/531f6c1a-97f7-478c-85f0-67d2f23661c7", "bronorganisatie": "000000000", "creatiedatum": "2024-03-19", "titel": "Form - 031", "auteur": "Aanvrager", "taal": "nld", "formaat": "multipart/mixed", "inhoud": + 005", "auteur": "Aanvrager", "taal": "nld", "formaat": "model/iges", "inhoud": "Y29udGVudA==", "status": "definitief", "bestandsnaam": "attachment1.jpg", "ontvangstdatum": - "2024-03-17", "beschrijving": "Bijgevoegd document", "indicatieGebruiksrecht": + "2024-03-10", "beschrijving": "Bijgevoegd document", "indicatieGebruiksrecht": false, "bestandsomvang": 7}' headers: Accept: @@ -16,7 +16,7 @@ interactions: Connection: - keep-alive Content-Length: - - '485' + - '480' Content-Type: - application/json User-Agent: @@ -25,22 +25,22 @@ interactions: uri: http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten response: body: - string: '{"url":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/6ff51134-9907-4243-ab83-d63e84e684c7","identificatie":"DOCUMENT-2024-0000000028","bronorganisatie":"000000000","creatiedatum":"2024-03-19","titel":"Form - 031","vertrouwelijkheidaanduiding":"openbaar","auteur":"Aanvrager","status":"definitief","formaat":"multipart/mixed","taal":"nld","versie":1,"beginRegistratie":"2024-12-19T08:19:30.825881Z","bestandsnaam":"attachment1.jpg","inhoud":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/6ff51134-9907-4243-ab83-d63e84e684c7/download?versie=1","bestandsomvang":7,"link":"","beschrijving":"Bijgevoegd - document","ontvangstdatum":"2024-03-17","verzenddatum":null,"indicatieGebruiksrecht":false,"verschijningsvorm":"","ondertekening":{"soort":"","datum":null},"integriteit":{"algoritme":"","waarde":"","datum":null},"informatieobjecttype":"http://localhost:8003/catalogi/api/v1/informatieobjecttypen/531f6c1a-97f7-478c-85f0-67d2f23661c7","locked":false,"bestandsdelen":[],"trefwoorden":[],"lock":""}' + string: '{"url":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/5f63ec5c-4e54-428f-9596-6c68f4e3a780","identificatie":"DOCUMENT-2024-0000000168","bronorganisatie":"000000000","creatiedatum":"2024-03-19","titel":"Form + 005","vertrouwelijkheidaanduiding":"openbaar","auteur":"Aanvrager","status":"definitief","formaat":"model/iges","taal":"nld","versie":1,"beginRegistratie":"2025-01-29T17:01:17.348272Z","bestandsnaam":"attachment1.jpg","inhoud":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/5f63ec5c-4e54-428f-9596-6c68f4e3a780/download?versie=1","bestandsomvang":7,"link":"","beschrijving":"Bijgevoegd + document","ontvangstdatum":"2024-03-10","verzenddatum":null,"indicatieGebruiksrecht":false,"verschijningsvorm":"","ondertekening":{"soort":"","datum":null},"integriteit":{"algoritme":"","waarde":"","datum":null},"informatieobjecttype":"http://localhost:8003/catalogi/api/v1/informatieobjecttypen/531f6c1a-97f7-478c-85f0-67d2f23661c7","locked":false,"bestandsdelen":[],"trefwoorden":[],"lock":""}' headers: API-version: - 1.4.2 Allow: - GET, POST, HEAD, OPTIONS Content-Length: - - '1041' + - '1036' Content-Type: - application/json Cross-Origin-Opener-Policy: - same-origin Location: - - http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/6ff51134-9907-4243-ab83-d63e84e684c7 + - http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/5f63ec5c-4e54-428f-9596-6c68f4e3a780 Referrer-Policy: - same-origin Vary: @@ -55,9 +55,9 @@ interactions: - request: body: '{"informatieobjecttype": "http://localhost:8003/catalogi/api/v1/informatieobjecttypen/531f6c1a-97f7-478c-85f0-67d2f23661c7", "bronorganisatie": "000000000", "creatiedatum": "2024-03-19", "titel": "Form - 031", "auteur": "Aanvrager", "taal": "nld", "formaat": "audio/vnd.wave", "inhoud": + 005", "auteur": "Aanvrager", "taal": "nld", "formaat": "multipart/signed", "inhoud": "Y29udGVudA==", "status": "definitief", "bestandsnaam": "attachment2_1.jpg", - "ontvangstdatum": "2024-03-17", "beschrijving": "Bijgevoegd document", "indicatieGebruiksrecht": + "ontvangstdatum": "2024-03-10", "beschrijving": "Bijgevoegd document", "indicatieGebruiksrecht": false, "bestandsomvang": 7}' headers: Accept: @@ -69,7 +69,7 @@ interactions: Connection: - keep-alive Content-Length: - - '486' + - '488' Content-Type: - application/json User-Agent: @@ -78,22 +78,22 @@ interactions: uri: http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten response: body: - string: '{"url":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/2b2b0be4-bc49-4272-9d5a-3ab61c9135eb","identificatie":"DOCUMENT-2024-0000000029","bronorganisatie":"000000000","creatiedatum":"2024-03-19","titel":"Form - 031","vertrouwelijkheidaanduiding":"openbaar","auteur":"Aanvrager","status":"definitief","formaat":"audio/vnd.wave","taal":"nld","versie":1,"beginRegistratie":"2024-12-19T08:19:30.927284Z","bestandsnaam":"attachment2_1.jpg","inhoud":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/2b2b0be4-bc49-4272-9d5a-3ab61c9135eb/download?versie=1","bestandsomvang":7,"link":"","beschrijving":"Bijgevoegd - document","ontvangstdatum":"2024-03-17","verzenddatum":null,"indicatieGebruiksrecht":false,"verschijningsvorm":"","ondertekening":{"soort":"","datum":null},"integriteit":{"algoritme":"","waarde":"","datum":null},"informatieobjecttype":"http://localhost:8003/catalogi/api/v1/informatieobjecttypen/531f6c1a-97f7-478c-85f0-67d2f23661c7","locked":false,"bestandsdelen":[],"trefwoorden":[],"lock":""}' + string: '{"url":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/f1d765f8-9284-43e8-a5f0-24c707c51321","identificatie":"DOCUMENT-2024-0000000169","bronorganisatie":"000000000","creatiedatum":"2024-03-19","titel":"Form + 005","vertrouwelijkheidaanduiding":"openbaar","auteur":"Aanvrager","status":"definitief","formaat":"multipart/signed","taal":"nld","versie":1,"beginRegistratie":"2025-01-29T17:01:17.430790Z","bestandsnaam":"attachment2_1.jpg","inhoud":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/f1d765f8-9284-43e8-a5f0-24c707c51321/download?versie=1","bestandsomvang":7,"link":"","beschrijving":"Bijgevoegd + document","ontvangstdatum":"2024-03-10","verzenddatum":null,"indicatieGebruiksrecht":false,"verschijningsvorm":"","ondertekening":{"soort":"","datum":null},"integriteit":{"algoritme":"","waarde":"","datum":null},"informatieobjecttype":"http://localhost:8003/catalogi/api/v1/informatieobjecttypen/531f6c1a-97f7-478c-85f0-67d2f23661c7","locked":false,"bestandsdelen":[],"trefwoorden":[],"lock":""}' headers: API-version: - 1.4.2 Allow: - GET, POST, HEAD, OPTIONS Content-Length: - - '1042' + - '1044' Content-Type: - application/json Cross-Origin-Opener-Policy: - same-origin Location: - - http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/2b2b0be4-bc49-4272-9d5a-3ab61c9135eb + - http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/f1d765f8-9284-43e8-a5f0-24c707c51321 Referrer-Policy: - same-origin Vary: @@ -136,11 +136,11 @@ interactions: Cross-Origin-Opener-Policy: - same-origin Date: - - Thu, 19 Dec 2024 08:19:31 GMT + - Wed, 29 Jan 2025 17:01:17 GMT Referrer-Policy: - same-origin Server: - - nginx/1.27.0 + - nginx/1.27.3 Vary: - origin X-Content-Type-Options: @@ -152,8 +152,8 @@ interactions: message: OK - request: body: '{"type": "http://objecttypes-web:8000/api/v2/objecttypes/527b8408-7421-4808-a744-43ccb7bdaaa2", - "record": {"typeVersion": 1, "data": {"multiple_files": ["http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/6ff51134-9907-4243-ab83-d63e84e684c7", - "http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/2b2b0be4-bc49-4272-9d5a-3ab61c9135eb"]}, + "record": {"typeVersion": 1, "data": {"multiple_files": ["http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/5f63ec5c-4e54-428f-9596-6c68f4e3a780", + "http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/f1d765f8-9284-43e8-a5f0-24c707c51321"]}, "startAt": "2024-03-19"}}' headers: Accept: @@ -176,7 +176,7 @@ interactions: uri: http://localhost:8002/api/v2/objects response: body: - string: '{"url":"http://objects-web:8000/api/v2/objects/e8e6ee8b-aa40-41cf-bfef-f6b41cdca3f6","uuid":"e8e6ee8b-aa40-41cf-bfef-f6b41cdca3f6","type":"http://objecttypes-web:8000/api/v2/objecttypes/527b8408-7421-4808-a744-43ccb7bdaaa2","record":{"index":1,"typeVersion":1,"data":{"multiple_files":["http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/6ff51134-9907-4243-ab83-d63e84e684c7","http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/2b2b0be4-bc49-4272-9d5a-3ab61c9135eb"]},"geometry":null,"startAt":"2024-03-19","endAt":null,"registrationAt":"2024-12-19","correctionFor":null,"correctedBy":null}}' + string: '{"url":"http://objects-web:8000/api/v2/objects/6df9d08e-8a80-46c8-86b1-bfd3d44ab849","uuid":"6df9d08e-8a80-46c8-86b1-bfd3d44ab849","type":"http://objecttypes-web:8000/api/v2/objecttypes/527b8408-7421-4808-a744-43ccb7bdaaa2","record":{"index":1,"typeVersion":1,"data":{"multiple_files":["http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/5f63ec5c-4e54-428f-9596-6c68f4e3a780","http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/f1d765f8-9284-43e8-a5f0-24c707c51321"]},"geometry":null,"startAt":"2024-03-19","endAt":null,"registrationAt":"2025-01-29","correctionFor":null,"correctedBy":null}}' headers: Allow: - GET, POST, HEAD, OPTIONS @@ -191,13 +191,13 @@ interactions: Cross-Origin-Opener-Policy: - same-origin Date: - - Thu, 19 Dec 2024 08:19:31 GMT + - Wed, 29 Jan 2025 17:01:17 GMT Location: - - http://localhost:8002/api/v2/objects/e8e6ee8b-aa40-41cf-bfef-f6b41cdca3f6 + - http://localhost:8002/api/v2/objects/6df9d08e-8a80-46c8-86b1-bfd3d44ab849 Referrer-Policy: - same-origin Server: - - nginx/1.27.0 + - nginx/1.27.3 Vary: - origin X-Content-Type-Options: diff --git a/src/openforms/registrations/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIBackendV2Tests/ObjectsAPIBackendV2Tests.test_submission_with_objects_api_v2.yaml b/src/openforms/registrations/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIBackendV2Tests/ObjectsAPIBackendV2Tests.test_submission_with_objects_api_v2.yaml index 8a7d3820a6..08d0b52c72 100644 --- a/src/openforms/registrations/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIBackendV2Tests/ObjectsAPIBackendV2Tests.test_submission_with_objects_api_v2.yaml +++ b/src/openforms/registrations/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIBackendV2Tests/ObjectsAPIBackendV2Tests.test_submission_with_objects_api_v2.yaml @@ -2,8 +2,8 @@ interactions: - request: body: '{"informatieobjecttype": "http://localhost:8003/catalogi/api/v1/informatieobjecttypen/7a474713-0833-402a-8441-e467c08ac55b", "bronorganisatie": "000000000", "creatiedatum": "2024-03-19", "titel": "Form - 000", "auteur": "Aanvrager", "taal": "nld", "formaat": "application/pdf", "inhoud": - "", "status": "definitief", "bestandsnaam": "open-forms-Form 000.pdf", "ontvangstdatum": + 006", "auteur": "Aanvrager", "taal": "nld", "formaat": "application/pdf", "inhoud": + "", "status": "definitief", "bestandsnaam": "open-forms-Form 006.pdf", "ontvangstdatum": null, "beschrijving": "Ingezonden formulier", "indicatieGebruiksrecht": false, "bestandsomvang": 0}' headers: @@ -25,9 +25,9 @@ interactions: uri: http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten response: body: - string: '{"url":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/ed5de000-7692-474a-b9e4-8dbded780e37","identificatie":"DOCUMENT-2024-0000000015","bronorganisatie":"000000000","creatiedatum":"2024-03-19","titel":"Form - 000","vertrouwelijkheidaanduiding":"openbaar","auteur":"Aanvrager","status":"definitief","formaat":"application/pdf","taal":"nld","versie":1,"beginRegistratie":"2024-12-19T10:06:16.789185Z","bestandsnaam":"open-forms-Form - 000.pdf","inhoud":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/ed5de000-7692-474a-b9e4-8dbded780e37/download?versie=1","bestandsomvang":0,"link":"","beschrijving":"Ingezonden + string: '{"url":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/cfa06b2d-7bae-46bd-8788-66e7e63f14d5","identificatie":"DOCUMENT-2024-0000000170","bronorganisatie":"000000000","creatiedatum":"2024-03-19","titel":"Form + 006","vertrouwelijkheidaanduiding":"openbaar","auteur":"Aanvrager","status":"definitief","formaat":"application/pdf","taal":"nld","versie":1,"beginRegistratie":"2025-01-29T17:01:17.726451Z","bestandsnaam":"open-forms-Form + 006.pdf","inhoud":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/cfa06b2d-7bae-46bd-8788-66e7e63f14d5/download?versie=1","bestandsomvang":0,"link":"","beschrijving":"Ingezonden formulier","ontvangstdatum":null,"verzenddatum":null,"indicatieGebruiksrecht":false,"verschijningsvorm":"","ondertekening":{"soort":"","datum":null},"integriteit":{"algoritme":"","waarde":"","datum":null},"informatieobjecttype":"http://localhost:8003/catalogi/api/v1/informatieobjecttypen/7a474713-0833-402a-8441-e467c08ac55b","locked":false,"bestandsdelen":[],"trefwoorden":[],"lock":""}' headers: API-version: @@ -41,7 +41,7 @@ interactions: Cross-Origin-Opener-Policy: - same-origin Location: - - http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/ed5de000-7692-474a-b9e4-8dbded780e37 + - http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/cfa06b2d-7bae-46bd-8788-66e7e63f14d5 Referrer-Policy: - same-origin Vary: @@ -56,11 +56,11 @@ interactions: - request: body: '{"informatieobjecttype": "http://localhost:8003/catalogi/api/v1/informatieobjecttypen/b2d83b94-9b9b-4e80-a82f-73ff993c62f3", "bronorganisatie": "000000000", "creatiedatum": "2024-03-19", "titel": "Form - 000 (csv)", "auteur": "Aanvrager", "taal": "nld", "formaat": "text/csv", "inhoud": - "Rm9ybXVsaWVybmFhbSxJbnplbmRpbmdkYXR1bSxhZ2UsbGFzdG5hbWUsbG9jYXRpb24NCkZvcm0gMDAwLDIwMjQtMDMtMDEgMTk6MDk6MjUuNDA4MjU5LDIwLE15IGxhc3QgbmFtZSwiWzUyLjM2NjczMzc4OTY3MTIyLCA0Ljg5MzE2NDI3NDQ3MDI5OV0iDQo=", - "status": "definitief", "bestandsnaam": "open-forms-Form 000 (csv).csv", "ontvangstdatum": + 006 (csv)", "auteur": "Aanvrager", "taal": "nld", "formaat": "text/csv", "inhoud": + "Rm9ybXVsaWVybmFhbSxJbnplbmRpbmdkYXR1bSxhZ2UsbGFzdG5hbWUsbG9jYXRpb24NCkZvcm0gMDA2LDIwMjQtMDMtMDMgMTk6MjY6MjYuNDQwMzA5LDIwLE15IGxhc3QgbmFtZSwieyd0eXBlJzogJ1BvaW50JywgJ2Nvb3JkaW5hdGVzJzogWzQuODkzMTY0Mjc0NDcwMjk5LCA1Mi4zNjY3MzM3ODk2NzEyMl19Ig0K", + "status": "definitief", "bestandsnaam": "open-forms-Form 006 (csv).csv", "ontvangstdatum": null, "beschrijving": "Ingezonden formulierdata", "indicatieGebruiksrecht": - false, "bestandsomvang": 146}' + false, "bestandsomvang": 180}' headers: Accept: - '*/*' @@ -71,7 +71,7 @@ interactions: Connection: - keep-alive Content-Length: - - '681' + - '725' Content-Type: - application/json User-Agent: @@ -80,9 +80,9 @@ interactions: uri: http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten response: body: - string: '{"url":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/7a1d75a4-8fd7-4945-b99d-05fadcd45e0b","identificatie":"DOCUMENT-2024-0000000016","bronorganisatie":"000000000","creatiedatum":"2024-03-19","titel":"Form - 000 (csv)","vertrouwelijkheidaanduiding":"openbaar","auteur":"Aanvrager","status":"definitief","formaat":"text/csv","taal":"nld","versie":1,"beginRegistratie":"2024-12-19T10:06:16.925004Z","bestandsnaam":"open-forms-Form - 000 (csv).csv","inhoud":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/7a1d75a4-8fd7-4945-b99d-05fadcd45e0b/download?versie=1","bestandsomvang":146,"link":"","beschrijving":"Ingezonden + string: '{"url":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/51084c9e-e508-45aa-b0f3-dd29b0c200cf","identificatie":"DOCUMENT-2024-0000000171","bronorganisatie":"000000000","creatiedatum":"2024-03-19","titel":"Form + 006 (csv)","vertrouwelijkheidaanduiding":"openbaar","auteur":"Aanvrager","status":"definitief","formaat":"text/csv","taal":"nld","versie":1,"beginRegistratie":"2025-01-29T17:01:17.828314Z","bestandsnaam":"open-forms-Form + 006 (csv).csv","inhoud":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/51084c9e-e508-45aa-b0f3-dd29b0c200cf/download?versie=1","bestandsomvang":180,"link":"","beschrijving":"Ingezonden formulierdata","ontvangstdatum":null,"verzenddatum":null,"indicatieGebruiksrecht":false,"verschijningsvorm":"","ondertekening":{"soort":"","datum":null},"integriteit":{"algoritme":"","waarde":"","datum":null},"informatieobjecttype":"http://localhost:8003/catalogi/api/v1/informatieobjecttypen/b2d83b94-9b9b-4e80-a82f-73ff993c62f3","locked":false,"bestandsdelen":[],"trefwoorden":[],"lock":""}' headers: API-version: @@ -96,7 +96,7 @@ interactions: Cross-Origin-Opener-Policy: - same-origin Location: - - http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/7a1d75a4-8fd7-4945-b99d-05fadcd45e0b + - http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/51084c9e-e508-45aa-b0f3-dd29b0c200cf Referrer-Policy: - same-origin Vary: @@ -125,7 +125,7 @@ interactions: uri: http://localhost:8001/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48 response: body: - string: '{"url":"http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48","uuid":"8e46e0a5-b1b4-449b-b9e9-fa3cea655f48","name":"Person","namePlural":"Persons","description":"","dataClassification":"open","maintainerOrganization":"","maintainerDepartment":"","contactPerson":"","contactEmail":"","source":"","updateFrequency":"unknown","providerOrganization":"","documentationUrl":"","labels":{},"createdAt":"2023-10-24","modifiedAt":"2024-11-25","allowGeometry":true,"versions":["http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48/versions/1","http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48/versions/2","http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48/versions/3","http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48/versions/4"]}' + string: '{"url":"http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48","uuid":"8e46e0a5-b1b4-449b-b9e9-fa3cea655f48","name":"Person","namePlural":"Persons","description":"","dataClassification":"open","maintainerOrganization":"","maintainerDepartment":"","contactPerson":"","contactEmail":"","source":"","updateFrequency":"unknown","providerOrganization":"","documentationUrl":"","labels":{},"createdAt":"2023-10-24","modifiedAt":"2024-11-25","allowGeometry":true,"versions":["http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48/versions/2","http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48/versions/3","http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48/versions/1","http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48/versions/4"]}' headers: Allow: - GET, PUT, PATCH, DELETE, HEAD, OPTIONS @@ -138,7 +138,7 @@ interactions: Cross-Origin-Opener-Policy: - same-origin Date: - - Thu, 19 Dec 2024 10:06:17 GMT + - Wed, 29 Jan 2025 17:01:17 GMT Referrer-Policy: - same-origin Server: @@ -156,8 +156,8 @@ interactions: body: '{"type": "http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48", "record": {"typeVersion": 3, "data": {"age": 20, "name": {"last.name": "My last name"}, "submission_date": "2024-03-19T13:40:00+00:00", "submission_pdf_url": - "http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/ed5de000-7692-474a-b9e4-8dbded780e37", - "submission_csv_url": "http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/7a1d75a4-8fd7-4945-b99d-05fadcd45e0b", + "http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/cfa06b2d-7bae-46bd-8788-66e7e63f14d5", + "submission_csv_url": "http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/51084c9e-e508-45aa-b0f3-dd29b0c200cf", "submission_payment_completed": false, "submission_payment_amount": null, "submission_payment_public_ids": [], "cosign_date": null}, "startAt": "2024-03-19", "geometry": {"type": "Point", "coordinates": [4.893164274470299, 52.36673378967122]}}}' @@ -182,8 +182,8 @@ interactions: uri: http://localhost:8002/api/v2/objects response: body: - string: '{"url":"http://objects-web:8000/api/v2/objects/a73b1bd4-91c0-444b-9241-93b111f83681","uuid":"a73b1bd4-91c0-444b-9241-93b111f83681","type":"http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48","record":{"index":1,"typeVersion":3,"data":{"age":20,"name":{"last.name":"My - last name"},"submission_date":"2024-03-19T13:40:00+00:00","submission_pdf_url":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/ed5de000-7692-474a-b9e4-8dbded780e37","submission_csv_url":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/7a1d75a4-8fd7-4945-b99d-05fadcd45e0b","submission_payment_completed":false,"submission_payment_amount":null,"submission_payment_public_ids":[],"cosign_date":null},"geometry":{"type":"Point","coordinates":[4.893164274470299,52.36673378967122]},"startAt":"2024-03-19","endAt":null,"registrationAt":"2024-12-19","correctionFor":null,"correctedBy":null}}' + string: '{"url":"http://objects-web:8000/api/v2/objects/40a7dc15-ee2b-4382-8ebb-dc247ca4bacf","uuid":"40a7dc15-ee2b-4382-8ebb-dc247ca4bacf","type":"http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48","record":{"index":1,"typeVersion":3,"data":{"age":20,"name":{"last.name":"My + last name"},"submission_date":"2024-03-19T13:40:00+00:00","submission_pdf_url":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/cfa06b2d-7bae-46bd-8788-66e7e63f14d5","submission_csv_url":"http://localhost:8003/documenten/api/v1/enkelvoudiginformatieobjecten/51084c9e-e508-45aa-b0f3-dd29b0c200cf","submission_payment_completed":false,"submission_payment_amount":null,"submission_payment_public_ids":[],"cosign_date":null},"geometry":{"type":"Point","coordinates":[4.893164274470299,52.36673378967122]},"startAt":"2024-03-19","endAt":null,"registrationAt":"2025-01-29","correctionFor":null,"correctedBy":null}}' headers: Allow: - GET, POST, HEAD, OPTIONS @@ -198,9 +198,9 @@ interactions: Cross-Origin-Opener-Policy: - same-origin Date: - - Thu, 19 Dec 2024 10:06:17 GMT + - Wed, 29 Jan 2025 17:01:18 GMT Location: - - http://localhost:8002/api/v2/objects/a73b1bd4-91c0-444b-9241-93b111f83681 + - http://localhost:8002/api/v2/objects/40a7dc15-ee2b-4382-8ebb-dc247ca4bacf Referrer-Policy: - same-origin Server: diff --git a/src/openforms/registrations/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIBackendV2Tests/ObjectsAPIBackendV2Tests.test_submission_with_objects_api_v2_with_payment_attributes.yaml b/src/openforms/registrations/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIBackendV2Tests/ObjectsAPIBackendV2Tests.test_submission_with_objects_api_v2_with_payment_attributes.yaml index 2bb10d918d..e0ed00c2c5 100644 --- a/src/openforms/registrations/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIBackendV2Tests/ObjectsAPIBackendV2Tests.test_submission_with_objects_api_v2_with_payment_attributes.yaml +++ b/src/openforms/registrations/contrib/objects_api/tests/files/vcr_cassettes/ObjectsAPIBackendV2Tests/ObjectsAPIBackendV2Tests.test_submission_with_objects_api_v2_with_payment_attributes.yaml @@ -16,7 +16,7 @@ interactions: uri: http://localhost:8001/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48 response: body: - string: '{"url":"http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48","uuid":"8e46e0a5-b1b4-449b-b9e9-fa3cea655f48","name":"Person","namePlural":"Persons","description":"","dataClassification":"open","maintainerOrganization":"","maintainerDepartment":"","contactPerson":"","contactEmail":"","source":"","updateFrequency":"unknown","providerOrganization":"","documentationUrl":"","labels":{},"createdAt":"2023-10-24","modifiedAt":"2024-11-25","allowGeometry":true,"versions":["http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48/versions/1","http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48/versions/2","http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48/versions/3","http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48/versions/4"]}' + string: '{"url":"http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48","uuid":"8e46e0a5-b1b4-449b-b9e9-fa3cea655f48","name":"Person","namePlural":"Persons","description":"","dataClassification":"open","maintainerOrganization":"","maintainerDepartment":"","contactPerson":"","contactEmail":"","source":"","updateFrequency":"unknown","providerOrganization":"","documentationUrl":"","labels":{},"createdAt":"2023-10-24","modifiedAt":"2024-11-25","allowGeometry":true,"versions":["http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48/versions/2","http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48/versions/3","http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48/versions/1","http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48/versions/4"]}' headers: Allow: - GET, PUT, PATCH, DELETE, HEAD, OPTIONS @@ -29,11 +29,11 @@ interactions: Cross-Origin-Opener-Policy: - same-origin Date: - - Thu, 19 Dec 2024 08:19:31 GMT + - Wed, 29 Jan 2025 17:01:18 GMT Referrer-Policy: - same-origin Server: - - nginx/1.27.0 + - nginx/1.27.3 Vary: - origin X-Content-Type-Options: @@ -70,7 +70,7 @@ interactions: uri: http://localhost:8002/api/v2/objects response: body: - string: '{"url":"http://objects-web:8000/api/v2/objects/07716bc2-5ebe-45c9-9d0e-6bcadc4850d4","uuid":"07716bc2-5ebe-45c9-9d0e-6bcadc4850d4","type":"http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48","record":{"index":1,"typeVersion":3,"data":{"submission_payment_completed":true,"submission_payment_amount":40.0,"submission_payment_public_ids":["foo","bar"],"submission_provider_payment_ids":["123456","654321"]},"geometry":null,"startAt":"2024-03-19","endAt":null,"registrationAt":"2024-12-19","correctionFor":null,"correctedBy":null}}' + string: '{"url":"http://objects-web:8000/api/v2/objects/1b713a04-69d2-4182-9653-695d3ca5dd27","uuid":"1b713a04-69d2-4182-9653-695d3ca5dd27","type":"http://objecttypes-web:8000/api/v2/objecttypes/8e46e0a5-b1b4-449b-b9e9-fa3cea655f48","record":{"index":1,"typeVersion":3,"data":{"submission_payment_completed":true,"submission_payment_amount":40.0,"submission_payment_public_ids":["foo","bar"],"submission_provider_payment_ids":["123456","654321"]},"geometry":null,"startAt":"2024-03-19","endAt":null,"registrationAt":"2025-01-29","correctionFor":null,"correctedBy":null}}' headers: Allow: - GET, POST, HEAD, OPTIONS @@ -85,13 +85,13 @@ interactions: Cross-Origin-Opener-Policy: - same-origin Date: - - Thu, 19 Dec 2024 08:19:31 GMT + - Wed, 29 Jan 2025 17:01:18 GMT Location: - - http://localhost:8002/api/v2/objects/07716bc2-5ebe-45c9-9d0e-6bcadc4850d4 + - http://localhost:8002/api/v2/objects/1b713a04-69d2-4182-9653-695d3ca5dd27 Referrer-Policy: - same-origin Server: - - nginx/1.27.0 + - nginx/1.27.3 Vary: - origin X-Content-Type-Options: diff --git a/src/openforms/registrations/contrib/objects_api/tests/test_backend_v2.py b/src/openforms/registrations/contrib/objects_api/tests/test_backend_v2.py index 1c2a05b304..a83129f437 100644 --- a/src/openforms/registrations/contrib/objects_api/tests/test_backend_v2.py +++ b/src/openforms/registrations/contrib/objects_api/tests/test_backend_v2.py @@ -10,6 +10,7 @@ from openforms.authentication.service import AuthAttribute from openforms.contrib.objects_api.tests.factories import ObjectsAPIGroupConfigFactory +from openforms.formio.tests.factories import SubmittedFileFactory from openforms.payments.constants import PaymentStatus from openforms.payments.tests.factories import SubmissionPaymentFactory from openforms.submissions.constants import PostSubmissionEvents @@ -400,6 +401,106 @@ def test_submission_with_file_components_container_variable(self): self.assertIsInstance(result["record"]["data"]["multiple_files"], list) self.assertEqual(len(result["record"]["data"]["multiple_files"]), 2) + @tag("gh-4689") + def test_submission_with_editgrid_with_nested_files(self): + formio_upload = SubmittedFileFactory.build() + submission = SubmissionFactory.from_components( + [ + { + "key": "repeatingGroup", + "type": "editgrid", + "label": "Repeating group", + "components": [ + { + "key": "nestedRepeatingGroup", + "type": "editgrid", + "label": "Yeah this is madness", + "components": [ + { + "key": "email", + "type": "email", + "label": "Email", + }, + { + "key": "file", + "type": "file", + "multiple": False, + }, + ], + } + ], + }, + ], + submitted_data={ + "repeatingGroup": [ + { + "nestedRepeatingGroup": [ + { + "email": "info@example.com", + "file": formio_upload, + } + ], + }, + ], + }, + completed=True, + ) + submission_step = submission.steps[0] + attachment = SubmissionFileAttachmentFactory.create( + submission_step=submission_step, + form_key="repeatingGroup", + file_name=formio_upload["originalName"], + original_name=formio_upload["originalName"], + _component_configuration_path="components.0.components.0.components.1", + _component_data_path="repeatingGroup.0.nestedRepeatingGroup.0.file", + ) + + v2_options: RegistrationOptionsV2 = { + "version": 2, + "objects_api_group": self.objects_api_group, + # See the docker compose fixtures for more info on these values: + "objecttype": UUID("8faed0fa-7864-4409-aa6d-533a37616a9e"), + "objecttype_version": 1, + "upload_submission_csv": False, + "update_existing_object": False, + "auth_attribute_path": [], + "informatieobjecttype_attachment": "http://localhost:8003/catalogi/api/v1/informatieobjecttypen/531f6c1a-97f7-478c-85f0-67d2f23661c7", + "organisatie_rsin": "000000000", + "variables_mapping": [ + { + "variable_key": "repeatingGroup", + "target_path": ["repeatingGroup"], + }, + ], + "iot_attachment": "", + "iot_submission_csv": "", + "iot_submission_report": "", + } + + plugin = ObjectsAPIRegistration(PLUGIN_IDENTIFIER) + + # Run the registration + result = plugin.register_submission(submission, v2_options) + assert result is not None + + objects_api_attachment = ( + attachment.objectsapisubmissionattachment_set.get() # pyright: ignore[reportAttributeAccessIssue] + ) + record_data = result["record"]["data"] + expected = { + "repeatingGroup": [ + { + "nestedRepeatingGroup": [ + { + "email": "info@example.com", + "file": objects_api_attachment.document_url, + } + ], + } + ], + } + self.assertEqual(record_data, expected) + def test_submission_with_empty_optional_file(self): submission = SubmissionFactory.from_components( [ diff --git a/src/openforms/typing.py b/src/openforms/typing.py index 75f1c34395..6719c88075 100644 --- a/src/openforms/typing.py +++ b/src/openforms/typing.py @@ -3,7 +3,7 @@ import datetime import decimal import uuid -from typing import TYPE_CHECKING, Any, NewType, Protocol +from typing import TYPE_CHECKING, Any, NewType, Protocol, Sequence from django.http import HttpRequest from django.http.response import HttpResponseBase @@ -18,7 +18,7 @@ type JSONPrimitive = str | int | float | bool | None -type JSONValue = JSONPrimitive | JSONObject | list[JSONValue] +type JSONValue = JSONPrimitive | JSONObject | Sequence[JSONValue] type JSONObject = dict[str, JSONValue]