|
| 1 | +--- |
| 2 | +kind: config |
| 3 | +depends_on: [notification-updated-field-change-condition] |
| 4 | +--- |
| 5 | + |
| 6 | +## Why |
| 7 | + |
| 8 | +Decidesk (meeting/decision governance for councils, boards, NGOs, citizen participation) currently declares no `x-openregister-notifications` on its schemas, so the OpenRegister notification engine (change `notification-schema-rules-and-userconfig-prefs`, archived 2026-05-26) emits nothing for decidesk objects. Per the fleet notification plan, decidesk should notify about: meeting scheduled + reminder; action item assigned / overdue; motion submitted; decision recorded; participation deadlines. |
| 9 | + |
| 10 | +This change adds schema-declared notification rules in the verified dialect to `lib/Settings/decidesk_register.json`. The design is constrained by two realities discovered while verifying recipient fields: |
| 11 | + |
| 12 | +1. **`Participant`, `Motion.proposer`, and `ActionItem.assignee` do not hold Nextcloud user IDs.** `Participant` holds `displayName` + `email` (an email string, not a uid); `Motion.proposer` is a *name* ("Name of proposer"); `ActionItem.assignee` is "Assigned participant" (a participant reference / name, not a resolvable uid). The verified `kind:field` recipient resolves **uids only**, so assignee/proposer-based delivery is unreliable. Per the plan caveat, decidesk routes these to `kind:groups` (governance/secretariat staff) and `kind:object-acl` (whoever has read/manage on the object) instead of `kind:field`. The assignee-direct rule is declared but flagged: it only fires correctly once `assignee` carries a uid (a separate data-model change). |
| 13 | + |
| 14 | +2. **No named lifecycle transition actions are defined** on Meeting/Motion/Decision (the schemas carry a `lifecycle` enum but no transition-action map). The verified `transition` trigger needs a named `action`. So status-change rules (meeting → scheduled, motion → submitted, decision recorded) are expressed today as `created` (notify when the row first appears in the target state) or `scheduled` reminders, and the precise "lifecycle entered X" form is deferred — see Caveats. `depends_on: notification-updated-field-change-condition` is declared because the most-wanted form ("notify when `lifecycle`/`taskStatus` changed to Y") needs the field-change condition on the `updated` trigger from that engine change. |
| 15 | + |
| 16 | +## What Changes |
| 17 | + |
| 18 | +Add `x-openregister-notifications` to these schemas in `lib/Settings/decidesk_register.json`. |
| 19 | + |
| 20 | +### Meeting — scheduled + reminder |
| 21 | + |
| 22 | +```jsonc |
| 23 | +"x-openregister-notifications": { |
| 24 | + "meetingScheduled": { |
| 25 | + "trigger": {"type": "created"}, "enabled": true, |
| 26 | + "channels": ["nc-notification"], |
| 27 | + "recipients": [{"kind": "object-acl", "permission": "read"}, {"kind": "groups", "groups": ["decidesk-members"]}], |
| 28 | + "subject": {"nl": "Nieuwe vergadering ingepland: {{title}}", "en": "New meeting scheduled: {{title}}"} |
| 29 | + }, |
| 30 | + "meetingReminder": { |
| 31 | + "trigger": {"type": "scheduled", "intervalSec": 86400, "filter": {"lifecycle": "scheduled"}}, "enabled": true, |
| 32 | + "channels": ["nc-notification"], |
| 33 | + "recipients": [{"kind": "object-acl", "permission": "read"}], |
| 34 | + "subject": {"nl": "Herinnering: vergadering '{{title}}' komt eraan", "en": "Reminder: meeting '{{title}}' is coming up"} |
| 35 | + } |
| 36 | +} |
| 37 | +``` |
| 38 | + |
| 39 | +Recipients use `object-acl:read` (everyone who can see the meeting) plus a `decidesk-members` group, because `Meeting` has no attendee-uid field. |
| 40 | + |
| 41 | +### ActionItem — assigned + overdue |
| 42 | + |
| 43 | +```jsonc |
| 44 | +"x-openregister-notifications": { |
| 45 | + "actionAssigned": { |
| 46 | + "trigger": {"type": "created"}, "enabled": true, |
| 47 | + "channels": ["nc-notification"], |
| 48 | + "recipients": [{"kind": "object-acl", "permission": "manage"}, {"kind": "groups", "groups": ["decidesk-members"]}], |
| 49 | + "subject": {"nl": "Nieuwe actie toegewezen: {{title}}", "en": "New action item assigned: {{title}}"} |
| 50 | + }, |
| 51 | + "actionOverdue": { |
| 52 | + "trigger": {"type": "scheduled", "intervalSec": 86400, "filter": {"taskStatus": "overdue"}}, "enabled": true, |
| 53 | + "channels": ["nc-notification"], |
| 54 | + "recipients": [{"kind": "object-acl", "permission": "manage"}, {"kind": "groups", "groups": ["decidesk-members"]}], |
| 55 | + "subject": {"nl": "Actie over tijd: {{title}}", "en": "Action item overdue: {{title}}"} |
| 56 | + } |
| 57 | +} |
| 58 | +``` |
| 59 | + |
| 60 | +`assignee` is **not** used as a `kind:field` recipient (it is a participant name, not a uid). Once `assignee` carries a uid, add `{"kind": "field", "field": "assignee"}` — see Caveats. |
| 61 | + |
| 62 | +### Motion — submitted |
| 63 | + |
| 64 | +```jsonc |
| 65 | +"x-openregister-notifications": { |
| 66 | + "motionSubmitted": { |
| 67 | + "trigger": {"type": "created"}, "enabled": true, |
| 68 | + "channels": ["nc-notification"], |
| 69 | + "recipients": [{"kind": "object-acl", "permission": "read"}, {"kind": "groups", "groups": ["decidesk-members"]}], |
| 70 | + "subject": {"nl": "Nieuwe motie ingediend: {{title}}", "en": "New motion submitted: {{title}}"} |
| 71 | + } |
| 72 | +} |
| 73 | +``` |
| 74 | + |
| 75 | +`proposer` is a name, not a uid — not used as a recipient. Motions enter at lifecycle `submitted`, so `created` ≈ "submitted". |
| 76 | + |
| 77 | +### Decision — recorded |
| 78 | + |
| 79 | +```jsonc |
| 80 | +"x-openregister-notifications": { |
| 81 | + "decisionRecorded": { |
| 82 | + "trigger": {"type": "created"}, "enabled": true, |
| 83 | + "channels": ["nc-notification"], |
| 84 | + "recipients": [{"kind": "object-acl", "permission": "read"}, {"kind": "groups", "groups": ["decidesk-members"]}], |
| 85 | + "subject": {"nl": "Besluit vastgelegd: {{title}}", "en": "Decision recorded: {{title}}"} |
| 86 | + } |
| 87 | +} |
| 88 | +``` |
| 89 | + |
| 90 | +### PublicConsultation / BudgetProposal — participation deadlines |
| 91 | + |
| 92 | +```jsonc |
| 93 | +// PublicConsultation |
| 94 | +"x-openregister-notifications": { |
| 95 | + "consultationDeadline": { |
| 96 | + "trigger": {"type": "scheduled", "intervalSec": 86400, "filter": {"status": "open"}}, "enabled": true, |
| 97 | + "channels": ["nc-notification"], |
| 98 | + "recipients": [{"kind": "object-acl", "permission": "read"}, {"kind": "groups", "groups": ["decidesk-members"]}], |
| 99 | + "subject": {"nl": "Inspraaktermijn '{{title}}' verloopt binnenkort", "en": "Consultation '{{title}}' deadline is approaching"} |
| 100 | + } |
| 101 | +} |
| 102 | +``` |
| 103 | + |
| 104 | +`BudgetProposal` follows the same `scheduled`+`filter:{status:"voting"}` shape for its voting-window deadline. The deadline date (`submissionDeadline` / proposal voting window) is the field the engine filters/evaluates against per scheduled run. |
| 105 | + |
| 106 | +## Capabilities |
| 107 | + |
| 108 | +No new product capability. This adds schema-declared notification configuration consumed by the existing OpenRegister notification engine. |
| 109 | + |
| 110 | +## Impact |
| 111 | + |
| 112 | +- **Affected file:** `lib/Settings/decidesk_register.json` only (additive `x-openregister-notifications` blocks). |
| 113 | +- No data migration, no API change, no Vue change. |
| 114 | +- Rules go live only when `notification-schema-rules-and-userconfig-prefs` engine is present. |
| 115 | +- Recipient delivery for assignee/proposer is intentionally routed to groups/object-acl, not the (non-uid) person fields — see Caveats. |
| 116 | + |
| 117 | +## Caveats |
| 118 | + |
| 119 | +- **Participant / proposer / assignee hold emails and display names, not Nextcloud uids.** `kind:field` resolves uids only, so per-person delivery to the assignee/proposer/participant is **not used**. Rules route to `kind:object-acl` (read/manage on the object) and `kind:groups` (`decidesk-members`). To deliver to the actual assignee, a data-model change is required to store a uid on `ActionItem.assignee` (and similarly for proposer); only then add `{"kind":"field","field":"assignee"}`. Flagged from the fleet plan's "participant uid caveat". |
| 120 | +- **No named lifecycle transition actions exist** on Meeting/Motion/Decision schemas. Status-change rules are approximated by `created` (object first appears in target state) and `scheduled` filtered on `lifecycle`/`status`/`taskStatus`. The precise "lifecycle entered X" / "status changed to Y" form is deferred to `notification-updated-field-change-condition` (declared in depends_on) or to adding named transition actions to the schemas. |
| 121 | +- **External-recipient email** (participant emails, citizen submitters) is not deliverable — the engine `field`/`groups`/`object-acl` recipients resolve to internal Nextcloud users only. Citizen-facing participation notifications are out of scope until an external-email channel exists. |
| 122 | +- **`decidesk-members` group** is assumed to exist in the deployment; confirm group provisioning, or swap to the deployment's actual governance/secretariat group name. |
| 123 | +- **`scheduled` deadline rules** assume the engine evaluates the deadline field (`submissionDeadline`, meeting `scheduledDate`) per run; the per-day reminder fires for matching rows each interval rather than once at an exact horizon. |
0 commit comments