Skip to content

refactor(dossiq): read objects through find() with ObjectFindOptions - #5340

Closed
rubenvdlinde wants to merge 4 commits into
developmentfrom
fix/or-surface-find-options
Closed

rubenvdlinde wants to merge 4 commits into
developmentfrom
fix/or-surface-find-options

Conversation

@rubenvdlinde

@rubenvdlinde rubenvdlinde commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Merge after openregister #9116 lands.

ObjectFindOptions is new in OCA\OpenRegister\Kernel\Contracts\Value in #9116, so this has to land with #9116 or after it.

Fixed (lib)

  • 104 calls of ObjectService::find() / findSilent() on $objectService, $this->objectService and $this->getObjectService(), rewritten by the fleet migrate-find script (0 skipped; a second run changes nothing): find(id:, options: new ObjectFindOptions(register:, schema:, extend:, files:, render:, audit:), _rbac:, _multitenancy:). Default values are dropped. _rbac / _multitenancy stay named, with their values unchanged.
  • Six calls on receivers the script does not match, by hand: Starter/StarterStore.php:314, Workflow/WorkflowDefinitionRepository.php:195 and :402, Stuf/StufRegisterAccess.php:115, Transitions/CaseResultWriter.php:303, Bezwaar/BezwaarAuditTrail.php:213.

Tests

  • tests/Stubs/Contract/ObjectServiceInterface.php: find() / findSilent() on #9116's signature. ObjectFindOptions stub copied from #9116's head.
  • 167 object-service doubles that declared the old parameters now take ?ObjectFindOptions $options = null and read register/schema/extend/files from it. This was scripted; the diff is in the second commit.

Tests (by hand)

  • parent::find() in subclassed doubles passes the options through. Tests that call a double directly build an ObjectFindOptions. Mock callbacks, willReturnMap rows and with() expectations on find() read register and schema from the options. Doubles that log with compact() set the locals they log.
  • Five golden logs (case-sharing-service, case-transfer-service, dso-case-service, objection-decision-service, objection-guard-listeners/*) now record the ObjectFindOptions with the same values.
  • The doubled SchemaMapper::find() signatures that the scripted pass caught by their $_extend parameter are back on the mapper's own signature.

Overlap

The audit PR (#5333) and the render PR (#5337) edit nearby lines in BezwaarAuditTrail.php, StoppingRuleMet.php, WooReportReadLog.php and PublicCaseSurvivorController.php. Whichever merges second needs development merged in.

What ran

  • php -l on every changed file: clean.
  • Full PHPUnit --no-coverage: 10,946 tests, 19 failures, the same 19 that fail on development (no new reds).

AI disclosure: prepared with Claude Code (claude-opus-5-5).

openregister #9116 changes ObjectService::find() and findSilent() to take
an ObjectFindOptions in place of the register, schema, extend, files,
render and audit parameters. The calls on the object service move to
find(id:, options: new ObjectFindOptions(...)); _rbac and _multitenancy
stay named arguments, with their values unchanged.

104 calls were rewritten by the fleet migrate-find script, and six on
receivers it does not match by hand.

Assisted-by: ClaudeCode:claude-opus-5-5
The object-service doubles that declared find()/findSilent() with the old
register, schema, extend, files, render and audit parameters now take
`?ObjectFindOptions $options` and read those values from it. Their
recorded calls and answers are unchanged.

Assisted-by: ClaudeCode:claude-opus-5-5
…ions

parent::find() calls in subclassed doubles pass the options through, the
tests that call a double directly build an ObjectFindOptions, and the
mock callbacks, return maps and with() expectations on find() read the
register and schema from the options.

Assisted-by: ClaudeCode:claude-opus-5-5
Doubles that log their arguments with compact() read register and schema
from the options; old-typed find callbacks take the options; five golden
logs record the ObjectFindOptions with the same values. The SchemaMapper
doubles the earlier rewrite caught by their $_extend parameter are back on
the mapper's own signature.

Assisted-by: ClaudeCode:claude-opus-5-5
@rubenvdlinde
rubenvdlinde marked this pull request as ready for review November 10, 2026 12:00
This was referenced Nov 11, 2026
@rubenvdlinde

Copy link
Copy Markdown
Contributor Author

Superseded by #6581 (merged into development), which moves every find/saveObject/deleteObject/patchObject/lock call and flow node in this app to openregister main's option objects in one pass, test doubles included.

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