Skip to content

refactor(disposition): share the decision write between approving and rejecting a disposition - #5876

Merged
rubenvdlinde merged 2 commits into
developmentfrom
quality/h16-disposition-decisions
Nov 12, 2026
Merged

rubenvdlinde merged 2 commits into
developmentfrom
quality/h16-disposition-decisions

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

What changed

DispositionService::approveDisposition() and rejectDisposition() repeated the same write: refuse without OpenRegister, patch approvalStatus (approved / rejected) and goedkeurder (the deciding user) onto the stored disposition in the configured schema, log the decision, and answer the stored disposition, or the written fields with the id when the store answers no row.

Both now call one private decide(), with the register reading and the patch in a private patchDisposition() so each unit stays small. Public signatures, the patched fields, the log line (Disposition <id> approved|rejected by <user>), the exception and the answers are unchanged; the settings reads still happen before the patch. createDisposition() (changed by #5353) is not touched.

Characterisation tests

tests/Unit/Service/DispositionDecisionGoldenTest.php, committed first and green on the old code: for both decisions, the refusal without OpenRegister (nothing read, nothing logged), the exact patch (id, fields, register, schema) with the exact log line and the stored disposition answered, and the fallback answer when the store answers no row. 6 cases.

What ran

  • phpunit -c phpunit-unit.xml on the new test, DispositionServiceTest, the two complaint controller test classes, CreatesIgnoreCallerIdentityTest and tests/Unit/Architecture: 149 tests, all green but one inherited failure.
  • phpcs and phpstan analyse on the touched file: no findings.

Inherited: ServiceCatchReturnsNullTest::testEveryAllowlistEntryNamesALiveSite is red on development too (a stale allowlist entry for lib/Service/Settings/OpenRegisterBridge.php), untouched here.

Duplication figures

  • inside DispositionService: 18 -> 2 matching window pairs.

AI-assisted: prepared with Claude Code (claude-opus-5-5); reviewed by a maintainer before merge.


Generated by Claude Code

…n before sharing the write

Assisted-by: ClaudeCode:claude-opus-5-5
… rejecting a disposition

approveDisposition() and rejectDisposition() repeated the same write: the
approval status and the deciding user patched onto the stored disposition,
the decision logged, the stored disposition answered. That write is now
one private decide(), with the register reading in patchDisposition().

Assisted-by: ClaudeCode:claude-opus-5-5
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.

2 participants