feat(inspection-checklists): apply spec#393
Merged
Merged
Conversation
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
10eeb20 to
c9b465f
Compare
Contributor
Quality Report — ConductionNL/procest @
|
| 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Applies the
inspection-checklistsOpenSpec change in manifest-first style — no bespoke CRUD controller, OpenRegister auto-renders the index + detail pages from the two new schemas.lib/Settings/procest_register.json:inspectionChecklistTemplate(REQ-IC-1): long-lived config —name,caseType,version,status(draft|active|retired),sections[]with nesteditems[](response-type enumja_nee_nvt|tekst|getal|meerkeuze|foto|meting,fotoRequirednooit|bij_nee|altijd,numericRange,choices[],failureActionwith type enumherinspectie|handhavingstaak|documentVerzoek|geen),seedKey.inspectionChecklistRun(REQ-IC-2): per-inspection instance —case,inspection,template,templateVersion,templateSnapshot(frozen),inspector(server-derived fromIUserSession),responses[],photos[],overallResult,syncState,followUpType.SettingsService::DEFAULT_SCHEMA_CONFIG_KEYS.lib/Service/Inspection/ChecklistService.php—createRun()freezes the snapshot and derives the inspector fromIUserSession;submitRun()validates per item (REQ-IC-3), derivesoverallResult(REQ-IC-6), dispatches follow-ups (REQ-IC-7) including a handhavingsactie hand-off forhandhavingstaak, and enforces append-only with"Checklist run is append-only".lib/Listener/ChecklistRunImmutabilityListener.php— rejects anyObjectUpdatedEventon a run already iningediend/gearchiveerd(REQ-IC-8).ObjectUpdatedEventinApplication.php.builds/build.jsonupdated.mobiel-inspectie(already applied) — not duplicated.Test plan
/api/objects/procest/inspectionChecklistTemplateand/api/objects/procest/inspectionChecklistRunneeresponse on afailureAction.type = herinspectieitem → a herinspectie task is created on the caseingediend, anObjectUpdatedEventmutatingresponsesis rejected withChecklist run is append-onlyinspectorUID is ignored — persisted run carries the authenticated UIDWatchdog ran
php -l+jqonly (i18n + composer check out of strict scope).