diff --git a/CHANGELOG.md b/CHANGELOG.md index 0666206..0ac3562 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,12 +4,14 @@ - Site type changes [OP-3818] - Added Juridische vorm [OP-3816] [OP-3820] - Frontend [v1.39.0] +- bump construct-organization-relationships [OP-3810] +- "In Oprichting" bestuursorgaan lifecycle [OP-3810] - Added "werkingsgebied" filter [OP-3812] ### Deploy notes ``` -drc up -d link-adressenregister-uri frontend -drc restart resource migrations +drc up -d link-adressenregister-uri frontend construct-organization-relationships +drc restart resource migrations dispatcher ``` ``` diff --git a/config/dispatcher/dispatcher.ex b/config/dispatcher/dispatcher.ex index 7fc74a4..b92cbef 100644 --- a/config/dispatcher/dispatcher.ex +++ b/config/dispatcher/dispatcher.ex @@ -386,7 +386,7 @@ defmodule Dispatcher do layer: :api_services, accept: %{json: true} } do - forward(conn, path, "http://construct-organization-relationships/create-relationships/") + forward(conn, path, "http://construct-organization-relationships/") end post "/kbo-data-sync/*path", %{layer: :api_services, accept: %{json: true}} do diff --git a/config/migrations/2026/20260630100000-cleanup-in-oprichting-worship-services.sparql b/config/migrations/2026/20260630100000-cleanup-in-oprichting-worship-services.sparql new file mode 100644 index 0000000..70ba656 --- /dev/null +++ b/config/migrations/2026/20260630100000-cleanup-in-oprichting-worship-services.sparql @@ -0,0 +1,95 @@ +PREFIX mandaat: +PREFIX ere: +PREFIX besluit: +PREFIX generiek: +PREFIX regorg: +PREFIX org: + +DELETE { + GRAPH { + ?otherOrgaanInTime ?p ?o . + ?s ?p2 ?otherOrgaanInTime . + ?mandate ?mp ?mo . + ?ms ?mp2 ?mandate . + } +} +WHERE { + GRAPH { + ?worshipService a ere:BestuurVanDeEredienst ; + regorg:orgStatus . + + ?bestuursorgaan besluit:bestuurt ?worshipService . + + { + SELECT ?bestuursorgaan (MAX(?start) AS ?keptStart) { + GRAPH { + ?orgaanInTime generiek:isTijdspecialisatieVan ?bestuursorgaan ; + mandaat:bindingStart ?start . + FILTER(?start <= NOW()) + } + } + GROUP BY ?bestuursorgaan + } + + ?keptOrgaanInTime generiek:isTijdspecialisatieVan ?bestuursorgaan ; + mandaat:bindingStart ?keptStart . + + ?otherOrgaanInTime generiek:isTijdspecialisatieVan ?bestuursorgaan . + FILTER(?otherOrgaanInTime != ?keptOrgaanInTime) + + { ?otherOrgaanInTime ?p ?o . } + UNION + { ?s ?p2 ?otherOrgaanInTime . } + UNION + { ?otherOrgaanInTime org:hasPost ?mandate . ?mandate ?mp ?mo . } + UNION + { ?otherOrgaanInTime org:hasPost ?mandate . ?ms ?mp2 ?mandate . } + } +}; + +DELETE { + GRAPH { + ?mandate ?p ?o . + ?s ?p2 ?mandate . + } +} +WHERE { + GRAPH { + ?worshipService a ere:BestuurVanDeEredienst ; + regorg:orgStatus . + + ?bestuursorgaan besluit:bestuurt ?worshipService . + ?orgaanInTime generiek:isTijdspecialisatieVan ?bestuursorgaan . + + ?orgaanInTime org:hasPost ?mandate . + ?mandate a mandaat:Mandaat ; + org:role ?role . + + FILTER(?role NOT IN ( + , + , + + )) + + { ?mandate ?p ?o . } + UNION + { ?s ?p2 ?mandate . } + } +}; + +DELETE { + GRAPH { + ?orgaanInTime mandaat:bindingEinde ?endDate . + } +} +WHERE { + GRAPH { + ?worshipService a ere:BestuurVanDeEredienst ; + regorg:orgStatus . + + ?bestuursorgaan besluit:bestuurt ?worshipService . + ?orgaanInTime generiek:isTijdspecialisatieVan ?bestuursorgaan . + + ?orgaanInTime mandaat:bindingEinde ?endDate . + } +}; diff --git a/docker-compose.yml b/docker-compose.yml index 0734372..adadd38 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -215,7 +215,7 @@ services: restart: always logging: *default-logging frontend: - image: lblod/frontend-organization-portal:1.39.1 + image: lblod/frontend-organization-portal:1.40.1 volumes: - ./config/frontend/add-x-frame-options-header.conf:/config/add-x-frame-options.conf environment: @@ -308,7 +308,7 @@ services: restart: always logging: *default-logging construct-organization-relationships: - image: lblod/construct-organization-relationships-service:1.1.1 + image: lblod/construct-organization-relationships-service:1.1.3 links: - db:database labels: