Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions l10n/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ OC.L10N.register(
"dossiq",
{
"Contacts": "Contacts",
"Generic Role": "Generic Role",
"The generic role this case-type role plays, so routing rules and reports can speak about \"the handler\" without knowing every case type's own naming. Maps to the ZGW RolType field omschrijvingGeneriek. Set from the Roles tab in case-type settings, and shipped by the bezwaar and besluitvorming seed data.": "The generic role this case-type role plays, so routing rules and reports can speak about \"the handler\" without knowing every case type's own naming. Maps to the ZGW RolType field omschrijvingGeneriek. Set from the Roles tab in case-type settings, and shipped by the bezwaar and besluitvorming seed data.",
"— choose —": "— choose —",
"'Valid from' date must be set": "'Valid from' date must be set",
"'Valid until' must be after 'Valid from'": "'Valid until' must be after 'Valid from'",
Expand Down
2 changes: 2 additions & 0 deletions l10n/en.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"translations": {
"Contacts": "Contacts",
"Generic Role": "Generic Role",
"The generic role this case-type role plays, so routing rules and reports can speak about \"the handler\" without knowing every case type's own naming. Maps to the ZGW RolType field omschrijvingGeneriek. Set from the Roles tab in case-type settings, and shipped by the bezwaar and besluitvorming seed data.": "The generic role this case-type role plays, so routing rules and reports can speak about \"the handler\" without knowing every case type's own naming. Maps to the ZGW RolType field omschrijvingGeneriek. Set from the Roles tab in case-type settings, and shipped by the bezwaar and besluitvorming seed data.",
"— choose —": "— choose —",
"'Valid from' date must be set": "'Valid from' date must be set",
"'Valid until' must be after 'Valid from'": "'Valid until' must be after 'Valid from'",
Expand Down
2 changes: 2 additions & 0 deletions l10n/nl.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ OC.L10N.register(
"dossiq",
{
"Contacts": "Contacten",
"Generic Role": "Generieke rol",
"The generic role this case-type role plays, so routing rules and reports can speak about \"the handler\" without knowing every case type's own naming. Maps to the ZGW RolType field omschrijvingGeneriek. Set from the Roles tab in case-type settings, and shipped by the bezwaar and besluitvorming seed data.": "De generieke rol die deze zaaktyperol speelt, zodat routeringsregels en rapportages over \"de behandelaar\" kunnen spreken zonder de eigen benaming van elk zaaktype te kennen. Komt overeen met het ZGW-veld omschrijvingGeneriek op RolType. Wordt gezet op het tabblad Rollen in de zaaktype-instellingen, en meegeleverd door de bezwaar- en besluitvormingsseeds.",
"— choose —": "— kies —",
"'Valid from' date must be set": "Datum 'Geldig vanaf' moet worden ingevuld",
"'Valid until' must be after 'Valid from'": "'Geldig tot' moet na 'Geldig vanaf' liggen",
Expand Down
2 changes: 2 additions & 0 deletions l10n/nl.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"translations": {
"Contacts": "Contacten",
"Generic Role": "Generieke rol",
"The generic role this case-type role plays, so routing rules and reports can speak about \"the handler\" without knowing every case type's own naming. Maps to the ZGW RolType field omschrijvingGeneriek. Set from the Roles tab in case-type settings, and shipped by the bezwaar and besluitvorming seed data.": "De generieke rol die deze zaaktyperol speelt, zodat routeringsregels en rapportages over \"de behandelaar\" kunnen spreken zonder de eigen benaming van elk zaaktype te kennen. Komt overeen met het ZGW-veld omschrijvingGeneriek op RolType. Wordt gezet op het tabblad Rollen in de zaaktype-instellingen, en meegeleverd door de bezwaar- en besluitvormingsseeds.",
"— choose —": "— kies —",
"'Valid from' date must be set": "Datum 'Geldig vanaf' moet worden ingevuld",
"'Valid until' must be after 'Valid from'": "'Geldig tot' moet na 'Geldig vanaf' liggen",
Expand Down
87 changes: 86 additions & 1 deletion lib/Repair/VthSeedDataRepairStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ public function __construct(
* Get the repair-step display name.
*
* @return string
*
* @spec openspec/changes/vth-workflow-configuration-01-config-foundation/tasks.md
*/
public function getName(): string {
return 'Seed VTH case types and inspection-checklist templates for Dossiq';
Expand Down Expand Up @@ -291,6 +293,11 @@ private function seedInspectionChecklists(
schema: $schema
);

$caseTypeIds = $this->caseTypeIdsBySlug(
objectService: $objectService,
register: $register
);

$seeded = 0;
$skipped = 0;
foreach ($checklists as $checklist) {
Expand All @@ -312,7 +319,7 @@ private function seedInspectionChecklists(
$objectService->saveObject(
register: $register,
schema: $schema,
object: $checklist
object: $this->bindCaseType(checklist: $checklist, caseTypeIds: $caseTypeIds)
);
$seeded++;
} catch (Throwable $e) {
Expand Down Expand Up @@ -346,6 +353,84 @@ private function stripChildren(array $caseType): array {
return $caseType;
}//end stripChildren()

/**
* Bind a checklist template to its case type, by slug.
*
* The seed names its case type by slug because that is the only stable
* identifier a shipped file can carry: the uuid is minted at install. The
* schema declares `caseType` (a uuid `$ref`) and declares no `caseTypeSlug`,
* so shipping the slug straight through wrote a key OpenRegister answers 200
* to and stores nowhere, and every checklist installed unbound.
*
* An unresolvable slug drops the binding rather than the template: a
* checklist with no case type is still usable, `caseType` is optional
* ("null means any case type"), and a `caseTypeSlug` left in the payload
* would only be discarded again.
*
* @param array<string, mixed> $checklist The shipped checklist payload.
* @param array<string, string> $caseTypeIds Case-type uuid keyed by slug.
*
* @return array<string, mixed> The payload as OpenRegister should receive it.
*/
private function bindCaseType(array $checklist, array $caseTypeIds): array {
$slug = (string)($checklist['caseTypeSlug'] ?? '');
unset($checklist['caseTypeSlug']);

$caseTypeId = (string)($caseTypeIds[$slug] ?? '');
if ($slug !== '' && $caseTypeId === '') {
$this->logger->warning(
'Dossiq VTH checklist seed could not resolve its case type',
['checklist' => ($checklist['slug'] ?? ''), 'caseTypeSlug' => $slug]
);
return $checklist;
}

if ($caseTypeId !== '') {
$checklist['caseType'] = $caseTypeId;
}

return $checklist;
}//end bindCaseType()

/**
* Map every seeded case type's slug to its OpenRegister uuid.
*
* The slug lives in `@self`, the same place `existingSlugs()` reads it from.
*
* @param object $objectService OpenRegister ObjectService.
* @param string $register Register slug.
*
* @return array<string, string> Case-type uuid keyed by slug.
*/
private function caseTypeIdsBySlug(object $objectService, string $register): array {
$schema = (string)$this->settingsService->getConfigValue('case_type_schema');
if ($schema === '') {
return [];
}

try {
$rows = $this->searchObjectsAsArrays(
objectService: $objectService,
register: $register,
schema: $schema
);
} catch (Throwable) {
return [];
}

$ids = [];
foreach ($rows as $row) {
$self = ($row['@self'] ?? []);
$slug = (string)($self['slug'] ?? $row['slug'] ?? '');
$id = (string)($self['id'] ?? $row['id'] ?? '');
if ($slug !== '' && $id !== '') {
$ids[$slug] = $id;
}
}

return $ids;
}//end caseTypeIdsBySlug()

/**
* Read existing slugs for idempotency.
*
Expand Down
2 changes: 1 addition & 1 deletion lib/Settings/case_flow_seed_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"processingDeadline": "P56D",
"suspensionAllowed": true,
"extensionAllowed": true,
"extensionDuration": "P42D",
"extensionPeriod": "P42D",
"confidentiality": "openbaar",
"origin": "aanvragen",
"statusTypes": [
Expand Down
19 changes: 17 additions & 2 deletions lib/Settings/dossiq_register.json
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@
"roleType": {
"slug": "roleType",
"icon": "BadgeAccountOutline",
"version": "1.0.0",
"version": "1.1.0",
"x-schema-org": "schema:Role",
"x-zgw-equivalent": "RolType",
"title": "Role Type",
Expand Down Expand Up @@ -389,6 +389,21 @@
"description": "Reference to the parent case type",
"title": "Case Type"
},
"genericRole": {
"type": "string",
"enum": [
"initiator",
"co_initiator",
"handler",
"advisor",
"decision_maker",
"coordinator",
"stakeholder",
"contact"
],
"description": "The generic role this case-type role plays, so routing rules and reports can speak about \"the handler\" without knowing every case type's own naming. Maps to the ZGW RolType field omschrijvingGeneriek. Set from the Roles tab in case-type settings, and shipped by the bezwaar and besluitvorming seed data.",
"title": "Generic Role"
},
"ncGroupId": {
"type": "string",
"nullable": true,
Expand Down Expand Up @@ -692,7 +707,7 @@
}
},
"icon": "FolderAccountOutline",
"version": "1.12.0",
"version": "1.13.0",
"x-schema-org": "schema:Project",
"x-zgw-equivalent": "Zaak",
"x-openregister-archival": {
Expand Down
1 change: 0 additions & 1 deletion lib/Settings/templates/bvw-mandaatbesluit.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"internalOrExternal": "intern",
"isDraft": false,
"confidentiality": "intern",
"mandateGuard": true,
"statusTypes": [
{ "name": "Voorstel opstellen", "order": 1, "isFinal": false, "description": "Steller stelt het DT-advies op" },
{ "name": "Ambtelijk advies", "order": 2, "isFinal": false, "description": "Inhoudelijk advies" },
Expand Down
35 changes: 26 additions & 9 deletions lib/Settings/templates/vth-handhavingszaak.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,32 @@
"title": "VTH Handhavingszaak",
"version": "1.0.0",
"description": "Template voor handhavingszaken (VTH module)",
"statusTypes": ["Constatering", "Vooraankondiging", "Zienswijze", "Handhavingsbesluit", "Begunstigingstermijn", "Hercontrole", "Afgehandeld"],
"documentTypes": ["Constateringsrapport", "Vooraankondigingsbrief", "Handhavingsbesluit", "Dwangsombeschikking"],
"statusTypes": [
{"name": "Constatering", "order": 1, "isFinal": false},
{"name": "Vooraankondiging", "order": 2, "isFinal": false},
{"name": "Zienswijze", "order": 3, "isFinal": false},
{"name": "Handhavingsbesluit", "order": 4, "isFinal": false},
{"name": "Begunstigingstermijn", "order": 5, "isFinal": false},
{"name": "Hercontrole", "order": 6, "isFinal": false},
{"name": "Afgehandeld", "order": 7, "isFinal": true}
],
"documentTypes": [
{"name": "Constateringsrapport"},
{"name": "Vooraankondigingsbrief"},
{"name": "Handhavingsbesluit"},
{"name": "Dwangsombeschikking"}
],
"propertyDefinitions": [
{"name": "overtredingstype", "type": "string"},
{"name": "ernst", "type": "string", "enum": ["gering", "aanzienlijk", "ernstig"]},
{"name": "gedrag", "type": "string", "enum": ["goedwillend", "onverschillig", "calculerend", "crimineel"]},
{"name": "intervention", "type": "string"},
{"name": "dwangsombedrag", "type": "number"},
{"name": "compliancePeriod", "type": "integer"}
{"name": "overtredingstype", "propertyType": "string"},
{"name": "ernst", "propertyType": "enum", "enumValues": ["gering", "aanzienlijk", "ernstig"]},
{"name": "gedrag", "propertyType": "enum", "enumValues": ["goedwillend", "onverschillig", "calculerend", "crimineel"]},
{"name": "intervention", "propertyType": "string"},
{"name": "dwangsombedrag", "propertyType": "number"},
{"name": "compliancePeriod", "propertyType": "number"}
],
"roleTypes": ["handler", "overtreder", "toezichthouder"]
"roleTypes": [
{"name": "handler"},
{"name": "overtreder"},
{"name": "toezichthouder"}
]
}
36 changes: 27 additions & 9 deletions lib/Settings/templates/vth-omgevingsvergunning.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,34 @@
"title": "VTH Omgevingsvergunning",
"version": "1.0.0",
"description": "Template voor omgevingsvergunning aanvragen (VTH module)",
"statusTypes": ["Ontvangen", "Ontvankelijkheidstoets", "In behandeling", "Advies", "Besluitvorming", "Afgehandeld"],
"documentTypes": ["Bouwtekening", "Constructieberekening", "Situatietekening", "Welstandsadvies", "Fotos bestaande situatie"],
"statusTypes": [
{"name": "Ontvangen", "order": 1, "isFinal": false},
{"name": "Ontvankelijkheidstoets", "order": 2, "isFinal": false},
{"name": "In behandeling", "order": 3, "isFinal": false},
{"name": "Advies", "order": 4, "isFinal": false},
{"name": "Besluitvorming", "order": 5, "isFinal": false},
{"name": "Afgehandeld", "order": 6, "isFinal": true}
],
"documentTypes": [
{"name": "Bouwtekening"},
{"name": "Constructieberekening"},
{"name": "Situatietekening"},
{"name": "Welstandsadvies"},
{"name": "Fotos bestaande situatie"}
],
"propertyDefinitions": [
{"name": "bouwkosten", "type": "number"},
{"name": "oppervlakte", "type": "number"},
{"name": "aantalBouwlagen", "type": "integer"},
{"name": "bagObject", "type": "string"},
{"name": "procedureType", "type": "string", "enum": ["regulier", "uitgebreid"]},
{"name": "activiteiten", "type": "string"}
{"name": "bouwkosten", "propertyType": "number"},
{"name": "oppervlakte", "propertyType": "number"},
{"name": "aantalBouwlagen", "propertyType": "number"},
{"name": "bagObject", "propertyType": "string"},
{"name": "procedureType", "propertyType": "enum", "enumValues": ["regulier", "uitgebreid"]},
{"name": "activiteiten", "propertyType": "string"}
],
"roleTypes": [
{"name": "handler"},
{"name": "applicant"},
{"name": "gemachtigde"},
{"name": "adviseur"}
],
"roleTypes": ["handler", "applicant", "gemachtigde", "adviseur"],
"processingDeadline": {"regulier": "P56D", "uitgebreid": "P182D"}
}
18 changes: 14 additions & 4 deletions lib/Settings/templates/vth-toezichtzaak.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,25 @@
"title": "VTH Toezichtzaak",
"version": "1.0.0",
"description": "Template voor toezichtzaken inclusief inspectiefasen (VTH module)",
"statusTypes": ["Gepland", "In uitvoering", "Rapport", "Opvolging", "Afgehandeld"],
"statusTypes": [
{"name": "Gepland", "order": 1, "isFinal": false},
{"name": "In uitvoering", "order": 2, "isFinal": false},
{"name": "Rapport", "order": 3, "isFinal": false},
{"name": "Opvolging", "order": 4, "isFinal": false},
{"name": "Afgehandeld", "order": 5, "isFinal": true}
],
"inspectionPhases": [
{"name": "Fase 1 - Fundering", "order": 1},
{"name": "Fase 2 - Ruwbouw", "order": 2},
{"name": "Fase 3 - Oplevering", "order": 3}
],
"roleTypes": ["inspecteur", "contactpersoon", "opdrachtgever"],
"roleTypes": [
{"name": "inspecteur"},
{"name": "contactpersoon"},
{"name": "opdrachtgever"}
],
"propertyDefinitions": [
{"name": "inspectionPhase", "type": "string"},
{"name": "location", "type": "string"}
{"name": "inspectionPhase", "propertyType": "string"},
{"name": "location", "propertyType": "string"}
]
}
Loading
Loading