From 0cc81ad95f20e7a05a7351ec76a1c3088d0115ae Mon Sep 17 00:00:00 2001 From: Barry Brands Date: Tue, 17 Dec 2024 17:44:04 +0100 Subject: [PATCH 1/6] Mappings and config added for xxllnc v1 -> zgw --- .../xxllnc-suite-to-publications copy.json | 26 +++++++++++ .../mappings/xxllnc-v1-case-to-zgw-zaak.json | 43 +++++++++++++++++++ .../xxllnc-v1-casetype-to-zgw-zaaktype.json | 38 ++++++++++++++++ ...-document-to-zgw-zaakinformatieobject.json | 28 ++++++++++++ .../xxllnc-v1-milestone-to-zgw-status.json | 15 +++++++ .../xxllnc-v1-outcome-to-zgw-resultaat.json | 11 +++++ .../xxllnc-v1-rolerequestor-to-zgw-rol.json | 34 +++++++++++++++ ...xxllnc-v1-value-to-zgw-zaakeigenschap.json | 12 ++++++ .../xxllnc-zgw/sources/xxllnc-v1.json | 7 +++ .../xxllnc-suite-to-publications copy.json | 25 +++++++++++ 10 files changed, 239 insertions(+) create mode 100644 configurations/xxllnc-zgw/mappings/xxllnc-suite-to-publications copy.json create mode 100644 configurations/xxllnc-zgw/mappings/xxllnc-v1-case-to-zgw-zaak.json create mode 100644 configurations/xxllnc-zgw/mappings/xxllnc-v1-casetype-to-zgw-zaaktype.json create mode 100644 configurations/xxllnc-zgw/mappings/xxllnc-v1-document-to-zgw-zaakinformatieobject.json create mode 100644 configurations/xxllnc-zgw/mappings/xxllnc-v1-milestone-to-zgw-status.json create mode 100644 configurations/xxllnc-zgw/mappings/xxllnc-v1-outcome-to-zgw-resultaat.json create mode 100644 configurations/xxllnc-zgw/mappings/xxllnc-v1-rolerequestor-to-zgw-rol.json create mode 100644 configurations/xxllnc-zgw/mappings/xxllnc-v1-value-to-zgw-zaakeigenschap.json create mode 100644 configurations/xxllnc-zgw/sources/xxllnc-v1.json create mode 100644 configurations/xxllnc-zgw/synchronizations/xxllnc-suite-to-publications copy.json diff --git a/configurations/xxllnc-zgw/mappings/xxllnc-suite-to-publications copy.json b/configurations/xxllnc-zgw/mappings/xxllnc-suite-to-publications copy.json new file mode 100644 index 00000000..57ab360a --- /dev/null +++ b/configurations/xxllnc-zgw/mappings/xxllnc-suite-to-publications copy.json @@ -0,0 +1,26 @@ +{ + "name": "Xxllnc suite to Publication", + "version": "0.0.1", + "mapping": { + "title": "omschrijving", + "summary": "zaaktypeomschrijving", + "description": "zaaktypeomschrijving", + "category": "{% if zaaktypecode|default %}{% set wooVerzoekenEnBesluiten = ['LP00000431', 'B1873'] %}{% set klachtoordelen = ['LP00000091', 'LP00001132', 'LP00000121', 'B0757', 'LP00000832', 'LP00001096'] %}{% if zaaktypecode in wooVerzoekenEnBesluiten %}{{ 'Woo-verzoeken en -besluiten' }}{% elseif zaaktypecode in klachtoordelen %}{{ 'Klachtoordelen' }}{% endif %}{% endif %}", + "published": "startdatum", + "modified": "{{ 'now'|date('H:i:sTm-d-Y') }}", + "attachments": "[{% if files|default %}{% for file in files %} { {% if file['titel']|default %}\"title\": \"{{ file['titel'] }}\",{% endif %}\"labels\": [\"{{ 'Informatieverzoek' }}\"],{% if file['formaat']|default %}\"extension\": \"{{ file['formaat']|split('/')|last }}\",\"type\": \"{{ file['formaat'] }}\",{% endif %}{% if file['inhoud']|default and file['formaat']|default %}\"accessUrl\": \"data:{{ file['formaat'] }};base64,{{ file.inhoud }}\"{% endif %} }{{ loop.last ? '' : ',' }} {% endfor %}{% endif %}]", + "status": "Concept" + }, + "unset": [ + "" + ], + "cast": { + "title": "unsetIfValue==omschrijving", + "summary": "unsetIfValue==zaaktypeomschrijving", + "description": "unsetIfValue==zaaktypeomschrijving", + "category": "unsetIfValue==", + "published": "unsetIfValue==startdatum", + "attachments": "jsonToArray" + }, + "passThrough": false +} \ No newline at end of file diff --git a/configurations/xxllnc-zgw/mappings/xxllnc-v1-case-to-zgw-zaak.json b/configurations/xxllnc-zgw/mappings/xxllnc-v1-case-to-zgw-zaak.json new file mode 100644 index 00000000..4f286d30 --- /dev/null +++ b/configurations/xxllnc-zgw/mappings/xxllnc-v1-case-to-zgw-zaak.json @@ -0,0 +1,43 @@ +{ + "name": "Xxllnc Case to ZGW Zaak", + "version": "0.0.1", + "mapping": { + "identificatie": "reference", + "omschrijving": "instance.subject", + "toelichting": "instance.subject_external", + "registratiedatum": "instance.date_of_registration", + "startdatum": "instance.date_of_registration", + "einddatum": "instance.date_of_completion", + "einddatumGepland": "instance.date_target", + "publicatiedatum": "instance.date_target", + "communicatiekanaal": "instance.channel_of_contact", + "vertrouwelijkheidaanduidng": "instance.confidentiality.mapped", + "kenmerken.0.kenmerk": "reference", + "kenmerken.0.bron": "xxllnc v1 api", + "betalingsindicatie": "{% if instance.price == '-' %}{{ 'nvt' }}{% elseif instance.payment_status is null or instance.payment_status == '' %}{{ 'nog_niet' }}{% else %}{{ 'geheel' }}{% endif %}", + "betalingsindicatieWeergave": "{% if instance.price == '-' %}{{ 'Zaak kent geen prijs' }}{% elseif instance.payment_status is null or instance.payment_status == '' %}{{ 'Er moet nog betaald worden' }}{% else %}{{ 'De volledige kosten zijn betaald' }}{% endif %}", + "resultaattoelichting": "{% if instance.outcome.instance.name|default %}{{ instance.outcome.instance.name }}{% endif %}", + "resultaat": "{% if instance.outcome|default %}{% set data = {'outcome': instance.outcome, 'resultaattypen': zaaktype.resultaattypen} %}{{ executeMapping(2, data)|json_encode }}{% endif %}", + "rollen": "[{% if instance.route.instance.role|default %}{% set dataRol = {'requestor': instance.requestor, 'role': instance.route.instance.role, 'roltypen': zaaktype.roltypen} %}{{ executeMapping(3, dataRol)|json_encode }}{% endif %}]", + "status": "{% if instance.milestone|default %}{% set data = {'milestone': instance.milestone, 'statustypen': zaaktype.statustypen} %}{{ executeMapping(4, data)|json_encode }}{% endif %}", + "zaaktype": "{% if zaaktype['_self']['id']|default %}{{ zaaktype['_self']['id'] }}{% endif %}", + "eigenschappen": "[{% set index=0 %}{% if zaaktype.eigenschappen|default %}{% for key, attribute in instance.attributes %}{% if index != 0 %},{% endif %}{% set data = {'name': key, 'value': attribute, 'eigenschappen': zaaktype.eigenschappen} %}{% if attribute[0][0]|default and attribute[0][0] is iterable %}{{ attribute|json_encode }}{% else %}{{ executeMapping(5, data)|json_encode }}{% endif %}{% set index=index+1 %}{% endfor %}{% endif %}]", + "zaakinformatieobjecten": "[{% set index=0 %}{% if documents|default %}{% for document in documents %}{% if index != 0 %},{% endif %}{{ executeMapping(6, document)|json_encode }}{% set index=index+1 %}{% endfor %}{% endif %}]", + "bronorganisatie": "bronorganisatie", + "verantwoordelijkeOrganisatie": "bronorganisatie", + "opschorting.indicatie": "{% if instance.stalled_until|default %}true{% else %}{% endif %}", + "opschorting.reden": "{% if instance.stalled_until|default %}Unknown{% endif %}" + }, + "unset": [], + "cast": { + "resultaat": "jsonToArray", + "rollen": "jsonToArray", + "status": "jsonToArray", + "eigenschappen": "jsonToArray", + "opschorting.indicatie": "unsetIfValue==", + "opschorting.reden": "unsetIfValue==", + "opschorting": "unsetIfValue==", + "zaakinformatieobjecten": "jsonToArray" + }, + "passTrough": false +} \ No newline at end of file diff --git a/configurations/xxllnc-zgw/mappings/xxllnc-v1-casetype-to-zgw-zaaktype.json b/configurations/xxllnc-zgw/mappings/xxllnc-v1-casetype-to-zgw-zaaktype.json new file mode 100644 index 00000000..0a58fb86 --- /dev/null +++ b/configurations/xxllnc-zgw/mappings/xxllnc-v1-casetype-to-zgw-zaaktype.json @@ -0,0 +1,38 @@ +{ + "name": "Xxllnc Casetype to ZGW ZaakType", + "version": "0.0.1", + "mapping": { + "identificatie": "instance.legacy.zaaktype_id", + "catalogus": "_catalogus", + "onderwerp": "instance.title", + "indicatieInternOfExtern": "extern", + "doorlooptijd": "{% if instance.properties.lead_time_legal.weken|default %}P{{ instance.properties.lead_time_legal.weken }}W{% elseif instance.properties.lead_time_legal.kalenderdagen|default %}P{{ instance.properties.lead_time_legal.kalenderdagen }}D{% else %}{{ \"\" }}{% endif %}", + "servicenorm": "{% if instance.properties.lead_time_service.weken|default %}P{{ instance.properties.lead_time_service.weken }}W{% elseif instance.properties.lead_time_service.kalenderdagen|default %}P{{ instance.properties.lead_time_service.kalenderdagen }}D{% else %}{{ \"\" }}{% endif %}", + "vertrouwelijkheidaanduiding": "{{ instance.properties.designation_of_confidentiality|lower }}", + "verlengingMogelijk": "instance.properties.extension", + "publicatieIndicatie": "instance.properties.publication", + "omschrijving": "instance.title", + "opschortingEnAanhoudingMogelijk": "instance.properties.suspension", + "statustypen": "[{% for phase in instance.phases %}{% set phase = phase|merge({'_catalogus': _catalogus, '_zaaktypeIdentificatie': instance.legacy.zaaktype_id}) %}{% if not loop.first %},{% endif %}{{ executeMapping(7, phase)|json_encode }}{% endfor %}]", + "informatieobjecttypen": "[{% set index=0 %}{% for phase in instance.phases %}{% for field in phase.fields %}{% if field.type == 'file' %}{% set field = field|merge({'_catalogus': _catalogus, '_zaaktypeIdentificatie': instance.legacy.zaaktype_id}) %}{% if index != 0 %},{% endif %}{{ executMapping(8, field)|json_encode }}{% set index=index+1 %}{% endif %}{% endfor %}{% endfor %}]", + "eigenschappen": "[{% set index=0 %}{% for phase in instance.phases %}{% for field in phase.fields %}{% if field.type != 'file' %}{% set field = field|merge({'_catalogus': _catalogus, '_zaaktypeIdentificatie': instance.legacy.zaaktype_id}) %}{% if index != 0 %},{% endif %}{{ executMapping(9, field)|json_encode }}{% set index=index+1 %}{% endif %}{% endfor %}{% endfor %}]", + "roltypen": "[{% set index=0 %}{% for phase in instance.phases %}{% if phase.route.role|default %}{% set role = phase.route.role|merge({'_catalogus': _catalogus, '_zaaktypeIdentificatie': instance.legacy.zaaktype_id}) %}{% if index != 0 %},{% endif %}{{ executMapping(10, role)|json_encode }}{% set index=index+1 %}{% endif %}{% endfor %}]", + "resultaattypen": "[{% if instance.results|default %}{% for result in instance.results %}{% set result = result|merge({'_catalogus': _catalogus, '_zaaktypeIdentificatie': instance.legacy.zaaktype_id}) %}{% if not loop.first %},{% endif %}{{ executMapping(11, result)|json_encode }}{% endfor %}{% endif %}]", + "bronzaaktype.url": "url", + "bronzaaktype.identificatie": "reference", + "bronzaaktype.omschrijving": "instance.title", + "referentieproces.naam": "preview", + "verantwoordelijke": "instance.properties.supervisor" + }, + "unset": { + "identificatie": "unsetIfValue==instance.legacy.zaaktype_id" + }, + "cast": { + "statustypen": "jsonToArray", + "informatieobjecttypen": "jsonToArray", + "eigenschappen": "jsonToArray", + "roltypen": "jsonToArray", + "resultaattypen": "jsonToArray" + }, + "passTrough": false +} \ No newline at end of file diff --git a/configurations/xxllnc-zgw/mappings/xxllnc-v1-document-to-zgw-zaakinformatieobject.json b/configurations/xxllnc-zgw/mappings/xxllnc-v1-document-to-zgw-zaakinformatieobject.json new file mode 100644 index 00000000..63618a12 --- /dev/null +++ b/configurations/xxllnc-zgw/mappings/xxllnc-v1-document-to-zgw-zaakinformatieobject.json @@ -0,0 +1,28 @@ +{ + "name": "Xxllnc Document to ZGW ZaakInformatieObject", + "version": "0.0.1", + "mapping": { + "titel": "result.instance.name", + "registratiedatum": "result.instance.file.instance.date_created", + "informatieobject.identificatie": "result.instance.number", + "informatieobject.creatiedatum": "result.instance.file.instance.date_created", + "informatieobject.titel": "result.instance.name", + "informatieobject.vertrouwelijksheidaanduiding": "{% if result.instance.metadata.instance.trust_level|default %}{{ result.instance.metadata.instance.trust_level|lower }}{% endif %}", + "informatieobject.formaat": "result.instance.file.instance.mimetype", + "informatieobject.versie": "1", + "informatieobject.beginRegistratie": "result.instance.file.instance.date_modified", + "informatieobject.bestandsnaam": "result.instance.filename", + "informatieobject.bestandsomvang": "result.instance.file.instance.size", + "informatieobject.verschijningsvorm": "{% if result.instance.metadata.instance.category|default %}{{ result.instance.metadata.instance.category }}{% endif %}", + "informatieobject.integriteit.algoritme": "{% if result.instance.file.instance|default %}{% set algoritmeArray = ['crc_16','crc_32','crc_64','fletcher4','fletcher8','fletcher16','fletcher32','hmac','md5','sha_1','sha_256','sha_512','sha_3'] %}{% for algoritme in algoritmeArray %}{% if result.instance.file.instance[algoritme]|default %}{{ algoritme }}{% endif %}{% endfor %}{% endif %}", + "informatieobject.integriteit.waarde": "{% if result.instance.file.instance|default %}{% set algoritmeArray = ['crc_16','crc_32','crc_64','fletcher4','fletcher8','fletcher16','fletcher32','hmac','md5','sha_1','sha_256','sha_512','sha_3'] %}{% for algoritme in algoritmeArray %}{% if result.instance.file.instance[algoritme]|default %}{{ result.instance.file.instance[algoritme] }}{% endif %}{% endfor %}{% endif %}", + "informatieobject.integriteit.datum": "result.instance.file.instance.date_created", + "informatieobject.inhoud": "inhoud" + }, + "unset": [], + "cast": { + "informatieobject.versie": "integer", + "informatieobject.bestandsomvang": "integer" + }, + "passTrough": false +} \ No newline at end of file diff --git a/configurations/xxllnc-zgw/mappings/xxllnc-v1-milestone-to-zgw-status.json b/configurations/xxllnc-zgw/mappings/xxllnc-v1-milestone-to-zgw-status.json new file mode 100644 index 00000000..b7409599 --- /dev/null +++ b/configurations/xxllnc-zgw/mappings/xxllnc-v1-milestone-to-zgw-status.json @@ -0,0 +1,15 @@ +{ + "name": "Xxllnc Milestone to ZGW Status", + "version": "0.0.1", + "mapping": { + "datumStatusGezet": "milestone.instance.date_modified", + "statustoelichting": "milestone.instance.phase_label", + "indicatieLaatstGezetteStatus": "{{ true }}", + "statustype": "{% for statustype in statustypen %}{% if statustype.omschrijving == milestone.instance.phase_label %}{{ statustype['_self']['id'] }}{% endif %}{% endfor %}" + }, + "unset": [], + "cast": { + "indicatieLaatstGezetteStatus": "bool" + }, + "passTrough": false +} \ No newline at end of file diff --git a/configurations/xxllnc-zgw/mappings/xxllnc-v1-outcome-to-zgw-resultaat.json b/configurations/xxllnc-zgw/mappings/xxllnc-v1-outcome-to-zgw-resultaat.json new file mode 100644 index 00000000..4ff8c3ec --- /dev/null +++ b/configurations/xxllnc-zgw/mappings/xxllnc-v1-outcome-to-zgw-resultaat.json @@ -0,0 +1,11 @@ +{ + "name": "Xxllnc Outcome to ZGW Resultaat", + "version": "0.0.1", + "mapping": { + "toelichting": "{% if outcome.instance.name|default %}{{ outcome.instance.name }}{% endif %}", + "resultaattype": "{% if resultaattypen|default %}{% for resultaattype in resultaattypen %}{% if resultaattype.toelichting == outcome.instance.name %}{{ resultaattype['_self']['id'] }}{% endif %}{% endfor %}{% endif %}" + }, + "unset": [], + "cast": [], + "passTrough": false +} \ No newline at end of file diff --git a/configurations/xxllnc-zgw/mappings/xxllnc-v1-rolerequestor-to-zgw-rol.json b/configurations/xxllnc-zgw/mappings/xxllnc-v1-rolerequestor-to-zgw-rol.json new file mode 100644 index 00000000..5910b347 --- /dev/null +++ b/configurations/xxllnc-zgw/mappings/xxllnc-v1-rolerequestor-to-zgw-rol.json @@ -0,0 +1,34 @@ +{ + "name": "Xxllnc RoleRequestor to ZGW Rol", + "version": "0.0.1", + "mapping": { + "betrokkeneType": "{% if role.instance.name|default %}{% if role.instance.name == 'Behandelaar'|lower %}medewerker{% else %}medewerker{% endif %}{% endif %}", + "omschrijving": "{% if role.instance.name|default %}{{ role.instance.name }}{% endif %}", + "omschrijvingGeneriek": "{% if role.instance.description|default %}{{ role.instance.description }}{% endif %}", + "roltoelichting": "{% if role.instance.name|default %}{{ role.instance.name }}{% endif %}", + "registratiedatum": "{% if role.instance.date_created|default %}{{ role.instance.date_created }}{% endif %}", + "contactpersoonRol.emailadres": "{% if requestor.instance.subject.instance.email_adress|default %}{{ requestor.instance.subject.instance.email_adress }}{% endif %}", + "contactpersoonRol.functie": "{% if requestor.instance.subject.instance.positions.instance.rows|default %}{% for position in requestor.instance.subject.instance.positions.instance.rows %}{% if role.preview|default %}{{ role.preview }}{% endif %}{% endfor %}{% endif %}", + "contactpersoonRol.telefoonnummer": "{% if requestor.instance.subject.instance.phone_number|default %}{{ requestor.instance.subject.instance.phone_number }}{% endif %}", + "contactpersoonRol.naam": "{% if requestor.instance.subject.instance.firstname|default %}{{ requestor.instance.subject.instance.firstname }} {% endif %}{% if requestor.instance.subject.instance.surname|default %}{{ requestor.instance.subject.instance.surname }}{% endif %}", + "betrokkeneIdentificatie._sourceId": "{% if requestor.reference|default %}{{ requestor.reference }}{% endif %}", + "betrokkeneIdentificatie.inpBsn": "{% if requestor.instance.subject.instance.personal_number|default %}{{ requestor.instance.subject.instance.personal_number }}{% endif %}", + "betrokkeneIdentificatie.inpA_nummer": "{% if requestor.instance.subject.instance.personal_number_a|default %}{{ requestor.instance.subject.instance.personal_number_a }}{% endif %}", + "betrokkeneIdentificatie.geslachtsnaam": "{% if requestor.instance.subject.instance.gender|default %}{{ requestor.instance.subject.instance.gender }}{% endif %}", + "betrokkeneIdentificatie.voorvoegselGeslachtsnaam": "{% if requestor.instance.subject.instance.prefix|default %}{{ requestor.instance.subject.instance.prefix }}{% endif %}", + "betrokkeneIdentificatie.voorletters": "{% if requestor.instance.subject.instance.initials|default %}{{ requestor.instance.subject.instance.initials }}{% endif %}", + "betrokkeneIdentificatie.voornamen": "{% if requestor.instance.subject.instance.first_names|default %}{{ requestor.instance.subject.instance.first_names }}{% endif %}", + "betrokkeneIdentificatie.geslachtsaanduiding": "{% if requestor.instance.subject.instance.geslachtsnaam|default %}{{ requestor.instance.subject.instance.geslachtsnaam }}{% endif %}", + "betrokkeneIdentificatie.geboortedatum": "{% if requestor.instance.subject.instance.date_of_birth|default %}{{ requestor.instance.subject.instance.date_of_birth }}{% endif %}", + "betrokkeneIdentificatie.achternaam": "{% if requestor.instance.subject.instance.surname|default %}{{ requestor.instance.subject.instance.surname }}{% endif %}", + "betrokkeneIdentificatie.verblijfsadres.wplWoonplaatsNaam": "{% if requestor.instance.subject.instance.address_residence.instance.city|default %}{{ requestor.instance.subject.instance.address_residence.instance.city }}{% endif %}", + "betrokkeneIdentificatie.verblijfsadres.aoaPostcode": "{% if requestor.instance.subject.instance.address_residence.instance.zipcode|default %}{{ requestor.instance.subject.instance.address_residence.instance.zipcode }}{% endif %}", + "betrokkeneIdentificatie.verblijfsadres.aoaHuisnummer": "{% if requestor.instance.subject.instance.address_residence.instance.street_number|default %}{{ requestor.instance.subject.instance.address_residence.instance.street_number }}{% endif %}", + "betrokkeneIdentificatie.verblijfsadres.aoaHuisletter": "{% if requestor.instance.subject.instance.address_residence.instance.street_number_letter|default %}{{ requestor.instance.subject.instance.address_residence.instance.street_number_letter }}{% endif %}", + "betrokkeneIdentificatie.verblijfsadres.aoaHuisnummertoevoeging": "{% if requestor.instance.subject.instance.address_residence.instance.street_number_suffix|default %}{{ requestor.instance.subject.instance.address_residence.instance.street_number_suffix }}{% endif %}", + "roltype": "{% if role.instance.name|default %}{% for roltype in roltypen %}{% if roltype.omschrijvingGeneriek|lower == role.instance.name|lower %}{{ roltype['_self']['id'] }}{% endif %}{% endfor %}{% endif %}" + }, + "unset": [], + "cast": [], + "passTrough": false +} \ No newline at end of file diff --git a/configurations/xxllnc-zgw/mappings/xxllnc-v1-value-to-zgw-zaakeigenschap.json b/configurations/xxllnc-zgw/mappings/xxllnc-v1-value-to-zgw-zaakeigenschap.json new file mode 100644 index 00000000..88828190 --- /dev/null +++ b/configurations/xxllnc-zgw/mappings/xxllnc-v1-value-to-zgw-zaakeigenschap.json @@ -0,0 +1,12 @@ +{ + "name": "Xxllnc Value to ZGW ZaakEigenschap", + "version": "0.0.1", + "mapping": { + "naam": "{% if name|default %}{{ name }}{% endif %}", + "waarde": "{% if value[0]|default and value[0] is not iterable %}{{ value[0] }}{% elseif value[0][0]|default and value[0][0] is not iterable %}{{ value[0][0] }}{% elseif value[0][0][0]|default and value[0][0][0] is not iterable %}{{ value[0][0][0] }}{% else %}{{ value|json_encode}}{% endif %}", + "eigenschap": "{% for eigenschap in eigenschappen %}{% if eigenschap.naam == name %}{{ eigenschap['_self']['id'] }}{% endif %}{% endfor %}" + }, + "unset": [], + "cast": [], + "passTrough": false +} \ No newline at end of file diff --git a/configurations/xxllnc-zgw/sources/xxllnc-v1.json b/configurations/xxllnc-zgw/sources/xxllnc-v1.json new file mode 100644 index 00000000..c9e0998f --- /dev/null +++ b/configurations/xxllnc-zgw/sources/xxllnc-v1.json @@ -0,0 +1,7 @@ +{ + "name": "Xxllnc V1 API", + "version": "0.0.1", + "location": "", + "isEnabled": true, + "type": "api" +} \ No newline at end of file diff --git a/configurations/xxllnc-zgw/synchronizations/xxllnc-suite-to-publications copy.json b/configurations/xxllnc-zgw/synchronizations/xxllnc-suite-to-publications copy.json new file mode 100644 index 00000000..cd09f29c --- /dev/null +++ b/configurations/xxllnc-zgw/synchronizations/xxllnc-suite-to-publications copy.json @@ -0,0 +1,25 @@ +{ + "name": "Xxllnc cases to ZGW zaken", + "description": "", + "version": "0.0.1", + "sourceId": "1", + "sourceType": "api", + "sourceHash": "", + "sourceHashMapping": "", + "sourceTargetMapping": "1", + "sourceConfig": { + "idPosition": "reference", + "resultsPosition": "result.instance.rows", + "endpoint": "\/case", + "query": [], + "headers.API-KEY": "", + "headers.API-Interface-ID": "" + }, + "currentPage": 1, + "targetId": "1\/1", + "targetType": "register\/schema", + "targetHash": "", + "targetSourceMapping": "", + "targetConfig": [], + "followUps": [] +} \ No newline at end of file From 922e9fcf8300817a079de7a2dabc782dff0c2477 Mon Sep 17 00:00:00 2001 From: Barry Brands Date: Thu, 19 Dec 2024 07:20:43 +0100 Subject: [PATCH 2/6] zgw mapping fixes --- .../mappings/xxllnc-v1-case-to-zgw-zaak.json | 4 +-- .../xxllnc-v1-casetype-to-zgw-zaaktype.json | 5 ++- ...-document-to-zgw-zaakinformatieobject.json | 33 ++++++++++--------- .../xxllnc-v1-rolerequestor-to-zgw-rol.json | 5 ++- ...json => xxllnc-v1-cases-to-zgw-zaken.json} | 6 +++- 5 files changed, 30 insertions(+), 23 deletions(-) rename configurations/xxllnc-zgw/synchronizations/{xxllnc-suite-to-publications copy.json => xxllnc-v1-cases-to-zgw-zaken.json} (66%) diff --git a/configurations/xxllnc-zgw/mappings/xxllnc-v1-case-to-zgw-zaak.json b/configurations/xxllnc-zgw/mappings/xxllnc-v1-case-to-zgw-zaak.json index 4f286d30..62fe4e95 100644 --- a/configurations/xxllnc-zgw/mappings/xxllnc-v1-case-to-zgw-zaak.json +++ b/configurations/xxllnc-zgw/mappings/xxllnc-v1-case-to-zgw-zaak.json @@ -20,9 +20,9 @@ "resultaat": "{% if instance.outcome|default %}{% set data = {'outcome': instance.outcome, 'resultaattypen': zaaktype.resultaattypen} %}{{ executeMapping(2, data)|json_encode }}{% endif %}", "rollen": "[{% if instance.route.instance.role|default %}{% set dataRol = {'requestor': instance.requestor, 'role': instance.route.instance.role, 'roltypen': zaaktype.roltypen} %}{{ executeMapping(3, dataRol)|json_encode }}{% endif %}]", "status": "{% if instance.milestone|default %}{% set data = {'milestone': instance.milestone, 'statustypen': zaaktype.statustypen} %}{{ executeMapping(4, data)|json_encode }}{% endif %}", - "zaaktype": "{% if zaaktype['_self']['id']|default %}{{ zaaktype['_self']['id'] }}{% endif %}", + "zaaktype": "{% if zaaktype|default %}{{ executeMapping(7, zaaktype)|json_encode }}{% endif %}", "eigenschappen": "[{% set index=0 %}{% if zaaktype.eigenschappen|default %}{% for key, attribute in instance.attributes %}{% if index != 0 %},{% endif %}{% set data = {'name': key, 'value': attribute, 'eigenschappen': zaaktype.eigenschappen} %}{% if attribute[0][0]|default and attribute[0][0] is iterable %}{{ attribute|json_encode }}{% else %}{{ executeMapping(5, data)|json_encode }}{% endif %}{% set index=index+1 %}{% endfor %}{% endif %}]", - "zaakinformatieobjecten": "[{% set index=0 %}{% if documents|default %}{% for document in documents %}{% if index != 0 %},{% endif %}{{ executeMapping(6, document)|json_encode }}{% set index=index+1 %}{% endfor %}{% endif %}]", + "zaakinformatieobjecten": "[{% set index=0 %}{% if documents.result.instance.rows|default %}{% for document in documents.result.instance.rows %}{% if index != 0 %},{% endif %}{{ executeMapping(6, document)|json_encode }}{% set index=index+1 %}{% endfor %}{% endif %}]", "bronorganisatie": "bronorganisatie", "verantwoordelijkeOrganisatie": "bronorganisatie", "opschorting.indicatie": "{% if instance.stalled_until|default %}true{% else %}{% endif %}", diff --git a/configurations/xxllnc-zgw/mappings/xxllnc-v1-casetype-to-zgw-zaaktype.json b/configurations/xxllnc-zgw/mappings/xxllnc-v1-casetype-to-zgw-zaaktype.json index 0a58fb86..0e4e0d71 100644 --- a/configurations/xxllnc-zgw/mappings/xxllnc-v1-casetype-to-zgw-zaaktype.json +++ b/configurations/xxllnc-zgw/mappings/xxllnc-v1-casetype-to-zgw-zaaktype.json @@ -24,10 +24,9 @@ "referentieproces.naam": "preview", "verantwoordelijke": "instance.properties.supervisor" }, - "unset": { - "identificatie": "unsetIfValue==instance.legacy.zaaktype_id" - }, + "unset": [], "cast": { + "identificatie": "unsetIfValue==instance.legacy.zaaktype_id", "statustypen": "jsonToArray", "informatieobjecttypen": "jsonToArray", "eigenschappen": "jsonToArray", diff --git a/configurations/xxllnc-zgw/mappings/xxllnc-v1-document-to-zgw-zaakinformatieobject.json b/configurations/xxllnc-zgw/mappings/xxllnc-v1-document-to-zgw-zaakinformatieobject.json index 63618a12..3db72eb7 100644 --- a/configurations/xxllnc-zgw/mappings/xxllnc-v1-document-to-zgw-zaakinformatieobject.json +++ b/configurations/xxllnc-zgw/mappings/xxllnc-v1-document-to-zgw-zaakinformatieobject.json @@ -2,27 +2,28 @@ "name": "Xxllnc Document to ZGW ZaakInformatieObject", "version": "0.0.1", "mapping": { - "titel": "result.instance.name", - "registratiedatum": "result.instance.file.instance.date_created", - "informatieobject.identificatie": "result.instance.number", - "informatieobject.creatiedatum": "result.instance.file.instance.date_created", - "informatieobject.titel": "result.instance.name", - "informatieobject.vertrouwelijksheidaanduiding": "{% if result.instance.metadata.instance.trust_level|default %}{{ result.instance.metadata.instance.trust_level|lower }}{% endif %}", - "informatieobject.formaat": "result.instance.file.instance.mimetype", + "titel": "instance.name", + "registratiedatum": "instance.file.instance.date_created", + "informatieobject.identificatie": "instance.number", + "informatieobject.creatiedatum": "instance.file.instance.date_created", + "informatieobject.titel": "instance.name", + "informatieobject.vertrouwelijksheidaanduiding": "{% if instance.metadata.instance.trust_level|default %}{{ instance.metadata.instance.trust_level|lower }}{% endif %}", + "informatieobject.formaat": "instance.file.instance.mimetype", "informatieobject.versie": "1", - "informatieobject.beginRegistratie": "result.instance.file.instance.date_modified", - "informatieobject.bestandsnaam": "result.instance.filename", - "informatieobject.bestandsomvang": "result.instance.file.instance.size", - "informatieobject.verschijningsvorm": "{% if result.instance.metadata.instance.category|default %}{{ result.instance.metadata.instance.category }}{% endif %}", - "informatieobject.integriteit.algoritme": "{% if result.instance.file.instance|default %}{% set algoritmeArray = ['crc_16','crc_32','crc_64','fletcher4','fletcher8','fletcher16','fletcher32','hmac','md5','sha_1','sha_256','sha_512','sha_3'] %}{% for algoritme in algoritmeArray %}{% if result.instance.file.instance[algoritme]|default %}{{ algoritme }}{% endif %}{% endfor %}{% endif %}", - "informatieobject.integriteit.waarde": "{% if result.instance.file.instance|default %}{% set algoritmeArray = ['crc_16','crc_32','crc_64','fletcher4','fletcher8','fletcher16','fletcher32','hmac','md5','sha_1','sha_256','sha_512','sha_3'] %}{% for algoritme in algoritmeArray %}{% if result.instance.file.instance[algoritme]|default %}{{ result.instance.file.instance[algoritme] }}{% endif %}{% endfor %}{% endif %}", - "informatieobject.integriteit.datum": "result.instance.file.instance.date_created", - "informatieobject.inhoud": "inhoud" + "informatieobject.beginRegistratie": "instance.file.instance.date_modified", + "informatieobject.bestandsnaam": "instance.filename", + "informatieobject.bestandsomvang": "instance.file.instance.size", + "informatieobject.verschijningsvorm": "{% if instance.metadata.instance.category|default %}{{ instance.metadata.instance.category }}{% endif %}", + "informatieobject.integriteit.algoritme": "{% if instance.file.instance|default %}{% set algoritmeArray = ['crc_16','crc_32','crc_64','fletcher4','fletcher8','fletcher16','fletcher32','hmac','md5','sha_1','sha_256','sha_512','sha_3'] %}{% for algoritme in algoritmeArray %}{% if result.instance.file.instance[algoritme]|default %}{{ algoritme }}{% endif %}{% endfor %}{% endif %}", + "informatieobject.integriteit.waarde": "{% if instance.file.instance|default %}{% set algoritmeArray = ['crc_16','crc_32','crc_64','fletcher4','fletcher8','fletcher16','fletcher32','hmac','md5','sha_1','sha_256','sha_512','sha_3'] %}{% for algoritme in algoritmeArray %}{% if result.instance.file.instance[algoritme]|default %}{{ result.instance.file.instance[algoritme] }}{% endif %}{% endfor %}{% endif %}", + "informatieobject.integriteit.datum": "instance.file.instance.date_created", + "informatieobject.inhoud": "{\"accessUrl\": \"{{ '/case/'~caseId~'/document/'~reference~'/download' }}\", \"source\": \"2\"}" }, "unset": [], "cast": { "informatieobject.versie": "integer", - "informatieobject.bestandsomvang": "integer" + "informatieobject.bestandsomvang": "integer", + "informatieobject.inhoud": "jsonToArray" }, "passTrough": false } \ No newline at end of file diff --git a/configurations/xxllnc-zgw/mappings/xxllnc-v1-rolerequestor-to-zgw-rol.json b/configurations/xxllnc-zgw/mappings/xxllnc-v1-rolerequestor-to-zgw-rol.json index 5910b347..5369ed0e 100644 --- a/configurations/xxllnc-zgw/mappings/xxllnc-v1-rolerequestor-to-zgw-rol.json +++ b/configurations/xxllnc-zgw/mappings/xxllnc-v1-rolerequestor-to-zgw-rol.json @@ -29,6 +29,9 @@ "roltype": "{% if role.instance.name|default %}{% for roltype in roltypen %}{% if roltype.omschrijvingGeneriek|lower == role.instance.name|lower %}{{ roltype['_self']['id'] }}{% endif %}{% endfor %}{% endif %}" }, "unset": [], - "cast": [], + "cast": { + "roltype": "unsetIfValue==", + "betrokkeneIdentificatie": "unsetIfValue==" + }, "passTrough": false } \ No newline at end of file diff --git a/configurations/xxllnc-zgw/synchronizations/xxllnc-suite-to-publications copy.json b/configurations/xxllnc-zgw/synchronizations/xxllnc-v1-cases-to-zgw-zaken.json similarity index 66% rename from configurations/xxllnc-zgw/synchronizations/xxllnc-suite-to-publications copy.json rename to configurations/xxllnc-zgw/synchronizations/xxllnc-v1-cases-to-zgw-zaken.json index cd09f29c..0d1dc77e 100644 --- a/configurations/xxllnc-zgw/synchronizations/xxllnc-suite-to-publications copy.json +++ b/configurations/xxllnc-zgw/synchronizations/xxllnc-v1-cases-to-zgw-zaken.json @@ -13,7 +13,11 @@ "endpoint": "\/case", "query": [], "headers.API-KEY": "", - "headers.API-Interface-ID": "" + "headers.API-Interface-ID": "", + "extraDataConfigs.0.staticEndpoint": "/case/{{ originId }}/document", + "extraDataConfigs.0.mergeExtraData": "true", + "extraDataConfigs.0.keyToSetExtraData": "documents", + "extraDataConfigs.0.resultsLocation": "result.instance.rows" }, "currentPage": 1, "targetId": "1\/1", From 268db673bd1efca6e4c8b20d0534900287fbae0a Mon Sep 17 00:00:00 2001 From: Barry Brands Date: Thu, 19 Dec 2024 09:46:00 +0100 Subject: [PATCH 3/6] applyConfigDot for extra data requests --- lib/Service/SynchronizationService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Service/SynchronizationService.php b/lib/Service/SynchronizationService.php index 3f51accd..255079b4 100644 --- a/lib/Service/SynchronizationService.php +++ b/lib/Service/SynchronizationService.php @@ -201,7 +201,7 @@ public function getObjectFromSource(Synchronization $synchronization, string $en $source = $this->sourceMapper->find(id: $synchronization->getSourceId()); // Lets get the source config - $sourceConfig = $synchronization->getSourceConfig(); + $sourceConfig = $this->callService->applyConfigDot($synchronization->getSourceConfig()); $headers = $sourceConfig['headers'] ?? []; $query = $sourceConfig['query'] ?? []; $config = [ From 66ddae31340dbc3ae600c452a9bddcaeb188773b Mon Sep 17 00:00:00 2001 From: Barry Brands Date: Thu, 19 Dec 2024 10:47:04 +0100 Subject: [PATCH 4/6] Fix originId and extra fetching --- .../mappings/xxllnc-v1-case-to-zgw-zaak.json | 9 +++++---- .../xxllnc-v1-milestone-to-zgw-status.json | 3 ++- .../xxllnc-v1-outcome-to-zgw-resultaat.json | 4 +++- .../xxllnc-v1-cases-to-zgw-zaken.json | 5 ++++- lib/Service/SynchronizationService.php | 20 +++++++++++++++---- 5 files changed, 30 insertions(+), 11 deletions(-) diff --git a/configurations/xxllnc-zgw/mappings/xxllnc-v1-case-to-zgw-zaak.json b/configurations/xxllnc-zgw/mappings/xxllnc-v1-case-to-zgw-zaak.json index 62fe4e95..a86c02b0 100644 --- a/configurations/xxllnc-zgw/mappings/xxllnc-v1-case-to-zgw-zaak.json +++ b/configurations/xxllnc-zgw/mappings/xxllnc-v1-case-to-zgw-zaak.json @@ -20,9 +20,9 @@ "resultaat": "{% if instance.outcome|default %}{% set data = {'outcome': instance.outcome, 'resultaattypen': zaaktype.resultaattypen} %}{{ executeMapping(2, data)|json_encode }}{% endif %}", "rollen": "[{% if instance.route.instance.role|default %}{% set dataRol = {'requestor': instance.requestor, 'role': instance.route.instance.role, 'roltypen': zaaktype.roltypen} %}{{ executeMapping(3, dataRol)|json_encode }}{% endif %}]", "status": "{% if instance.milestone|default %}{% set data = {'milestone': instance.milestone, 'statustypen': zaaktype.statustypen} %}{{ executeMapping(4, data)|json_encode }}{% endif %}", - "zaaktype": "{% if zaaktype|default %}{{ executeMapping(7, zaaktype)|json_encode }}{% endif %}", - "eigenschappen": "[{% set index=0 %}{% if zaaktype.eigenschappen|default %}{% for key, attribute in instance.attributes %}{% if index != 0 %},{% endif %}{% set data = {'name': key, 'value': attribute, 'eigenschappen': zaaktype.eigenschappen} %}{% if attribute[0][0]|default and attribute[0][0] is iterable %}{{ attribute|json_encode }}{% else %}{{ executeMapping(5, data)|json_encode }}{% endif %}{% set index=index+1 %}{% endfor %}{% endif %}]", - "zaakinformatieobjecten": "[{% set index=0 %}{% if documents.result.instance.rows|default %}{% for document in documents.result.instance.rows %}{% if index != 0 %},{% endif %}{{ executeMapping(6, document)|json_encode }}{% set index=index+1 %}{% endfor %}{% endif %}]", + "zaaktype": "{% if casetype|default %}{{ executeMapping(5, casetype)|json_encode }}{% endif %}", + "eigenschappen": "[{% set index=0 %}{% if zaaktype.eigenschappen|default %}{% for key, attribute in instance.attributes %}{% if index != 0 %},{% endif %}{% set data = {'name': key, 'value': attribute, 'eigenschappen': zaaktype.eigenschappen} %}{% if attribute[0][0]|default and attribute[0][0] is iterable %}{{ attribute|json_encode }}{% else %}{{ executeMapping(6, data)|json_encode }}{% endif %}{% set index=index+1 %}{% endfor %}{% endif %}]", + "zaakinformatieobjecten": "[{% set index=0 %}{% if documents.result.instance.rows|default %}{% for document in documents.result.instance.rows %}{% if index != 0 %},{% endif %}{{ executeMapping(7, document)|json_encode }}{% set index=index+1 %}{% endfor %}{% endif %}]", "bronorganisatie": "bronorganisatie", "verantwoordelijkeOrganisatie": "bronorganisatie", "opschorting.indicatie": "{% if instance.stalled_until|default %}true{% else %}{% endif %}", @@ -37,7 +37,8 @@ "opschorting.indicatie": "unsetIfValue==", "opschorting.reden": "unsetIfValue==", "opschorting": "unsetIfValue==", - "zaakinformatieobjecten": "jsonToArray" + "zaakinformatieobjecten": "jsonToArray", + "zaaktype": "jsonToArray" }, "passTrough": false } \ No newline at end of file diff --git a/configurations/xxllnc-zgw/mappings/xxllnc-v1-milestone-to-zgw-status.json b/configurations/xxllnc-zgw/mappings/xxllnc-v1-milestone-to-zgw-status.json index b7409599..ce2564de 100644 --- a/configurations/xxllnc-zgw/mappings/xxllnc-v1-milestone-to-zgw-status.json +++ b/configurations/xxllnc-zgw/mappings/xxllnc-v1-milestone-to-zgw-status.json @@ -9,7 +9,8 @@ }, "unset": [], "cast": { - "indicatieLaatstGezetteStatus": "bool" + "indicatieLaatstGezetteStatus": "bool", + "statustype": "unsetIfValue==" }, "passTrough": false } \ No newline at end of file diff --git a/configurations/xxllnc-zgw/mappings/xxllnc-v1-outcome-to-zgw-resultaat.json b/configurations/xxllnc-zgw/mappings/xxllnc-v1-outcome-to-zgw-resultaat.json index 4ff8c3ec..ea9754ab 100644 --- a/configurations/xxllnc-zgw/mappings/xxllnc-v1-outcome-to-zgw-resultaat.json +++ b/configurations/xxllnc-zgw/mappings/xxllnc-v1-outcome-to-zgw-resultaat.json @@ -6,6 +6,8 @@ "resultaattype": "{% if resultaattypen|default %}{% for resultaattype in resultaattypen %}{% if resultaattype.toelichting == outcome.instance.name %}{{ resultaattype['_self']['id'] }}{% endif %}{% endfor %}{% endif %}" }, "unset": [], - "cast": [], + "cast": { + "resultaattype": "unsetIfValue==" + }, "passTrough": false } \ No newline at end of file diff --git a/configurations/xxllnc-zgw/synchronizations/xxllnc-v1-cases-to-zgw-zaken.json b/configurations/xxllnc-zgw/synchronizations/xxllnc-v1-cases-to-zgw-zaken.json index 0d1dc77e..660461e5 100644 --- a/configurations/xxllnc-zgw/synchronizations/xxllnc-v1-cases-to-zgw-zaken.json +++ b/configurations/xxllnc-zgw/synchronizations/xxllnc-v1-cases-to-zgw-zaken.json @@ -17,7 +17,10 @@ "extraDataConfigs.0.staticEndpoint": "/case/{{ originId }}/document", "extraDataConfigs.0.mergeExtraData": "true", "extraDataConfigs.0.keyToSetExtraData": "documents", - "extraDataConfigs.0.resultsLocation": "result.instance.rows" + "extraDataConfigs.1.staticEndpoint": "/casetype/{{ originId }}", + "extraDataConfigs.1.endpointIdLocation": "instance.casetype.reference", + "extraDataConfigs.1.mergeExtraData": "true", + "extraDataConfigs.1.keyToSetExtraData": "casetype" }, "currentPage": 1, "targetId": "1\/1", diff --git a/lib/Service/SynchronizationService.php b/lib/Service/SynchronizationService.php index 255079b4..b00daf8f 100644 --- a/lib/Service/SynchronizationService.php +++ b/lib/Service/SynchronizationService.php @@ -234,12 +234,13 @@ public function getObjectFromSource(Synchronization $synchronization, string $en * - KEY_FOR_EXTRA_DATA_LOCATION: The key under which the extra data should be returned. * - MERGE_EXTRA_DATA_OBJECT_LOCATION: Boolean flag indicating whether to merge the extra data with the object. * @param array $object The original object for which extra data needs to be fetched. + * @param string|null $originId * * @return array The original object merged with the extra data, or the extra data itself based on the configuration. * * @throws Exception If both dynamic and static endpoint configurations are missing or the endpoint cannot be determined. */ - private function fetchExtraDataForObject(Synchronization $synchronization, array $extraDataConfig, array $object) + private function fetchExtraDataForObject(Synchronization $synchronization, array $extraDataConfig, array $object, ?string $originId = null) { if (isset($extraDataConfig[$this::EXTRA_DATA_DYNAMIC_ENDPOINT_LOCATION]) === false && isset($extraDataConfig[$this::EXTRA_DATA_STATIC_ENDPOINT_LOCATION]) === false) { return $object; @@ -253,9 +254,20 @@ private function fetchExtraDataForObject(Synchronization $synchronization, array // Get endpoint static defined in config. if (isset($extraDataConfig[$this::EXTRA_DATA_STATIC_ENDPOINT_LOCATION]) === true) { + + if ($originId === null) { + $originId = $this->getOriginId($synchronization, $object); + } + + if (isset($extraDataConfig['endpointIdLocation']) === true) { + $dotObject = new Dot($object); + $originId = $dotObject->get($extraDataConfig['endpointIdLocation']); + } + + $endpoint = $extraDataConfig[$this::EXTRA_DATA_STATIC_ENDPOINT_LOCATION]; - $endpoint = str_replace(search: '{{ originId }}', replace: $this->getOriginId($synchronization, $object), subject: $endpoint); - $endpoint = str_replace(search: '{{originId}}', replace: $this->getOriginId($synchronization, $object), subject: $endpoint); + $endpoint = str_replace(search: '{{ originId }}', replace: $originId, subject: $endpoint); + $endpoint = str_replace(search: '{{originId}}', replace: $originId, subject: $endpoint); } if (!$endpoint) { @@ -275,7 +287,7 @@ private function fetchExtraDataForObject(Synchronization $synchronization, array $results = $dotObject->get($extraDataConfig['resultsLocation']); foreach ($results as $key => $result) { - $results[$key] = $this->fetchExtraDataForObject($synchronization, $extraDataConfig['extraDataConfigPerResult'], $result); + $results[$key] = $this->fetchExtraDataForObject(synchronization: $synchronization, extraDataConfig: $extraDataConfig['extraDataConfigPerResult'], object: $result, originId: $originId); } $extraData = $results; From 9babc0d7bcb14c5c3d74cee7c7d1e646916eacf9 Mon Sep 17 00:00:00 2001 From: Barry Brands Date: Thu, 19 Dec 2024 11:52:04 +0100 Subject: [PATCH 5/6] Mapping fixes --- .../mappings/xxllnc-v1-case-to-zgw-zaak.json | 2 +- .../mappings/xxllnc-v1-casetype-to-zgw-zaaktype.json | 12 +----------- ...llnc-v1-document-to-zgw-zaakinformatieobject.json | 2 +- .../xxllnc-v1-cases-to-zgw-zaken.json | 4 +--- 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/configurations/xxllnc-zgw/mappings/xxllnc-v1-case-to-zgw-zaak.json b/configurations/xxllnc-zgw/mappings/xxllnc-v1-case-to-zgw-zaak.json index a86c02b0..129c219f 100644 --- a/configurations/xxllnc-zgw/mappings/xxllnc-v1-case-to-zgw-zaak.json +++ b/configurations/xxllnc-zgw/mappings/xxllnc-v1-case-to-zgw-zaak.json @@ -22,7 +22,7 @@ "status": "{% if instance.milestone|default %}{% set data = {'milestone': instance.milestone, 'statustypen': zaaktype.statustypen} %}{{ executeMapping(4, data)|json_encode }}{% endif %}", "zaaktype": "{% if casetype|default %}{{ executeMapping(5, casetype)|json_encode }}{% endif %}", "eigenschappen": "[{% set index=0 %}{% if zaaktype.eigenschappen|default %}{% for key, attribute in instance.attributes %}{% if index != 0 %},{% endif %}{% set data = {'name': key, 'value': attribute, 'eigenschappen': zaaktype.eigenschappen} %}{% if attribute[0][0]|default and attribute[0][0] is iterable %}{{ attribute|json_encode }}{% else %}{{ executeMapping(6, data)|json_encode }}{% endif %}{% set index=index+1 %}{% endfor %}{% endif %}]", - "zaakinformatieobjecten": "[{% set index=0 %}{% if documents.result.instance.rows|default %}{% for document in documents.result.instance.rows %}{% if index != 0 %},{% endif %}{{ executeMapping(7, document)|json_encode }}{% set index=index+1 %}{% endfor %}{% endif %}]", + "zaakinformatieobjecten": "[{% set index=0 %}{% if documents.result.instance.rows|default %}{% for document in documents.result.instance.rows %}{% set document = document|merge({'caseId': reference}) %}{% if index != 0 %},{% endif %}{{ executeMapping(7, document)|json_encode }}{% set index=index+1 %}{% endfor %}{% endif %}]", "bronorganisatie": "bronorganisatie", "verantwoordelijkeOrganisatie": "bronorganisatie", "opschorting.indicatie": "{% if instance.stalled_until|default %}true{% else %}{% endif %}", diff --git a/configurations/xxllnc-zgw/mappings/xxllnc-v1-casetype-to-zgw-zaaktype.json b/configurations/xxllnc-zgw/mappings/xxllnc-v1-casetype-to-zgw-zaaktype.json index 0e4e0d71..1d4e5f02 100644 --- a/configurations/xxllnc-zgw/mappings/xxllnc-v1-casetype-to-zgw-zaaktype.json +++ b/configurations/xxllnc-zgw/mappings/xxllnc-v1-casetype-to-zgw-zaaktype.json @@ -13,11 +13,6 @@ "publicatieIndicatie": "instance.properties.publication", "omschrijving": "instance.title", "opschortingEnAanhoudingMogelijk": "instance.properties.suspension", - "statustypen": "[{% for phase in instance.phases %}{% set phase = phase|merge({'_catalogus': _catalogus, '_zaaktypeIdentificatie': instance.legacy.zaaktype_id}) %}{% if not loop.first %},{% endif %}{{ executeMapping(7, phase)|json_encode }}{% endfor %}]", - "informatieobjecttypen": "[{% set index=0 %}{% for phase in instance.phases %}{% for field in phase.fields %}{% if field.type == 'file' %}{% set field = field|merge({'_catalogus': _catalogus, '_zaaktypeIdentificatie': instance.legacy.zaaktype_id}) %}{% if index != 0 %},{% endif %}{{ executMapping(8, field)|json_encode }}{% set index=index+1 %}{% endif %}{% endfor %}{% endfor %}]", - "eigenschappen": "[{% set index=0 %}{% for phase in instance.phases %}{% for field in phase.fields %}{% if field.type != 'file' %}{% set field = field|merge({'_catalogus': _catalogus, '_zaaktypeIdentificatie': instance.legacy.zaaktype_id}) %}{% if index != 0 %},{% endif %}{{ executMapping(9, field)|json_encode }}{% set index=index+1 %}{% endif %}{% endfor %}{% endfor %}]", - "roltypen": "[{% set index=0 %}{% for phase in instance.phases %}{% if phase.route.role|default %}{% set role = phase.route.role|merge({'_catalogus': _catalogus, '_zaaktypeIdentificatie': instance.legacy.zaaktype_id}) %}{% if index != 0 %},{% endif %}{{ executMapping(10, role)|json_encode }}{% set index=index+1 %}{% endif %}{% endfor %}]", - "resultaattypen": "[{% if instance.results|default %}{% for result in instance.results %}{% set result = result|merge({'_catalogus': _catalogus, '_zaaktypeIdentificatie': instance.legacy.zaaktype_id}) %}{% if not loop.first %},{% endif %}{{ executMapping(11, result)|json_encode }}{% endfor %}{% endif %}]", "bronzaaktype.url": "url", "bronzaaktype.identificatie": "reference", "bronzaaktype.omschrijving": "instance.title", @@ -26,12 +21,7 @@ }, "unset": [], "cast": { - "identificatie": "unsetIfValue==instance.legacy.zaaktype_id", - "statustypen": "jsonToArray", - "informatieobjecttypen": "jsonToArray", - "eigenschappen": "jsonToArray", - "roltypen": "jsonToArray", - "resultaattypen": "jsonToArray" + "identificatie": "unsetIfValue==instance.legacy.zaaktype_id" }, "passTrough": false } \ No newline at end of file diff --git a/configurations/xxllnc-zgw/mappings/xxllnc-v1-document-to-zgw-zaakinformatieobject.json b/configurations/xxllnc-zgw/mappings/xxllnc-v1-document-to-zgw-zaakinformatieobject.json index 3db72eb7..56b8a012 100644 --- a/configurations/xxllnc-zgw/mappings/xxllnc-v1-document-to-zgw-zaakinformatieobject.json +++ b/configurations/xxllnc-zgw/mappings/xxllnc-v1-document-to-zgw-zaakinformatieobject.json @@ -17,7 +17,7 @@ "informatieobject.integriteit.algoritme": "{% if instance.file.instance|default %}{% set algoritmeArray = ['crc_16','crc_32','crc_64','fletcher4','fletcher8','fletcher16','fletcher32','hmac','md5','sha_1','sha_256','sha_512','sha_3'] %}{% for algoritme in algoritmeArray %}{% if result.instance.file.instance[algoritme]|default %}{{ algoritme }}{% endif %}{% endfor %}{% endif %}", "informatieobject.integriteit.waarde": "{% if instance.file.instance|default %}{% set algoritmeArray = ['crc_16','crc_32','crc_64','fletcher4','fletcher8','fletcher16','fletcher32','hmac','md5','sha_1','sha_256','sha_512','sha_3'] %}{% for algoritme in algoritmeArray %}{% if result.instance.file.instance[algoritme]|default %}{{ result.instance.file.instance[algoritme] }}{% endif %}{% endfor %}{% endif %}", "informatieobject.integriteit.datum": "instance.file.instance.date_created", - "informatieobject.inhoud": "{\"accessUrl\": \"{{ '/case/'~caseId~'/document/'~reference~'/download' }}\", \"source\": \"2\"}" + "informatieobject.inhoud": "{\"downloadUrl\": \"{{ 'https://xxllncapiv1/case/'~caseId~'/document/'~reference~'/download' }}\", \"source\": \"2\"}" }, "unset": [], "cast": { diff --git a/configurations/xxllnc-zgw/synchronizations/xxllnc-v1-cases-to-zgw-zaken.json b/configurations/xxllnc-zgw/synchronizations/xxllnc-v1-cases-to-zgw-zaken.json index 660461e5..c6fbc6cb 100644 --- a/configurations/xxllnc-zgw/synchronizations/xxllnc-v1-cases-to-zgw-zaken.json +++ b/configurations/xxllnc-zgw/synchronizations/xxllnc-v1-cases-to-zgw-zaken.json @@ -11,9 +11,7 @@ "idPosition": "reference", "resultsPosition": "result.instance.rows", "endpoint": "\/case", - "query": [], - "headers.API-KEY": "", - "headers.API-Interface-ID": "", + "query.zql": "select {} from case where case.casetype.id=", "extraDataConfigs.0.staticEndpoint": "/case/{{ originId }}/document", "extraDataConfigs.0.mergeExtraData": "true", "extraDataConfigs.0.keyToSetExtraData": "documents", From fa8be6b8fa7508d40f71579e9c5312c2cc240745 Mon Sep 17 00:00:00 2001 From: Barry Brands Date: Thu, 19 Dec 2024 11:56:09 +0100 Subject: [PATCH 6/6] remove copy --- .../xxllnc-suite-to-publications copy.json | 26 ------------------- 1 file changed, 26 deletions(-) delete mode 100644 configurations/xxllnc-zgw/mappings/xxllnc-suite-to-publications copy.json diff --git a/configurations/xxllnc-zgw/mappings/xxllnc-suite-to-publications copy.json b/configurations/xxllnc-zgw/mappings/xxllnc-suite-to-publications copy.json deleted file mode 100644 index 57ab360a..00000000 --- a/configurations/xxllnc-zgw/mappings/xxllnc-suite-to-publications copy.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "Xxllnc suite to Publication", - "version": "0.0.1", - "mapping": { - "title": "omschrijving", - "summary": "zaaktypeomschrijving", - "description": "zaaktypeomschrijving", - "category": "{% if zaaktypecode|default %}{% set wooVerzoekenEnBesluiten = ['LP00000431', 'B1873'] %}{% set klachtoordelen = ['LP00000091', 'LP00001132', 'LP00000121', 'B0757', 'LP00000832', 'LP00001096'] %}{% if zaaktypecode in wooVerzoekenEnBesluiten %}{{ 'Woo-verzoeken en -besluiten' }}{% elseif zaaktypecode in klachtoordelen %}{{ 'Klachtoordelen' }}{% endif %}{% endif %}", - "published": "startdatum", - "modified": "{{ 'now'|date('H:i:sTm-d-Y') }}", - "attachments": "[{% if files|default %}{% for file in files %} { {% if file['titel']|default %}\"title\": \"{{ file['titel'] }}\",{% endif %}\"labels\": [\"{{ 'Informatieverzoek' }}\"],{% if file['formaat']|default %}\"extension\": \"{{ file['formaat']|split('/')|last }}\",\"type\": \"{{ file['formaat'] }}\",{% endif %}{% if file['inhoud']|default and file['formaat']|default %}\"accessUrl\": \"data:{{ file['formaat'] }};base64,{{ file.inhoud }}\"{% endif %} }{{ loop.last ? '' : ',' }} {% endfor %}{% endif %}]", - "status": "Concept" - }, - "unset": [ - "" - ], - "cast": { - "title": "unsetIfValue==omschrijving", - "summary": "unsetIfValue==zaaktypeomschrijving", - "description": "unsetIfValue==zaaktypeomschrijving", - "category": "unsetIfValue==", - "published": "unsetIfValue==startdatum", - "attachments": "jsonToArray" - }, - "passThrough": false -} \ No newline at end of file