Skip to content

feat(inspection-checklists): apply spec#393

Merged
rubenvdlinde merged 1 commit into
developmentfrom
feat/apply-inspection-checklists
May 11, 2026
Merged

feat(inspection-checklists): apply spec#393
rubenvdlinde merged 1 commit into
developmentfrom
feat/apply-inspection-checklists

Conversation

@rubenvdlinde
Copy link
Copy Markdown
Contributor

Summary

Applies the inspection-checklists OpenSpec change in manifest-first style — no bespoke CRUD controller, OpenRegister auto-renders the index + detail pages from the two new schemas.

  • Two new schemas in lib/Settings/procest_register.json:
    • inspectionChecklistTemplate (REQ-IC-1): long-lived config — name, caseType, version, status (draft|active|retired), sections[] with nested items[] (response-type enum ja_nee_nvt|tekst|getal|meerkeuze|foto|meting, fotoRequired nooit|bij_nee|altijd, numericRange, choices[], failureAction with type enum herinspectie|handhavingstaak|documentVerzoek|geen), seedKey.
    • inspectionChecklistRun (REQ-IC-2): per-inspection instance — case, inspection, template, templateVersion, templateSnapshot (frozen), inspector (server-derived from IUserSession), responses[], photos[], overallResult, syncState, followUpType.
  • Schema config-key bridge added to SettingsService::DEFAULT_SCHEMA_CONFIG_KEYS.
  • lib/Service/Inspection/ChecklistService.phpcreateRun() freezes the snapshot and derives the inspector from IUserSession; submitRun() validates per item (REQ-IC-3), derives overallResult (REQ-IC-6), dispatches follow-ups (REQ-IC-7) including a handhavingsactie hand-off for handhavingstaak, and enforces append-only with "Checklist run is append-only".
  • lib/Listener/ChecklistRunImmutabilityListener.php — rejects any ObjectUpdatedEvent on a run already in ingediend / gearchiveerd (REQ-IC-8).
  • Listener registered on ObjectUpdatedEvent in Application.php.
  • builds/build.json updated.
  • Mobile UI lives in sister spec mobiel-inspectie (already applied) — not duplicated.

Test plan

  • Repair step runs and schemas are visible at /api/objects/procest/inspectionChecklistTemplate and /api/objects/procest/inspectionChecklistRun
  • Create a template; submit a run with one nee response on a failureAction.type = herinspectie item → a herinspectie task is created on the case
  • After a run reaches ingediend, an ObjectUpdatedEvent mutating responses is rejected with Checklist run is append-only
  • Body-supplied inspector UID is ignored — persisted run carries the authenticated UID

Watchdog ran php -l + jq only (i18n + composer check out of strict scope).

Apply the inspection-checklists OpenSpec change in manifest-first style:

- Add two OpenRegister schemas in lib/Settings/procest_register.json:
  - inspectionChecklistTemplate (REQ-IC-1): name, caseType, version, status
    (draft|active|retired), sections[] with nested items[], failureAction
    enums, seedKey
  - inspectionChecklistRun (REQ-IC-2): case, inspection, template,
    templateVersion, templateSnapshot, inspector (server-derived),
    responses[], photos[], overallResult, syncState, followUpType
- Wire schema slugs into SettingsService::DEFAULT_SCHEMA_CONFIG_KEYS so the
  manifest renderer can route auto-generated index + detail pages
- Add lib/Service/Inspection/ChecklistService.php — createRun snapshot
  freeze + IUserSession-derived inspector, submitRun with REQ-IC-3
  validation, REQ-IC-6 aggregateResult, REQ-IC-7 follow-up dispatch
  (herinspectie / handhavingstaak via handhavingsactie / documentVerzoek)
  and REQ-IC-8 append-only assertion
- Add lib/Listener/ChecklistRunImmutabilityListener.php — rejects
  ObjectUpdatedEvent on submitted runs with "Checklist run is append-only"
- Register the new listener on ObjectUpdatedEvent in Application.php
- Record the change in builds/build.json
@rubenvdlinde rubenvdlinde force-pushed the feat/apply-inspection-checklists branch from 10eeb20 to c9b465f Compare May 11, 2026 12:10
@rubenvdlinde rubenvdlinde merged commit ce8039b into development May 11, 2026
12 of 15 checks passed
@rubenvdlinde rubenvdlinde deleted the feat/apply-inspection-checklists branch May 11, 2026 12:10
@github-actions
Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/procest @ 4b1ed69

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 100/100
npm ✅ 419/419
PHPUnit ⏭️
Newman ⏭️
Playwright

Spec coverage: 3% (21 tests / 673 specs)


Quality workflow — 2026-05-11 12:14 UTC

Download the full PDF report from the workflow artifacts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant