diff --git a/CHANGELOG.md b/CHANGELOG.md index a24611b..aa8619b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,10 +6,11 @@ - Frontend [v1.38.0] - Added Juridische vorm [OP-3816] [OP-3820] - Frontend [v1.39.0] +- "In Oprichting" bestuursorgaan lifecycle [OP-3810] ### Deploy notes ``` -drc up -d link-adressenregister-uri frontend +drc up -d link-adressenregister-uri frontend construct-organization-relationships dispatcher drc restart resource migrations ``` 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..2518fa7 --- /dev/null +++ b/config/migrations/2026/20260630100000-cleanup-in-oprichting-worship-services.sparql @@ -0,0 +1,85 @@ +PREFIX mandaat: +PREFIX ere: +PREFIX besluit: +PREFIX generiek: +PREFIX regorg: +PREFIX org: + +DELETE { + GRAPH { + ?otherOrgaanInTime ?p ?o . + ?s ?p2 ?otherOrgaanInTime . + } +} +WHERE { + GRAPH { + ?worshipService a ere:BestuurVanDeEredienst ; + regorg:orgStatus . + + ?bestuursorgaan besluit:bestuurt ?worshipService . + + ?otherOrgaanInTime generiek:isTijdspecialisatieVan ?bestuursorgaan . + + { + SELECT ?bestuursorgaan (SAMPLE(?orgaanInTime) AS ?keptOrgaanInTime) { + GRAPH { + ?orgaanInTime generiek:isTijdspecialisatieVan ?bestuursorgaan . + } + } + GROUP BY ?bestuursorgaan + } + + FILTER(?otherOrgaanInTime != ?keptOrgaanInTime) + + { ?otherOrgaanInTime ?p ?o . } + UNION + { ?s ?p2 ?otherOrgaanInTime . } + } +}; + +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 . + } +};