Skip to content

Commit

Permalink
Merge pull request #180 from ConductionNL/feature/CONNECTOR-182/sub-c…
Browse files Browse the repository at this point in the history
…ontracts

Create and update sub contracts
  • Loading branch information
bbrands02 authored Jan 16, 2025
2 parents 12fb587 + 8e28781 commit b1ac026
Show file tree
Hide file tree
Showing 23 changed files with 597 additions and 20 deletions.
21 changes: 21 additions & 0 deletions configurations/woo-elastic/mappings/publication-to-elastic.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "Publication to Elastic",
"description": "",
"version": "0.0.1",
"mapping": {
"doctype": "{% if categorie is defined and categorie == 'Convenanten' %}{{ categorie }}{% else %}OpenWOO{% endif %}",
"title": "{{ titel | default('') }}",
"excerpt": "{{ samenvatting | default('') }}",
"date": "{{ publicatiedatum | default('') }}",
"link": "/openwoo/{{ titel | lower | strip_tags | preg_replace('/[^a-z0-9\\s-]/', '') | preg_replace('/[\\s-]+/', '-') | trim('-', '-') }}",
"content_filtered": "{{ beschrijving | default('') }}"
},
"unset": [],
"cast": {
"title": "unsetIfValue==",
"excerpt": "unsetIfValue==",
"date": "unsetIfValue==",
"content_filtered": "unsetIfValue=="
},
"passThrough": true
}
22 changes: 22 additions & 0 deletions configurations/woo-elastic/sources/elastic.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "Elastic API",
"description": "Elastic API",
"reference": null,
"version": "0.0.1",
"location": "",
"isEnabled": true,
"type": "api",
"authorizationHeader": "Authorization",
"auth": "none",
"authorizationPassthroughMethod": "header",
"authenticationConfig": [],
"configuration": {
"headers": {
"Authorization": "ApiKey ..",
"Content-Type": "application/json"
}
},
"logRetention": 3600,
"errorRetention": 86400,
"test": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "Publication to Elastic",
"description": "This config might be currently incomplete",
"version": "0.0.1",
"sourceId": "1/1",
"sourceType": "register/schema",
"sourceHash": "",
"sourceTargetMapping": "1",
"targetConfig": {
"idPosition": "_id",
"endpoint": "/_doc",
"headers": [],
"query": []
},
"targetId": "1",
"targetType": "api"
}
21 changes: 19 additions & 2 deletions configurations/xxllnc-zgw/mappings/xxllnc-v1-case-to-zgw-zaak.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"name": "Xxllnc Case to ZGW Zaak",
"version": "0.0.1",
"mapping": {
"originId": "reference",
"_sourceId": "reference",
"identificatie": "reference",
"omschrijving": "instance.subject",
"toelichting": "instance.subject_external",
Expand All @@ -20,7 +22,7 @@
"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 casetype|default %}{{ executeMapping(5, casetype)|json_encode }}{% endif %}",
"zaaktype": "{% if casetype.result|default %}{{ executeMapping(5, casetype.result)|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 %}{% set document = document|merge({'caseId': reference}) %}{% if index != 0 %},{% endif %}{{ executeMapping(7, document)|json_encode }}{% set index=index+1 %}{% endfor %}{% endif %}]",
"bronorganisatie": "bronorganisatie",
Expand All @@ -30,6 +32,7 @@
},
"unset": [],
"cast": {
"zaaktype": "jsonToArray",
"resultaat": "jsonToArray",
"rollen": "jsonToArray",
"status": "jsonToArray",
Expand All @@ -38,7 +41,21 @@
"opschorting.reden": "unsetIfValue==",
"opschorting": "unsetIfValue==",
"zaakinformatieobjecten": "jsonToArray",
"zaaktype": "jsonToArray"
"identificatie": "unsetIfValue==reference",
"omschrijving": "unsetIfValue==instance.subject",
"toelichting": "unsetIfValue==instance.subject_external",
"registratiedatum": "unsetIfValue==instance.date_of_registration",
"startdatum": "unsetIfValue==instance.date_of_registration",
"einddatum": "unsetIfValue==instance.date_of_completion",
"einddatumGepland": "unsetIfValue==instance.date_target",
"publicatiedatum": "unsetIfValue==instance.date_target",
"communicatiekanaal": "unsetIfValue==instance.channel_of_contact",
"vertrouwelijkheidaanduidng": "unsetIfValue==instance.confidentiality.mapped",
"kenmerken.0.kenmerk": "unsetIfValue==reference",
"resultaattoelichting": "unsetIfValue==",
"bronorganisatie": "unsetIfValue==bronorganisatie",
"verantwoordelijkeOrganisatie": "unsetIfValue==bronorganisatie",
"originId": "unsetIfValue==reference"
},
"passTrough": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"name": "Xxllnc Casetype to ZGW ZaakType",
"version": "0.0.1",
"mapping": {
"originId": "reference",
"_sourceId": "reference",
"identificatie": "instance.legacy.zaaktype_id",
"catalogus": "_catalogus",
"onderwerp": "instance.title",
Expand All @@ -17,11 +19,37 @@
"bronzaaktype.identificatie": "reference",
"bronzaaktype.omschrijving": "instance.title",
"referentieproces.naam": "preview",
"verantwoordelijke": "instance.properties.supervisor"
"verantwoordelijke": "instance.properties.supervisor",
"statustypen": "[{% for phase in instance.phases %}{% if not loop.first %},{% endif %}{% set phase = phase|merge({'casetypeReference': reference}) %}{{ executeMapping(8, phase)|json_encode }}{% endfor %}]",
"informatieobjecttypen": "[{% set index=0 %}{% for phase in instance.phases %}{% for field in phase.fields %}{% if field.type == 'file' %}{% if index != 0 %},{% endif %}{{ executeMapping(9, 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' %}{% if index != 0 %},{% endif %}{{ executeMapping(10, 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 %}{% if index != 0 %},{% endif %}{{ executeMapping(11, role)|json_encode }}{% set index=index+1 %}{% endif %}{% endfor %}]",
"resultaattypen": "[{% if instance.results|default %}{% for result in instance.results %}{% if not loop.first %},{% endif %}{{ executeMapping(12, result)|json_encode }}{% endfor %}{% endif %}]"
},
"unset": [],
"cast": {
"identificatie": "unsetIfValue==instance.legacy.zaaktype_id"
"identificatie": "unsetIfValue==instance.legacy.zaaktype_id",
"statustypen": "jsonToArray",
"informatieobjecttypen": "jsonToArray",
"eigenschappen": "jsonToArray",
"roltypen": "jsonToArray",
"resultaattypen": "jsonToArray",
"catalogus": "unsetIfValue==_catalogus",
"onderwerp": "unsetIfValue==instance.title",
"indicatieInternOfExtern": "unsetIfValue==extern",
"doorlooptijd": "unsetIfValue==",
"servicenorm": "unsetIfValue==",
"verlengingMogelijk": "unsetIfValue==instance.properties.extension",
"publicatieIndicatie": "unsetIfValue==instance.properties.publication",
"omschrijving": "unsetIfValue==instance.title",
"opschortingEnAanhoudingMogelijk": "unsetIfValue==instance.properties.suspension",
"bronzaaktype.url": "unsetIfValue==url",
"bronzaaktype.identificatie": "unsetIfValue==reference",
"bronzaaktype.omschrijving": "unsetIfValue==instance.title",
"bronzaaktype.naam": "unsetIfValue==preview",
"referentieproces.naam": "unsetIfValue==preview",
"verantwoordelijke": "unsetIfValue==instance.properties.supervisor",
"originId": "unsetIfValue==reference"
},
"passTrough": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,20 @@
"cast": {
"informatieobject.versie": "integer",
"informatieobject.bestandsomvang": "integer",
"informatieobject.inhoud": "jsonToArray"
"informatieobject.inhoud": "jsonToArray",
"titel": "unsetIfValue==instance.name",
"registratiedatum": "unsetIfValue==instance.file.instance.date_created",
"informatieobject.identificatie": "unsetIfValue==instance.number",
"informatieobject.creatiedatum": "unsetIfValue==instance.file.instance.date_created",
"informatieobject.titel": "unsetIfValue==instance.name",
"informatieobject.vertrouwelijksheidaanduiding": "unsetIfValue==",
"informatieobject.formaat": "unsetIfValue==instance.file.instance.mimetype",
"informatieobject.beginRegistratie": "unsetIfValue==instance.file.instance.date_modified",
"informatieobject.bestandsnaam": "unsetIfValue==instance.filename",
"informatieobject.verschijningsvorm": "unsetIfValue==",
"informatieobject.integriteit.algoritme": "unsetIfValue==",
"informatieobject.integriteit.waarde": "unsetIfValue==",
"informatieobject.integriteit.datum": "unsetIfValue==instance.file.instance.date_created"
},
"passTrough": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "Xxllnc Field to ZGW Eigenschap",
"version": "0.0.1",
"mapping": {
"naam": "magic_string",
"definitie": "{% if original_label|default %}{{ original_label }}{% elseif label|default %}{{ label }}{% else %}{{ magic_string }}{% endif %}",
"specificatie.formaat": "{% if type == 'date' %}datum{% elseif type == 'datetime' %}datum_tijd{% elseif type=='number' %}getal{% else %}tekst{% endif %}",
"kardinaliteit": "{% if limit_values|default %}{{ limit_values }}{% else %}1{% endif %}",
"catalogus": "_catalogus",
"zaaktypeIdentificatie": "_zaaktypeIdentificatie"
},
"unset": [],
"cast": {
"naam": "unsetIfValue==magic_string",
"definitie": "unsetIfValue==",
"catalogus": "unsetIfValue==_catalogus",
"zaaktypeIdentificatie": "unsetIfValue==_zaaktypeIdentificatie"
},
"passTrough": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "Xxllnc Field to ZGW InformatieObjectType",
"version": "0.0.1",
"mapping": {
"omschrijving": "{% if original_label|default %}{{ original_label }}{% elseif label|default %}{{ label }}{% else %}{{ magic_string }}{% endif %}",
"vertrouwelijkheidsaanduiding": "{% if publish_public|default and publish_public == true %}openbaar{% else %}zaakvertrouwelijk{% endif %}",
"beginGeldigheid": "{{ 'now'|date('Y-m-d') }}",
"informatieobjectcategorie": "xxllnc informatieobject"
},
"unset": [],
"cast": {
"omschrijving": "unsetIfValue=="
},
"passTrough": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "XxllncInformatieObjectTypeToZGWInformatieObjectType",
"version": "0.0.1",
"mapping": {
"omschrijving": "original_label",
"vertrouwelijkheidaanduiding": "public"
},
"unset": [],
"cast": {
"omschrijving": "unsetIfValue==original_label",
"vertrouwelijkheidaanduiding": "unsetIfValue==public"
},
"passTrough": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"unset": [],
"cast": {
"indicatieLaatstGezetteStatus": "bool",
"statustype": "unsetIfValue=="
"statustype": "unsetIfValue==",
"datumStatusGezet": "unsetIfValue==milestone.instance.date_modified",
"statustoelichting": "unsetIfValue==milestone.instance.phase_label"
},
"passTrough": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
},
"unset": [],
"cast": {
"resultaattype": "unsetIfValue=="
"resultaattype": "unsetIfValue==",
"toelichting": "unsetIfValue=="
},
"passTrough": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "Xxllnc Phase to ZGW StatusType",
"version": "0.0.1",
"mapping": {
"_sourceId": "{% if fields.0.label|default and casetypeReference|default %}{{ casetypeReference~fields.0.label }}{% endif %}",
"volgnummer": "seq",
"omschrijving": "name",
"omschrijvingGeneriek": "{% if fields.0.label|default %}{{ fields.0.label }}{% else %}geen statustekst{% endif %}",
"statustekst": "{% if fields.0.help|default %}{{ fields.0.help }}{% else %}geen statustekst{% endif %}",
"catalogus": "_catalogus",
"zaaktypeIdentificatie": "_zaaktypeIdentificatie"
},
"unset": [],
"cast": {
"_sourceId": "unsetIfValue==",
"volgnummer": "unsetIfValue==seq",
"omschrijving": "unsetIfValue==name",
"catalogus": "unsetIfValue==_catalogus",
"zaaktypeIdentificatie": "unsetIfValue==_zaaktypeIdentificatie"
},
"passTrough": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "Xxllnc Result to ZGW ResultaatType",
"version": "0.0.1",
"mapping": {
"omschrijving": "type",
"toelichting": "label",
"selectielijstklasse": "{% if selection_list|default %}https://inavigator.bizzib.nl/bsd/sl2020.gem.html#{{ selection_list_number|replace({'.': '_'}) }}{% else %}http://localhost{% endif %}",
"archiefnominatie": "{% if type_of_archiving == 'Bewaren (B)' or type_of_archiving == 'Conversie' %}blijvend_bewaren{% else %}vernietigen{% endif %}",
"archiefactietermijn": "{% if period_of_preservation|default %}P{{ period_of_preservation }}D{% endif %}"
},
"unset": [],
"cast": {
"omschrijving": "unsetIfValue==type",
"toelichting": "unsetIfValue==label",
"archiefactietermijn": "unsetIfValue=="
},
"passTrough": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "Xxllnc Role to ZGW RolType",
"version": "0.0.1",
"mapping": {
"omschrijving": "{% if instance.description|default %}{{ instance.description }}{% endif %}",
"omschrijvingGeneriek": "{% if instance.name|default %}{{ instance.name|lower }}{% endif %}"
},
"unset": [],
"cast": {
"omschrijving": "unsetIfValue==",
"omschrijvingGeneriek": "unsetIfValue=="
},
"passTrough": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,31 @@
"unset": [],
"cast": {
"roltype": "unsetIfValue==",
"betrokkeneIdentificatie": "unsetIfValue=="
"betrokkeneIdentificatie": "unsetIfValue==",
"omschrijving": "unsetIfValue==",
"omschrijvingGeneriek": "unsetIfValue==",
"roltoelichting": "unsetIfValue==",
"registratiedatum": "unsetIfValue==",
"contactpersoonRol.emailadres": "unsetIfValue==",
"contactpersoonRol.functie": "unsetIfValue==",
"contactpersoonRol.telefoonnummer": "unsetIfValue==",
"contactpersoonRol.naam": "unsetIfValue==",
"betrokkeneIdentificatie._sourceId": "unsetIfValue==",
"betrokkeneIdentificatie.inpBsn": "unsetIfValue==",
"betrokkeneIdentificatie.inpA_nummer": "unsetIfValue==",
"betrokkeneIdentificatie.geslachtsnaam": "unsetIfValue==",
"betrokkeneIdentificatie.voorvoegselGeslachtsnaam": "unsetIfValue==",
"betrokkeneIdentificatie.voorletters": "unsetIfValue==",
"betrokkeneIdentificatie.voornamen": "unsetIfValue==",
"betrokkeneIdentificatie.geslachtsaanduiding": "unsetIfValue==",
"betrokkeneIdentificatie.geboortedatum": "unsetIfValue==",
"betrokkeneIdentificatie.achternaam": "unsetIfValue==",
"betrokkeneIdentificatie.verblijfsadres.wplWoonplaatsNaam": "unsetIfValue==",
"betrokkeneIdentificatie.verblijfsadres.aoaPostcode": "unsetIfValue==",
"betrokkeneIdentificatie.verblijfsadres.aoaHuisnummer": "unsetIfValue==",
"betrokkeneIdentificatie.verblijfsadres.aoaHuisletter": "unsetIfValue==",
"betrokkeneIdentificatie.verblijfsadres.aoaHuisnummertoevoeging": "unsetIfValue==",
"betrokkeneIdentificatie.verblijfsadres": "unsetIfValue=="
},
"passTrough": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
"eigenschap": "{% for eigenschap in eigenschappen %}{% if eigenschap.naam == name %}{{ eigenschap['_self']['id'] }}{% endif %}{% endfor %}"
},
"unset": [],
"cast": [],
"cast": {
"naam": "unsetIfValue==",
"waarde": "unsetIfValue==",
"eigenschap": "unsetIfValue=="
},
"passTrough": false
}
23 changes: 23 additions & 0 deletions configurations/xxllnc-zgw/mappings/zgw-zaak-to-xxllnc-v1-case.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "ZGW Zaak to Xxllnc Case",
"version": "0.0.1",
"mapping": {
"casetype_id": "{% if zaaktype.originId|default %}{{ zaaktype.originId }}{% endif %}",
"source": "behandelaar",
"date_of_registration": "{{ 'now'|date('Y-m-dTH:i:sZ') }}",
"confidentiality": "public",
"requestor.id": "{{ zaakArrayObject.rollen[0].betrokkeneIdentificatie.inpBsn ?? zaakArrayObject.verantwoordelijkeOrganisatie ?? '' }}",
"requestor.type": "{% if zaakArrayObject.rollen[0].betrokkeneIdentificatie.inpBsn|default or zaakArrayObject.verantwoordelijkeOrganisatie|default %}person{% endif %}",
"files": "[{% set index = 0 %}{% for infoObject in thiswontwork %}{% if index > 0 %}, {% endif %}{{ executeMapping(1, infoObject)|json_encode }}{% set index = index + 1 %}{% endfor %}]",
"values": "{ {% set index = 0 %}{% for zaakEigenschap in eigenschappen %}{% if zaakEigenschap.eigenschap.naam|default %}{% if index > 0 %}, {% endif %}\"{{ zaakEigenschap.eigenschap.naam }}\":{% if zaakEigenschap.eigenschap.waarde|default and zaakEigenschap.eigenschap.specificatie.formaat|default and zaakEigenschap.eigenschap.specificatie.formaat == 'checkbox' %}[[\"{{ zaakEigenschap.eigenschap.waarde }}\"]]{% else %}[\"{{ zaakEigenschap.waarde }}\"]{% endif %}{% set index = index + 1 %}{% endif %}{% endfor %} }"
},
"unset": [],
"cast": {
"files": "jsonToArray",
"values": "jsonToArray",
"requestor.id": "unsetIfValue==",
"requestor.type": "unsetIfValue==",
"requestor": "unsetIfValue=="
},
"passTrough": false
}
Loading

0 comments on commit b1ac026

Please sign in to comment.