Repository navigation
refactor(cases): share the register context between CaseSplitStore and TakeoverStore - #5856
Merged
Merged
Conversation
…tore before sharing it Assisted-by: ClaudeCode:claude-opus-5-5
…d TakeoverStore Both stores read the object service, the dossier register and a configured schema with the same checks and sentences that Custody\DossierRegister already holds. They now build one DossierRegister from the settings they were given and delegate context() and schema() to it; callers, return values and exception messages are unchanged. Assisted-by: ClaudeCode:claude-opus-5-5
rubenvdlinde
requested review from
WilcoLouwerse,
bbrands02 and
rjzondervan
as code owners
November 11, 2026 14:37
This was referenced Nov 11, 2026
Merged
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.
What changed
CaseSplitStoreandTakeoverStoreeach carried their own copy of the register reading: the object service (refused with "OpenRegister is not available"), the configured register ("Dossier register not configured") and a configured schema ("Dossiq schema not configured").Custody\DossierRegisteralready holds exactly that reading for the incident log and the custody chain.Both stores now build one
DossierRegisterfrom theSettingsServicethey are given and delegatecontext()andschema()to it. Public methods, constructor signatures (positional and named), DI wiring, return values, exception classes and messages, and the order of the settings reads are unchanged. The methods of these files changed by open PRs (CaseSplitStore::discardCasein #5349,TakeoverStore::writeCasein #5353) are not touched; they keep callingcontext()/schema().Characterisation tests
tests/Unit/Service/Cases/StoreRegisterContextTest.php, committed first and green on the old code: for both stores, the context pair, the refusal without OpenRegister (and that the register is then not read), the refusal without a register, a configured schema and the refusal of an unset schema key.What ran
phpunit -c phpunit-unit.xmlon the new test,tests/Unit/Service/Cases, the three takeover test classes andtests/Unit/Architecture: 231 tests, all green but one inherited failure.phpcsandphpstan analyseon the touched files: no errors (the four@specwarnings on existing public methods were there before).Inherited:
ServiceCatchReturnsNullTest::testEveryAllowlistEntryNamesALiveSiteis red on development too (a stale allowlist entry forlib/Service/Settings/OpenRegisterBridge.php), untouched here.Duplication figures
CaseSplitStore<->TakeoverStore: 19 duplicated 6-line windows before, 7 after. What remains is the publicuuidOf()/context()/schema()delegate trio and the refusal shape ofrequireCase(), whose rule constants and sentences differ per store.AI-assisted: prepared with Claude Code (claude-opus-5-5); reviewed by a maintainer before merge.
Generated by Claude Code