diff --git a/lib/Controller/AccruingAmountController.php b/lib/Controller/AccruingAmountController.php index a348e8912c..c83da5a709 100644 --- a/lib/Controller/AccruingAmountController.php +++ b/lib/Controller/AccruingAmountController.php @@ -34,6 +34,7 @@ use OCA\Dossiq\Service\Money\AmountObjectionService; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Support\OwningCaseResolver; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Controller; use OCP\AppFramework\Http; use OCP\AppFramework\Http\JSONResponse; @@ -174,7 +175,7 @@ public function show(string $id): JSONResponse { } try { - $row = $objectService->find($id, register: $register, schema: $schema); + $row = $objectService->find($id, options: new ObjectFindOptions(register: $register, schema: $schema)); } catch (Throwable $e) { return new JSONResponse(['message' => 'Not found'], Http::STATUS_NOT_FOUND); } diff --git a/lib/Controller/BrcController.php b/lib/Controller/BrcController.php index 4c1a4769a7..7b14f65da4 100644 --- a/lib/Controller/BrcController.php +++ b/lib/Controller/BrcController.php @@ -33,6 +33,7 @@ use OCA\Dossiq\Service\ZgwService; use OCA\Dossiq\Service\Zgw\BrcCrossRegisterSync; use OCA\Dossiq\Service\Zgw\BrcDocumentLinkHandler; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Http; use OCP\AppFramework\Http\Attribute\AnonRateLimit; use OCP\AppFramework\Http\JSONResponse; @@ -360,8 +361,7 @@ public function audittrailIndex(string $resource, string $uuid): JSONResponse { try { $objectService->find( $uuid, - register: $mappingConfig['sourceRegister'], - schema: $mappingConfig['sourceSchema'] + options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema']) ); } catch (\Throwable $e) { return new JSONResponse( @@ -459,8 +459,7 @@ private function destroyDecision(string $uuid): JSONResponse { try { $existingObj = $objectService->find( $uuid, - register: $mappingConfig['sourceRegister'], - schema: $mappingConfig['sourceSchema'] + options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema']) ); } catch (\Throwable $e) { return $this->zgwService->storeFailureResponse(error: $e, operation: 'BRC delete besluit', object: $object); diff --git a/lib/Controller/DrcController.php b/lib/Controller/DrcController.php index 8073a6fd86..2add8a4e5c 100644 --- a/lib/Controller/DrcController.php +++ b/lib/Controller/DrcController.php @@ -32,6 +32,7 @@ use OCA\Dossiq\Service\ZgwService; use OCA\Dossiq\Service\Zgw\ZgwRuleResults; use OCA\Dossiq\Service\Zgw\ZgwSearchScope; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Http; use OCP\AppFramework\Http\Attribute\AnonRateLimit; use OCP\AppFramework\Http\DataDownloadResponse; @@ -748,8 +749,7 @@ private function isReadableEio(string $uuid): bool { try { $this->zgwService->getObjectService()->find( $uuid, - register: $mappingConfig['sourceRegister'], - schema: $mappingConfig['sourceSchema'] + options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema']) ); return true; } catch (\Throwable $e) { @@ -794,9 +794,8 @@ public function download(string $uuid): DataDownloadResponse|JSONResponse { try { $object = $this->zgwService->getObjectService()->find( - register: $mappingConfig['sourceRegister'], - schema: $mappingConfig['sourceSchema'], - id: $uuid + id: $uuid, + options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema']) ); $objectData = $this->objectToArray(row: $object); @@ -925,8 +924,7 @@ private function lockFallback(object $objectService, string $uuid, \Throwable $o try { $existing = $objectService->find( $uuid, - register: $mappingConfig['sourceRegister'], - schema: $mappingConfig['sourceSchema'] + options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema']) ); $existingData = $this->objectToArray(row: $existing); @@ -1086,8 +1084,7 @@ private function unlockFallback(object $objectService, string $uuid, \Throwable try { $existing = $objectService->find( $uuid, - register: $mappingConfig['sourceRegister'], - schema: $mappingConfig['sourceSchema'] + options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema']) ); $existingData = $this->objectToArray(row: $existing); @@ -1150,8 +1147,7 @@ public function audittrailIndex(string $resource, string $uuid): JSONResponse { try { $this->zgwService->getObjectService()->find( $uuid, - register: $mappingConfig['sourceRegister'], - schema: $mappingConfig['sourceSchema'] + options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema']) ); } catch (\Throwable $e) { return new JSONResponse( @@ -1425,8 +1421,7 @@ private function getGebruiksrechtData(string $uuid): ?array { try { $obj = $objectService->find( $uuid, - register: $mappingConfig['sourceRegister'], - schema: $mappingConfig['sourceSchema'] + options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema']) ); $data = $this->objectToArray(row: $obj); @@ -1496,8 +1491,7 @@ private function checkAndClearIndicationGebruiksrecht(string $eioUuid): void { try { $eioObj = $objectService->find( $eioUuid, - register: $eioConfig['sourceRegister'], - schema: $eioConfig['sourceSchema'] + options: new ObjectFindOptions(register: $eioConfig['sourceRegister'], schema: $eioConfig['sourceSchema']) ); $eioData = $this->objectToArray(row: $eioObj); @@ -1551,8 +1545,7 @@ private function setIndicationGebruiksrecht(string $ioUrl, ?bool $value): void { try { $eioObj = $objectService->find( $ioMatches[1], - register: $eioConfig['sourceRegister'], - schema: $eioConfig['sourceSchema'] + options: new ObjectFindOptions(register: $eioConfig['sourceRegister'], schema: $eioConfig['sourceSchema']) ); $eioData = $this->objectToArray(row: $eioObj); @@ -1612,8 +1605,7 @@ public function uploadChunk(string $uuid): JSONResponse { // Find the EIO object. $existing = $objectService->find( $uuid, - register: $mappingConfig['sourceRegister'], - schema: $mappingConfig['sourceSchema'] + options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema']) ); $objectData = $this->objectToArray(row: $existing); @@ -1784,8 +1776,7 @@ private function enrichWithBestandsdelen(JSONResponse $response, string $uuid): try { $existing = $this->zgwService->getObjectService()->find( $uuid, - register: $mappingConfig['sourceRegister'], - schema: $mappingConfig['sourceSchema'] + options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema']) ); $objectData = $this->objectToArray(row: $existing); @@ -2010,8 +2001,7 @@ private function saveEioKeepingItsLock(string $uuid, array $englishData, array $ $existingData = $this->objectToArray( row: $objectService->find( $uuid, - register: $mappingConfig['sourceRegister'], - schema: $mappingConfig['sourceSchema'] + options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema']) ) ); @@ -2187,8 +2177,7 @@ private function lockIdFromObject(object $objectService, array $mappingConfig, s $existingData = $this->objectToArray( row: $objectService->find( $uuid, - register: $mappingConfig['sourceRegister'], - schema: $mappingConfig['sourceSchema'] + options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema']) ) ); } catch (\Throwable $e) { @@ -2229,8 +2218,7 @@ private function storeLockIdInData( try { $existing = $objectService->find( $uuid, - register: $mappingConfig['sourceRegister'], - schema: $mappingConfig['sourceSchema'] + options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema']) ); $existingData = $this->objectToArray(row: $existing); @@ -2268,8 +2256,7 @@ private function clearLockIdInData( try { $existing = $objectService->find( $uuid, - register: $mappingConfig['sourceRegister'], - schema: $mappingConfig['sourceSchema'] + options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema']) ); $existingData = $this->objectToArray(row: $existing); diff --git a/lib/Controller/PublicCaseSurvivorController.php b/lib/Controller/PublicCaseSurvivorController.php index 6c900c3c4d..17f8d0a6ae 100644 --- a/lib/Controller/PublicCaseSurvivorController.php +++ b/lib/Controller/PublicCaseSurvivorController.php @@ -41,6 +41,7 @@ use OCA\Dossiq\Service\CaseMergeService; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Controller; use OCP\AppFramework\Http; use OCP\AppFramework\Http\Attribute\AnonRateLimit; @@ -176,10 +177,7 @@ private function renderPublicly(string $caseId): ?array { try { $entity = $objectService->find( id: $caseId, - _extend: [], - files: false, - register: $register, - schema: $schema, + options: new ObjectFindOptions(register: $register, schema: $schema), _rbac: true, _multitenancy: true ); diff --git a/lib/Controller/RoutingController.php b/lib/Controller/RoutingController.php index 337f44c619..23466e3960 100644 --- a/lib/Controller/RoutingController.php +++ b/lib/Controller/RoutingController.php @@ -34,6 +34,7 @@ use OCA\Dossiq\Service\RoleResolverService; use OCA\Dossiq\Service\Routing\CaseRouter; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Controller; use OCP\AppFramework\Http; use OCP\AppFramework\Http\JSONResponse; @@ -128,12 +129,12 @@ public function reroute(string $id): JSONResponse { $caseSchema = $this->settingsService->getConfigValue('case_schema'); $workflowSlug = $this->settingsService->getConfigValue('workflow_template_schema'); - $case = $this->toArray(value: $objectService->find($id, register: $register, schema: $caseSchema)); + $case = $this->toArray(value: $objectService->find($id, options: new ObjectFindOptions(register: $register, schema: $caseSchema))); $workflowId = (string)($case['workflowTemplate'] ?? ''); $steps = []; if ($workflowId !== '' && $workflowSlug !== '') { - $workflow = $this->toArray(value: $objectService->find($workflowId, register: $register, schema: $workflowSlug)); + $workflow = $this->toArray(value: $objectService->find($workflowId, options: new ObjectFindOptions(register: $register, schema: $workflowSlug))); $steps = $this->decodeSteps(value: $workflow['steps'] ?? '[]'); } diff --git a/lib/Controller/SubsidieRegisterController.php b/lib/Controller/SubsidieRegisterController.php index 47c89e4779..caff3ff071 100644 --- a/lib/Controller/SubsidieRegisterController.php +++ b/lib/Controller/SubsidieRegisterController.php @@ -31,6 +31,7 @@ use OCA\Dossiq\AppInfo\Application; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Subsidie\SubsidieRegisterExporter; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\Attribute\AnonRateLimit; use OCP\AppFramework\Http\JSONResponse; @@ -172,7 +173,7 @@ private function resolveRegisterConfig(): ?array { */ private function safeFind(object $objectService, string $register, string $schema, string $id): array { try { - $found = $objectService->find($id, register: $register, schema: $schema); + $found = $objectService->find($id, options: new ObjectFindOptions(register: $register, schema: $schema)); return $this->toArray(value: $found); } catch (Throwable $e) { return []; diff --git a/lib/Controller/ZrcController.php b/lib/Controller/ZrcController.php index 9ace8d4632..16f992d551 100644 --- a/lib/Controller/ZrcController.php +++ b/lib/Controller/ZrcController.php @@ -40,6 +40,7 @@ use OCA\Dossiq\Service\Zgw\ZgwSearchScope; use OCA\Dossiq\Service\Zgw\ZrcStatusEffects; use OCA\OpenRegister\Exception\HookStoppedException; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Http; use OCP\AppFramework\Http\Attribute\AnonRateLimit; use OCP\AppFramework\Http\JSONResponse; @@ -958,8 +959,7 @@ private function checkCaseReadAccess(string $uuid): ?JSONResponse { $caseData = $this->objectToArray( row: $this->zgwService->getObjectService()->find( $uuid, - register: $mappingConfig['sourceRegister'], - schema: $mappingConfig['sourceSchema'] + options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema']) ) ); $caseVa = $caseData['confidentiality'] ?? ($caseData['vertrouwelijkheidaanduiding'] ?? 'openbaar'); @@ -1219,8 +1219,7 @@ private function preValidateProductenOfDiensten( try { $ztObj = $this->zgwService->getObjectService()->find( $matches[1], - register: $ztConfig['sourceRegister'], - schema: $ztConfig['sourceSchema'] + options: new ObjectFindOptions(register: $ztConfig['sourceRegister'], schema: $ztConfig['sourceSchema']) ); $ztData = $this->objectToArray(row: $ztObj); } catch (\Throwable $e) { @@ -1353,8 +1352,7 @@ private function caseDeleteRefusal(string $uuid): ?JSONResponse { try { $caseObj = $objectService->find( $uuid, - register: $mappingConfig['sourceRegister'], - schema: $mappingConfig['sourceSchema'] + options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema']) ); } catch (\Throwable $e) { $caseObj = null; @@ -1530,8 +1528,7 @@ private function resolveCaseClosedForExisting(string $resource, string $uuid): a try { $existingObj = $this->zgwService->getObjectService()->find( $uuid, - register: $mappingConfig['sourceRegister'], - schema: $mappingConfig['sourceSchema'] + options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema']) ); $existingData = $this->objectToArray(row: $existingObj); @@ -1856,8 +1853,7 @@ private function getZioDataForOioSync(string $uuid): ?array { $zioObj = $this->zgwService->getObjectService()->find( $uuid, - register: $zioConfig['sourceRegister'], - schema: $zioConfig['sourceSchema'] + options: new ObjectFindOptions(register: $zioConfig['sourceRegister'], schema: $zioConfig['sourceSchema']) ); $zioData = $this->objectToArray(row: $zioObj); diff --git a/lib/Controller/ZtcController.php b/lib/Controller/ZtcController.php index 545a272fa7..dbf8fffcfb 100644 --- a/lib/Controller/ZtcController.php +++ b/lib/Controller/ZtcController.php @@ -35,6 +35,7 @@ use OCA\Dossiq\Service\Zgw\ZtcTypeNameResolver; use OCA\Dossiq\Service\Zgw\ZtcUrlValidityFilter; use OCA\Dossiq\Service\ZgwService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Http; use OCP\AppFramework\Http\Attribute\AnonRateLimit; use OCP\AppFramework\Http\JSONResponse; @@ -285,8 +286,7 @@ private function resolveParentDraft(string $resource, string $uuid): ?bool { try { $existingObj = $this->zgwService->getObjectService()->find( $uuid, - register: $mappingConfig['sourceRegister'], - schema: $mappingConfig['sourceSchema'] + options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema']) ); $existingData = $this->objectToArray(row: $existingObj); diff --git a/lib/Controller/ZtcPublishController.php b/lib/Controller/ZtcPublishController.php index 7f536da02c..7646c6a4eb 100644 --- a/lib/Controller/ZtcPublishController.php +++ b/lib/Controller/ZtcPublishController.php @@ -30,6 +30,7 @@ namespace OCA\Dossiq\Controller; use OCA\Dossiq\Service\ZgwService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Http; use OCP\AppFramework\Http\Attribute\AnonRateLimit; use OCP\AppFramework\Http\JSONResponse; @@ -94,8 +95,7 @@ private function handlePublish(string $resource, string $uuid): JSONResponse { try { $existing = $this->zgwService->getObjectService()->find( $uuid, - register: $mappingConfig['sourceRegister'], - schema: $mappingConfig['sourceSchema'] + options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema']) ); $existingData = $this->publishedCopy(existingData: $this->objectToArray(row: $existing)); diff --git a/lib/Flow/DossiqEnsureCommitteeNode.php b/lib/Flow/DossiqEnsureCommitteeNode.php index a28c4bedf4..11605fa454 100644 --- a/lib/Flow/DossiqEnsureCommitteeNode.php +++ b/lib/Flow/DossiqEnsureCommitteeNode.php @@ -18,6 +18,7 @@ use OCA\Dossiq\Service\Bezwaar\CommitteeDelegationService; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCA\OpenRegister\Service\Flow\IFlowNode; use OCP\IL10N; use OCP\WorkflowEngine\IManager; @@ -283,7 +284,7 @@ private function loadCommittee(string $committeeId): array { } try { - $committee = $objectService->find($committeeId, register: $register, schema: $schema); + $committee = $objectService->find($committeeId, options: new ObjectFindOptions(register: $register, schema: $schema)); } catch (Throwable $e) { throw new RuntimeException('Could not read committee ' . $committeeId . ': ' . $e->getMessage(), 0, $e); } diff --git a/lib/Listener/DeliveryConcludedListener.php b/lib/Listener/DeliveryConcludedListener.php index 768bc92907..0d0ea92929 100644 --- a/lib/Listener/DeliveryConcludedListener.php +++ b/lib/Listener/DeliveryConcludedListener.php @@ -36,6 +36,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\ServiceAccount\BackgroundServiceAccount; use OCA\Dossiq\Service\ServiceAccount\ServiceAccountUnavailableException; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; use Psr\Log\LoggerInterface; @@ -252,7 +253,7 @@ private function publicationsWith(array $case, ConcludedDelivery $delivery): ?ar * @return array|null The case data, or null when not found. */ private function loadCase(object $objectService, string $caseId, mixed $register, mixed $schema): ?array { - $obj = $objectService->find(id: $caseId, register: $register, schema: $schema); + $obj = $objectService->find(id: $caseId, options: new ObjectFindOptions(register: $register, schema: $schema)); if ($obj === null) { return null; } diff --git a/lib/Portal/ApplicantPortalActs.php b/lib/Portal/ApplicantPortalActs.php index 376ed9c007..efe840a303 100644 --- a/lib/Portal/ApplicantPortalActs.php +++ b/lib/Portal/ApplicantPortalActs.php @@ -53,6 +53,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Timeline\CaseTimeline; use OCA\Dossiq\Service\Timeline\TimelineKinds; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\Notification\IManager as INotificationManager; use Psr\Log\LoggerInterface; @@ -263,7 +264,7 @@ private function case(string $caseId): ?array { return null; } - $object = $objectService->find($caseId, register: $register, schema: $schema); + $object = $objectService->find($caseId, options: new ObjectFindOptions(register: $register, schema: $schema)); if (is_object($object) === false || method_exists($object, 'jsonSerialize') === false) { return null; } diff --git a/lib/Repair/FoldCasePropertiesOntoCase.php b/lib/Repair/FoldCasePropertiesOntoCase.php index cb39961a37..258f83ebf8 100644 --- a/lib/Repair/FoldCasePropertiesOntoCase.php +++ b/lib/Repair/FoldCasePropertiesOntoCase.php @@ -39,6 +39,7 @@ use OCA\Dossiq\AppInfo\Application; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IAppConfig; use OCP\Migration\IOutput; use OCP\Migration\IRepairStep; @@ -234,7 +235,7 @@ private function groupByCase(array $values, array $names): array { */ private function foldOne(object $objectService, string $caseSchema, string $caseId, array $entries): string { try { - $case = $objectService->find($caseId, ['_rbac' => false, '_multitenancy' => false]); + $case = $objectService->find($caseId, options: new ObjectFindOptions(extend: ['_rbac' => false, '_multitenancy' => false])); if (is_object($case) === true && method_exists($case, 'jsonSerialize') === true) { $case = $case->jsonSerialize(); } diff --git a/lib/Review/StoppingRuleMet.php b/lib/Review/StoppingRuleMet.php index 02edf8c4fc..17158a0e35 100644 --- a/lib/Review/StoppingRuleMet.php +++ b/lib/Review/StoppingRuleMet.php @@ -29,6 +29,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Timeline\CaseTimeline; use OCA\Dossiq\Service\Timeline\TimelineKinds; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Psr\Log\LoggerInterface; use Throwable; @@ -164,7 +165,7 @@ private function audit(string $caseId, array $context, string $userId): void { } try { - $case = $objectService->find($caseId, register: $register, schema: $schema); + $case = $objectService->find($caseId, options: new ObjectFindOptions(register: $register, schema: $schema)); $mapper->createAuditTrailEntry(object: $case, action: self::ACTION, context: $context, actorId: $userId, actorName: $userId); } catch (Throwable $e) { $this->logger->error( diff --git a/lib/Service/Access/ObjectReadGrants.php b/lib/Service/Access/ObjectReadGrants.php index e9e7719a1b..3068e385e3 100644 --- a/lib/Service/Access/ObjectReadGrants.php +++ b/lib/Service/Access/ObjectReadGrants.php @@ -35,6 +35,7 @@ namespace OCA\Dossiq\Service\Access; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Psr\Container\ContainerInterface; use Psr\Log\LoggerInterface; use Throwable; @@ -248,7 +249,7 @@ private function find(string $schema, string $uuid): ?object { try { // A rule read: the caller manages this record's grants and may not // read it (decision 234). Nothing read here is answered to the caller. - $object = $objectService->find($uuid, register: $register, schema: $schema, _rbac: false, _multitenancy: false); + $object = $objectService->find($uuid, options: new ObjectFindOptions(register: $register, schema: $schema), _rbac: false, _multitenancy: false); } catch (Throwable $e) { return null; } diff --git a/lib/Service/Access/OpenRegisterGrantsGateway.php b/lib/Service/Access/OpenRegisterGrantsGateway.php index 22e76c4ac8..29616306f6 100644 --- a/lib/Service/Access/OpenRegisterGrantsGateway.php +++ b/lib/Service/Access/OpenRegisterGrantsGateway.php @@ -49,6 +49,7 @@ namespace OCA\Dossiq\Service\Access; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\App\IAppManager; use Psr\Container\ContainerInterface; use Psr\Log\LoggerInterface; @@ -347,7 +348,7 @@ private function caseObject(string $caseId): ?object { } try { - $object = $objectService->find($caseId, register: $register, schema: $schema); + $object = $objectService->find($caseId, options: new ObjectFindOptions(register: $register, schema: $schema)); } catch (Throwable $e) { $this->logger->warning( 'Dossiq grants gateway: the case could not be read for its own authorization block', diff --git a/lib/Service/Advice/AdviceRepository.php b/lib/Service/Advice/AdviceRepository.php index 3d2152e749..530640bb0c 100644 --- a/lib/Service/Advice/AdviceRepository.php +++ b/lib/Service/Advice/AdviceRepository.php @@ -42,6 +42,7 @@ use OCA\Dossiq\AppInfo\Application; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Support\SearchesObjects; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Psr\Log\LoggerInterface; use RuntimeException; use Throwable; @@ -92,7 +93,7 @@ public function find(string $adviceId): ?array { } try { - $advice = $objectService->find($adviceId, register: $register, schema: $schema); + $advice = $objectService->find($adviceId, options: new ObjectFindOptions(register: $register, schema: $schema)); } catch (Throwable $e) { $this->logger->error( 'Dossiq: failed to load advice: ' . $e->getMessage(), diff --git a/lib/Service/Ai/ReportGroupingConsumer.php b/lib/Service/Ai/ReportGroupingConsumer.php index fe3a270413..9bfb71c960 100644 --- a/lib/Service/Ai/ReportGroupingConsumer.php +++ b/lib/Service/Ai/ReportGroupingConsumer.php @@ -42,6 +42,7 @@ use OCA\Dossiq\Service\Assistant\HermiqAssistantException; use OCA\Dossiq\Service\CaseTypeStore; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Psr\Log\LoggerInterface; use Throwable; @@ -377,7 +378,7 @@ private function readCase(string $caseId): ?array { } try { - $found = $objectService->find($caseId, register: $register, schema: $schema); + $found = $objectService->find($caseId, options: new ObjectFindOptions(register: $register, schema: $schema)); } catch (Throwable $e) { $this->logger->info( 'ReportGroupingConsumer: case not readable', diff --git a/lib/Service/AppointmentService.php b/lib/Service/AppointmentService.php index cccaed6c8f..4cb4820a2d 100644 --- a/lib/Service/AppointmentService.php +++ b/lib/Service/AppointmentService.php @@ -35,6 +35,7 @@ use OCA\Dossiq\Service\AppointmentBackend\JccBackend; use OCA\Dossiq\Service\AppointmentBackend\QmaticBackend; use OCA\Dossiq\Service\Support\OwningCaseResolver; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\App\IAppManager; use OCP\Http\Client\IClientService; use Psr\Container\ContainerInterface; @@ -179,7 +180,7 @@ public function cancelAppointment(string $appointmentId): array { $register = $this->settingsService->getConfigValue('register'); $schema = $this->settingsService->getConfigValue('appointment_schema'); - $appointment = $objectService->find($appointmentId, register: (int)$register, schema: (int)$schema); + $appointment = $objectService->find($appointmentId, options: new ObjectFindOptions(register: (int)$register, schema: (int)$schema)); $data = $appointment->jsonSerialize(); // Cancel in backend. @@ -211,7 +212,7 @@ public function markNoShow(string $appointmentId): array { $register = $this->settingsService->getConfigValue('register'); $schema = $this->settingsService->getConfigValue('appointment_schema'); - $appointment = $objectService->find($appointmentId, register: (int)$register, schema: (int)$schema); + $appointment = $objectService->find($appointmentId, options: new ObjectFindOptions(register: (int)$register, schema: (int)$schema)); $data = $appointment->jsonSerialize(); $data['status'] = 'no_show'; diff --git a/lib/Service/Assistant/CaseAssistantService.php b/lib/Service/Assistant/CaseAssistantService.php index 85eb100e57..d884446591 100644 --- a/lib/Service/Assistant/CaseAssistantService.php +++ b/lib/Service/Assistant/CaseAssistantService.php @@ -40,6 +40,7 @@ use OCA\Dossiq\AppInfo\Application; use OCA\Dossiq\Service\Ai\AiAuditService; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IConfig; use Psr\Log\LoggerInterface; use Throwable; @@ -211,7 +212,7 @@ private function loadReadableCase(string $caseId): array { $schema = $this->settingsService->getConfigValue('case_schema'); try { - $case = $objectService->find(id: $caseId, register: $register, schema: $schema); + $case = $objectService->find(id: $caseId, options: new ObjectFindOptions(register: $register, schema: $schema)); } catch (Throwable $e) { $this->logger->info( 'CaseAssistantService: case load failed', diff --git a/lib/Service/Beschikking/BeschikkingRepository.php b/lib/Service/Beschikking/BeschikkingRepository.php index a00bed4b98..53a9cd7750 100644 --- a/lib/Service/Beschikking/BeschikkingRepository.php +++ b/lib/Service/Beschikking/BeschikkingRepository.php @@ -36,6 +36,7 @@ namespace OCA\Dossiq\Service\Beschikking; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Psr\Log\LoggerInterface; use RuntimeException; @@ -80,7 +81,7 @@ public function find(string $decisionId): ?array { } try { - return $this->toArray(value: $objectService->find($decisionId, register: $register, schema: $schema)); + return $this->toArray(value: $objectService->find($decisionId, options: new ObjectFindOptions(register: $register, schema: $schema))); } catch (\Throwable $e) { $this->logger->error( 'BeschikkingService: find failed', diff --git a/lib/Service/Bezwaar/BezwaarAuditTrail.php b/lib/Service/Bezwaar/BezwaarAuditTrail.php index b42a542d9b..6c8ae8d9af 100644 --- a/lib/Service/Bezwaar/BezwaarAuditTrail.php +++ b/lib/Service/Bezwaar/BezwaarAuditTrail.php @@ -43,6 +43,7 @@ use DateTimeImmutable; use DateTimeInterface; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\App\IAppManager; use OCP\IUserSession; use Psr\Container\ContainerInterface; @@ -210,7 +211,7 @@ public function write(string $register, string $schema, string $objectUuid, stri $cause = null; try { $object = $this->container->get('OCA\\OpenRegister\\Service\\ObjectService') - ->find($objectUuid, register: $register, schema: $schema); + ->find(id: $objectUuid, options: new ObjectFindOptions(register: $register, schema: $schema)); } catch (Throwable $e) { $cause = $e; } diff --git a/lib/Service/Bulk/CaseTypeVersionGuard.php b/lib/Service/Bulk/CaseTypeVersionGuard.php index d391abe05b..5f5eb0f114 100644 --- a/lib/Service/Bulk/CaseTypeVersionGuard.php +++ b/lib/Service/Bulk/CaseTypeVersionGuard.php @@ -25,6 +25,7 @@ use OCA\Dossiq\Service\CaseTypeStore; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Support\LanguageMapText; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Throwable; /** @@ -149,7 +150,7 @@ private function caseTypeIdsOf(array $caseIds): array { } try { - $case = $objectService->find($caseId, register: $register, schema: $schema); + $case = $objectService->find($caseId, options: new ObjectFindOptions(register: $register, schema: $schema)); } catch (Throwable $e) { continue; } diff --git a/lib/Service/CaseAccessPurposeService.php b/lib/Service/CaseAccessPurposeService.php index 3e5d49c8ae..8bfa157a55 100644 --- a/lib/Service/CaseAccessPurposeService.php +++ b/lib/Service/CaseAccessPurposeService.php @@ -33,6 +33,7 @@ use OCA\Dossiq\AppInfo\Application; use OCA\Dossiq\Exception\RefusedException; use OCA\Dossiq\Service\People\CaseRoleHolder; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Psr\Log\LoggerInterface; use Throwable; @@ -381,7 +382,7 @@ private function assertPurpose(string $purpose, string $note): void { */ private function find(object $objectService, string $id, string $register, string $schema, RefusedException $refusal): object { try { - $found = $objectService->find($id, register: $register, schema: $schema); + $found = $objectService->find($id, options: new ObjectFindOptions(register: $register, schema: $schema)); } catch (Throwable $e) { throw $refusal; } diff --git a/lib/Service/CaseCollaborationService.php b/lib/Service/CaseCollaborationService.php index 454d0e8180..edd7bb2ba1 100644 --- a/lib/Service/CaseCollaborationService.php +++ b/lib/Service/CaseCollaborationService.php @@ -28,6 +28,7 @@ namespace OCA\Dossiq\Service; use DateTime; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\App\IAppManager; use Psr\Container\ContainerInterface; use Psr\Log\LoggerInterface; @@ -178,7 +179,7 @@ private function appendEntry(string $federatedShareId, array $entry): array { return ['error' => 'Federated case collaboration is not configured']; } - $shareObj = $objectService->find($federatedShareId, register: (int)$register, schema: (int)$shareSchema); + $shareObj = $objectService->find($federatedShareId, options: new ObjectFindOptions(register: (int)$register, schema: (int)$shareSchema)); if ($shareObj === null) { return ['error' => 'Federated share not found']; } diff --git a/lib/Service/CaseCopyService.php b/lib/Service/CaseCopyService.php index 7bbe5cd11f..17d1a8ec89 100644 --- a/lib/Service/CaseCopyService.php +++ b/lib/Service/CaseCopyService.php @@ -37,6 +37,7 @@ namespace OCA\Dossiq\Service; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Psr\Log\LoggerInterface; use RuntimeException; @@ -450,7 +451,7 @@ private function fetch(object $objectService, string $register, string $schema, } try { - $found = $objectService->find($id, register: $register, schema: $schema); + $found = $objectService->find($id, options: new ObjectFindOptions(register: $register, schema: $schema)); } catch (\Throwable $e) { $this->logger->debug( 'CaseCopyService: object lookup failed', diff --git a/lib/Service/CaseDefinition/WritesPackageRows.php b/lib/Service/CaseDefinition/WritesPackageRows.php index 851b16b300..bcff75cc4c 100644 --- a/lib/Service/CaseDefinition/WritesPackageRows.php +++ b/lib/Service/CaseDefinition/WritesPackageRows.php @@ -33,6 +33,7 @@ namespace OCA\Dossiq\Service\CaseDefinition; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Psr\Log\LoggerInterface; /** @@ -82,7 +83,7 @@ private function existingId(array $row): string { */ private function holds(object $objectService, string $register, string $schema, string $id): bool { try { - $found = $objectService->find($id, register: $register, schema: $schema, _rbac: false); + $found = $objectService->find($id, options: new ObjectFindOptions(register: $register, schema: $schema), _rbac: false); } catch (\Throwable $e) { return false; } diff --git a/lib/Service/CasePlanProjectionService.php b/lib/Service/CasePlanProjectionService.php index d2f77f33d5..d73dbeac57 100644 --- a/lib/Service/CasePlanProjectionService.php +++ b/lib/Service/CasePlanProjectionService.php @@ -41,6 +41,7 @@ namespace OCA\Dossiq\Service; use OCA\Dossiq\Service\Support\SearchesObjects; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IUserSession; use Psr\Log\LoggerInterface; use Throwable; @@ -669,7 +670,7 @@ private function findCaseType(string $caseTypeId): ?array { $caseType = $this->asSystemWithoutUser( objectService: $objectService, userSession: $this->userSession, - operation: fn (): mixed => $objectService->find($caseTypeId, register: $register, schema: $schema), + operation: fn (): mixed => $objectService->find($caseTypeId, options: new ObjectFindOptions(register: $register, schema: $schema)), ); } catch (Throwable $e) { $this->logger->error( diff --git a/lib/Service/CaseRebindService.php b/lib/Service/CaseRebindService.php index 9f8261bd2f..33fb6c6b77 100644 --- a/lib/Service/CaseRebindService.php +++ b/lib/Service/CaseRebindService.php @@ -58,6 +58,7 @@ use OCA\Dossiq\Service\CaseType\EngineRunMigration; use OCA\Dossiq\Service\Support\RefusesWhenIndeterminate; use OCA\Dossiq\Service\Support\TranslatedText; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Psr\Log\LoggerInterface; use Throwable; @@ -579,7 +580,7 @@ private function readCase(string $caseId): array { [$objectService, $register, $schema] = $this->scope(); try { - $found = $objectService->find($caseId, register: $register, schema: $schema); + $found = $objectService->find($caseId, options: new ObjectFindOptions(register: $register, schema: $schema)); } catch (Throwable $e) { $this->refuseIndeterminate( rule: 'case-unreadable', diff --git a/lib/Service/CaseShare/ShareStore.php b/lib/Service/CaseShare/ShareStore.php index 5210e05a24..dec150a3ac 100644 --- a/lib/Service/CaseShare/ShareStore.php +++ b/lib/Service/CaseShare/ShareStore.php @@ -24,6 +24,8 @@ namespace OCA\Dossiq\Service\CaseShare; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; + /** * One OpenRegister object service bound to the configured share register and schema. * @@ -68,7 +70,7 @@ public function isConfigured(): bool { * @spec openspec/specs/case-share-via-shares-leaf/spec.md */ public function read(string $shareId): mixed { - $share = $this->objectService->find($shareId, register: (int)$this->register, schema: (int)$this->schema); + $share = $this->objectService->find($shareId, options: new ObjectFindOptions(register: (int)$this->register, schema: (int)$this->schema)); if ($share === null || is_array($share) === true) { return $share; } diff --git a/lib/Service/CaseStageDatesService.php b/lib/Service/CaseStageDatesService.php index 40cc0fd3f5..1f77ca5706 100644 --- a/lib/Service/CaseStageDatesService.php +++ b/lib/Service/CaseStageDatesService.php @@ -30,6 +30,7 @@ namespace OCA\Dossiq\Service; use OCA\Dossiq\Service\Support\SearchesObjects; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; /** * Reads when one case reached each status. @@ -115,7 +116,7 @@ private function createdStampOf(object $objectService, string $register, string return ''; } - $case = $objectService->find($caseId, register: $register, schema: $caseSchema); + $case = $objectService->find($caseId, options: new ObjectFindOptions(register: $register, schema: $caseSchema)); if (is_object($case) === true && method_exists($case, 'jsonSerialize') === true) { $case = $case->jsonSerialize(); } diff --git a/lib/Service/CaseTransfer/TransferStore.php b/lib/Service/CaseTransfer/TransferStore.php index 68ec9bc315..e7c7f56418 100644 --- a/lib/Service/CaseTransfer/TransferStore.php +++ b/lib/Service/CaseTransfer/TransferStore.php @@ -24,6 +24,8 @@ namespace OCA\Dossiq\Service\CaseTransfer; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; + /** * One OpenRegister object service bound to the transfer register and schema. * @@ -65,7 +67,7 @@ public function isConfigured(): bool { * @spec openspec/specs/federated-case-collaboration/spec.md */ public function read(string $transferId): ?array { - $transfer = $this->objectService->find($transferId, register: $this->register, schema: $this->schema); + $transfer = $this->objectService->find($transferId, options: new ObjectFindOptions(register: $this->register, schema: $this->schema)); if ($transfer === null) { return null; } diff --git a/lib/Service/CaseType/CaseVersionMove.php b/lib/Service/CaseType/CaseVersionMove.php index b302f09a0e..592bfdbb2b 100644 --- a/lib/Service/CaseType/CaseVersionMove.php +++ b/lib/Service/CaseType/CaseVersionMove.php @@ -52,6 +52,7 @@ use OCA\Dossiq\Exception\RefusedException; use OCA\Dossiq\Service\CaseTypeStore; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Psr\Log\LoggerInterface; use Throwable; @@ -395,7 +396,7 @@ private function readCase(string $caseId): array { [$objectService, $register, $schema] = $this->scope(); try { - $found = $objectService->find($caseId, register: $register, schema: $schema); + $found = $objectService->find($caseId, options: new ObjectFindOptions(register: $register, schema: $schema)); } catch (Throwable $e) { throw RefusedException::indeterminate( rule: 'case-unreadable', diff --git a/lib/Service/CaseTypeCopyService.php b/lib/Service/CaseTypeCopyService.php index f973af4d03..935f4fc2b4 100644 --- a/lib/Service/CaseTypeCopyService.php +++ b/lib/Service/CaseTypeCopyService.php @@ -39,6 +39,7 @@ use OCA\Dossiq\Service\CaseType\DerivedCaseTypePayload; use OCA\Dossiq\Service\CaseType\DerivedCaseTypeReferences; use OCA\Dossiq\Service\Support\LanguageMapText; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Psr\Log\LoggerInterface; /** @@ -591,7 +592,7 @@ private function fetchObject(CaseTypeCopyTarget $target, string $id): ?array { } try { - $obj = $target->objectService->find($id, register: $target->register, schema: $target->schema); + $obj = $target->objectService->find($id, options: new ObjectFindOptions(register: $target->register, schema: $target->schema)); } catch (\Throwable $e) { $this->logger->debug( 'CaseTypeCopyService: object lookup failed', diff --git a/lib/Service/CaseTypeStore.php b/lib/Service/CaseTypeStore.php index 880bb83645..efc5d0b787 100644 --- a/lib/Service/CaseTypeStore.php +++ b/lib/Service/CaseTypeStore.php @@ -36,6 +36,7 @@ namespace OCA\Dossiq\Service; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Throwable; /** @@ -92,7 +93,7 @@ private function readRow(string $schemaKey, string $id): array { } try { - $found = $objectService->find($id, register: $register, schema: $schema); + $found = $objectService->find($id, options: new ObjectFindOptions(register: $register, schema: $schema)); } catch (Throwable $e) { return []; } diff --git a/lib/Service/ContactMomentService.php b/lib/Service/ContactMomentService.php index db1c7ef339..5fecc57c58 100644 --- a/lib/Service/ContactMomentService.php +++ b/lib/Service/ContactMomentService.php @@ -31,6 +31,7 @@ use OCA\Dossiq\AppInfo\Application; use OCA\Dossiq\Service\Support\SearchesObjects; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IUserSession; use Psr\Log\LoggerInterface; use RuntimeException; @@ -332,7 +333,7 @@ public function recordActivity( return false; } - $case = $this->normalize(result: $objectService->find($caseId, register: $register, schema: $caseSchema)); + $case = $this->normalize(result: $objectService->find($caseId, options: new ObjectFindOptions(register: $register, schema: $caseSchema))); $activity = array_values((array)($case['activity'] ?? [])); $activity[] = [ diff --git a/lib/Service/Deelzaak/CaseObjectReader.php b/lib/Service/Deelzaak/CaseObjectReader.php index 110ec985c0..010d5d85ca 100644 --- a/lib/Service/Deelzaak/CaseObjectReader.php +++ b/lib/Service/Deelzaak/CaseObjectReader.php @@ -34,6 +34,7 @@ namespace OCA\Dossiq\Service\Deelzaak; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Psr\Log\LoggerInterface; /** @@ -82,7 +83,7 @@ public function fetchCaseById(string $caseUuid): ?array { } try { - $obj = $objectService->find($caseUuid, register: $register, schema: $schema); + $obj = $objectService->find($caseUuid, options: new ObjectFindOptions(register: $register, schema: $schema)); } catch (\Throwable $e) { $this->logger->debug( 'Case lookup failed', @@ -116,7 +117,7 @@ public function loadCaseType(string $caseTypeId): ?array { } try { - $obj = $objectService->find($caseTypeId, register: $register, schema: $schema); + $obj = $objectService->find($caseTypeId, options: new ObjectFindOptions(register: $register, schema: $schema)); } catch (\Throwable) { return null; } diff --git a/lib/Service/Deelzaak/SubCaseDeriver.php b/lib/Service/Deelzaak/SubCaseDeriver.php index 9dca4ce96a..98d05ec414 100644 --- a/lib/Service/Deelzaak/SubCaseDeriver.php +++ b/lib/Service/Deelzaak/SubCaseDeriver.php @@ -44,6 +44,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Support\CallerIdentity; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Psr\Log\LoggerInterface; /** @@ -243,7 +244,7 @@ private function derived(mixed $created, array $inherited): array { */ private function findParent(SubCaseStore $store): ?object { try { - $parent = $store->objectService->find($store->parentCaseUuid, register: $store->register, schema: $store->schema); + $parent = $store->objectService->find($store->parentCaseUuid, options: new ObjectFindOptions(register: $store->register, schema: $store->schema)); } catch (\Throwable $e) { $this->logger->debug( 'Dossiq: the parent case could not be read for a derive', diff --git a/lib/Service/DoorverbindingService.php b/lib/Service/DoorverbindingService.php index 49d86db2b6..2cb1242110 100644 --- a/lib/Service/DoorverbindingService.php +++ b/lib/Service/DoorverbindingService.php @@ -31,6 +31,7 @@ use OCA\Dossiq\AppInfo\Application; use OCA\Dossiq\Service\Support\SearchesObjects; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Psr\Log\LoggerInterface; use RuntimeException; use Throwable; @@ -220,7 +221,7 @@ private function load(string $doorverbindingId): array { [$objectService, $register, $schema] = $this->resolve(); try { - $record = $objectService->find($doorverbindingId, register: $register, schema: $schema); + $record = $objectService->find($doorverbindingId, options: new ObjectFindOptions(register: $register, schema: $schema)); } catch (Throwable $e) { throw new RuntimeException('Doorverbinding not found'); } diff --git a/lib/Service/Email/CaseEmailRepository.php b/lib/Service/Email/CaseEmailRepository.php index 0f9bf0ed04..0cb888970a 100644 --- a/lib/Service/Email/CaseEmailRepository.php +++ b/lib/Service/Email/CaseEmailRepository.php @@ -42,6 +42,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Support\SearchesObjects; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; /** * OpenRegister persistence and lookup for case-integrated email. @@ -152,7 +153,7 @@ public function loadCaseRecord(string $caseId): array { $register = $this->settingsService->getConfigValue('register'); $schema = $this->settingsService->getConfigValue('case_schema'); - $caseObj = $objectService->find($caseId, register: $register, schema: $schema); + $caseObj = $objectService->find($caseId, options: new ObjectFindOptions(register: $register, schema: $schema)); if ($caseObj === null) { return []; } diff --git a/lib/Service/Email/EmailTemplateRepository.php b/lib/Service/Email/EmailTemplateRepository.php index e812e774a8..ec723de132 100644 --- a/lib/Service/Email/EmailTemplateRepository.php +++ b/lib/Service/Email/EmailTemplateRepository.php @@ -37,6 +37,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Support\SearchesObjects; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use RuntimeException; /** @@ -192,7 +193,7 @@ private function findIn(string $configKey, string $id): ?array { } try { - $obj = $objectService->find($id, register: $register, schema: $schema); + $obj = $objectService->find($id, options: new ObjectFindOptions(register: $register, schema: $schema)); } catch (\Throwable) { return null; } diff --git a/lib/Service/Email/UnmatchedMailIntake.php b/lib/Service/Email/UnmatchedMailIntake.php index d69e114b0b..4ea4247789 100644 --- a/lib/Service/Email/UnmatchedMailIntake.php +++ b/lib/Service/Email/UnmatchedMailIntake.php @@ -41,6 +41,7 @@ use OCA\Dossiq\AppInfo\Application; use OCA\Dossiq\Service\AssigneeResolver; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IAppConfig; use Psr\Log\LoggerInterface; use Throwable; @@ -322,7 +323,7 @@ private function assigneeFor(string $caseTypeId): string { } try { - $caseType = $objectService->find($caseTypeId, register: $register, schema: $schema); + $caseType = $objectService->find($caseTypeId, options: new ObjectFindOptions(register: $register, schema: $schema)); } catch (Throwable $e) { $this->logger->debug( 'UnmatchedMailIntake: could not read the fallback case type', diff --git a/lib/Service/Flow/CaseFlowActions.php b/lib/Service/Flow/CaseFlowActions.php index 9a159bee34..a99f8cac38 100644 --- a/lib/Service/Flow/CaseFlowActions.php +++ b/lib/Service/Flow/CaseFlowActions.php @@ -42,6 +42,7 @@ use DateTimeImmutable; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Psr\Container\ContainerInterface; use Psr\Log\LoggerInterface; use RuntimeException; @@ -463,7 +464,7 @@ private function fetch(object $objectService, string $register, string $schema, } try { - $found = $objectService->find($id, register: $register, schema: $schema); + $found = $objectService->find($id, options: new ObjectFindOptions(register: $register, schema: $schema)); } catch (Throwable $e) { $this->logger->debug( 'CaseFlowActions: object lookup failed', diff --git a/lib/Service/Kcc/CallbackService.php b/lib/Service/Kcc/CallbackService.php index ec9ece2a9e..27aab42ca3 100644 --- a/lib/Service/Kcc/CallbackService.php +++ b/lib/Service/Kcc/CallbackService.php @@ -31,6 +31,7 @@ use DateTimeImmutable; use DateTimeInterface; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\OCS\OCSBadRequestException; use Psr\Log\LoggerInterface; @@ -288,7 +289,7 @@ private function resolve(): array { */ private function findOwned(object $objectService, string $register, string $schema, string $id, string $agentId, bool $isPrivileged): array { try { - $found = $objectService->find($id, register: $register, schema: $schema); + $found = $objectService->find($id, options: new ObjectFindOptions(register: $register, schema: $schema)); } catch (\Throwable $e) { throw new OCSBadRequestException('Callback request not found'); } diff --git a/lib/Service/Kcc/ContactMomentService.php b/lib/Service/Kcc/ContactMomentService.php index 73edc1c008..cd0080cd0d 100644 --- a/lib/Service/Kcc/ContactMomentService.php +++ b/lib/Service/Kcc/ContactMomentService.php @@ -31,6 +31,7 @@ use OCA\Dossiq\Service\CaseDateNormaliser; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\OCS\OCSBadRequestException; use Psr\Log\LoggerInterface; @@ -304,7 +305,7 @@ private function resolve(): array { */ private function findOwned(object $objectService, string $register, string $schema, string $id, string $agentId, bool $isPrivileged): array { try { - $found = $objectService->find($id, register: $register, schema: $schema); + $found = $objectService->find($id, options: new ObjectFindOptions(register: $register, schema: $schema)); } catch (\Throwable $e) { throw new OCSBadRequestException('Contact moment not found'); } diff --git a/lib/Service/Obligations/ObligationService.php b/lib/Service/Obligations/ObligationService.php index ab054e1875..1736291222 100644 --- a/lib/Service/Obligations/ObligationService.php +++ b/lib/Service/Obligations/ObligationService.php @@ -39,6 +39,7 @@ use OCA\Dossiq\Service\CaseDateNormaliser; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Support\SearchesObjects; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Psr\Log\LoggerInterface; use Throwable; @@ -333,7 +334,7 @@ private function close( $row = null; try { - $row = $objectService->find($obligationId, register: $register, schema: $schema); + $row = $objectService->find($obligationId, options: new ObjectFindOptions(register: $register, schema: $schema)); } catch (Throwable $e) { $this->logger->warning( 'Dossiq obligations: the obligation to settle could not be read', diff --git a/lib/Service/Publication/OpenCatalogiApiClient.php b/lib/Service/Publication/OpenCatalogiApiClient.php index d56607ef3a..a7f331e92f 100644 --- a/lib/Service/Publication/OpenCatalogiApiClient.php +++ b/lib/Service/Publication/OpenCatalogiApiClient.php @@ -63,6 +63,7 @@ use OCA\Dossiq\AppInfo\Application; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\Http\Client\IClientService; use OCP\IAppConfig; use OCP\IURLGenerator; @@ -369,8 +370,7 @@ private function readObjectData(string $register, string $schema, string $id): a try { $stored = $objectService->findSilent( id: $id, - register: $register, - schema: $schema, + options: new ObjectFindOptions(register: $register, schema: $schema), ); } catch (Throwable $e) { $this->logger->warning( diff --git a/lib/Service/PublicationService.php b/lib/Service/PublicationService.php index 360ce3e3af..d8753311e0 100644 --- a/lib/Service/PublicationService.php +++ b/lib/Service/PublicationService.php @@ -33,6 +33,7 @@ use OCA\Dossiq\Service\Publication\PublicationDateRule; use InvalidArgumentException; use OCA\Dossiq\AppInfo\Application; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventDispatcher; use Psr\Log\LoggerInterface; @@ -338,7 +339,7 @@ private function attachDelivery(array $publications, string $channel, array $del */ private function loadCase(object $objectService, string $caseId, mixed $register, mixed $schema): array { try { - $obj = $objectService->find(id: $caseId, register: $register, schema: $schema); + $obj = $objectService->find(id: $caseId, options: new ObjectFindOptions(register: $register, schema: $schema)); } catch (Throwable $e) { $this->logger->error( 'PublicationService::publish find failed', diff --git a/lib/Service/Queue/EndOfDayService.php b/lib/Service/Queue/EndOfDayService.php index 64621fdb78..49da5fcee5 100644 --- a/lib/Service/Queue/EndOfDayService.php +++ b/lib/Service/Queue/EndOfDayService.php @@ -32,6 +32,7 @@ use DateTimeZone; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Task\EngineTaskGateway; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IL10N; use Psr\Log\LoggerInterface; use Throwable; @@ -240,7 +241,7 @@ private function readStateOf(array $item, string $userId): ?object { return null; } - $object = $objectService->find((string)$item['subjectId'], register: $this->register(), schema: $this->caseSchema()); + $object = $objectService->find((string)$item['subjectId'], options: new ObjectFindOptions(register: $this->register(), schema: $this->caseSchema())); return $readState->readStateFor(object: $object, userId: $userId); }//end readStateOf() diff --git a/lib/Service/QuickActionService.php b/lib/Service/QuickActionService.php index 8b1da4c4e5..411b484671 100644 --- a/lib/Service/QuickActionService.php +++ b/lib/Service/QuickActionService.php @@ -32,6 +32,7 @@ use OCA\Dossiq\AppInfo\Application; use OCA\Dossiq\Service\CaseType\CaseTypeReferenceResolver; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Psr\Log\LoggerInterface; use RuntimeException; use Throwable; @@ -248,7 +249,7 @@ private function loadCase(string $caseId): array { [$objectService, $register, $caseSchema] = $this->resolveCase(); try { - return $this->toArray(result: $objectService->find($caseId, register: $register, schema: $caseSchema)); + return $this->toArray(result: $objectService->find($caseId, options: new ObjectFindOptions(register: $register, schema: $caseSchema))); } catch (Throwable $e) { throw new RuntimeException('Case not found'); } diff --git a/lib/Service/Relation/CaseRelationStore.php b/lib/Service/Relation/CaseRelationStore.php index 91a52bc9ae..d2dbc14a20 100644 --- a/lib/Service/Relation/CaseRelationStore.php +++ b/lib/Service/Relation/CaseRelationStore.php @@ -39,6 +39,7 @@ namespace OCA\Dossiq\Service\Relation; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Psr\Log\LoggerInterface; /** @@ -111,7 +112,7 @@ private function findObject(string $uuid, string $schemaKey, string $what): ?arr } try { - $obj = $objectService->find($uuid, register: $register, schema: $schema); + $obj = $objectService->find($uuid, options: new ObjectFindOptions(register: $register, schema: $schema)); } catch (\Throwable $e) { $this->logger->debug( 'CaseRelationService: ' . $what . ' lookup failed', diff --git a/lib/Service/Sharing/CaseAccessPolicy.php b/lib/Service/Sharing/CaseAccessPolicy.php index de02f346bb..f7f0566235 100644 --- a/lib/Service/Sharing/CaseAccessPolicy.php +++ b/lib/Service/Sharing/CaseAccessPolicy.php @@ -42,6 +42,7 @@ namespace OCA\Dossiq\Service\Sharing; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IGroupManager; use Psr\Log\LoggerInterface; @@ -124,7 +125,7 @@ public function canUserAccessCase(string $caseId, string $userId): bool { } try { - $caseObj = $objectService->find($caseId, register: (int)$register, schema: (int)$caseSchema); + $caseObj = $objectService->find($caseId, options: new ObjectFindOptions(register: (int)$register, schema: (int)$caseSchema)); if ($caseObj === null) { // Case not found — deny (treated as 404 by callers). return false; diff --git a/lib/Service/Sharing/CaseLinkShares.php b/lib/Service/Sharing/CaseLinkShares.php index 8280e8b46c..66621341d9 100644 --- a/lib/Service/Sharing/CaseLinkShares.php +++ b/lib/Service/Sharing/CaseLinkShares.php @@ -34,6 +34,7 @@ namespace OCA\Dossiq\Service\Sharing; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Psr\Log\LoggerInterface; /** @@ -217,7 +218,7 @@ public function markCollected(string $shareId, int $noteId): bool { try { $share = $this->gateway->toArray( - $objectService->find($shareId, register: (int)$register, schema: (int)$shareSchema) + $objectService->find($shareId, options: new ObjectFindOptions(register: (int)$register, schema: (int)$shareSchema)) ); if ($share === []) { return false; diff --git a/lib/Service/Sharing/FederatedCaseShareService.php b/lib/Service/Sharing/FederatedCaseShareService.php index e8469ee15f..d9607c65fe 100644 --- a/lib/Service/Sharing/FederatedCaseShareService.php +++ b/lib/Service/Sharing/FederatedCaseShareService.php @@ -48,6 +48,7 @@ use OCA\Dossiq\Service\CaseSharingService; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\TenantAuditTrailService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Psr\Log\LoggerInterface; /** @@ -217,7 +218,7 @@ public function revokeFederatedShare(string $shareId, string $userId): array { return ['error' => 'Federated case sharing is not configured']; } - $shareObj = $objectService->find($shareId, register: (int)$register, schema: (int)$shareSchema); + $shareObj = $objectService->find($shareId, options: new ObjectFindOptions(register: (int)$register, schema: (int)$shareSchema)); if ($shareObj === null) { return ['error' => 'Federated share not found']; } @@ -288,7 +289,7 @@ public function getCaseIdForFederatedShare(string $shareId): ?string { } try { - $shareObj = $objectService->find($shareId, register: (int)$register, schema: (int)$shareSchema); + $shareObj = $objectService->find($shareId, options: new ObjectFindOptions(register: (int)$register, schema: (int)$shareSchema)); if ($shareObj === null) { return null; } @@ -346,7 +347,7 @@ private function loadCaseForFederatedShare( int $caseSchema, ): ?array { try { - $caseObj = $objectService->find($caseId, register: $register, schema: $caseSchema); + $caseObj = $objectService->find($caseId, options: new ObjectFindOptions(register: $register, schema: $caseSchema)); } catch (\Throwable $e) { $this->logger->warning( 'CaseSharingService: createFederatedShare case load failed', diff --git a/lib/Service/Starter/StarterStore.php b/lib/Service/Starter/StarterStore.php index c5089e67b7..dd1ee11d46 100644 --- a/lib/Service/Starter/StarterStore.php +++ b/lib/Service/Starter/StarterStore.php @@ -26,6 +26,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Support\SearchesObjects; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Psr\Log\LoggerInterface; use Throwable; @@ -313,8 +314,7 @@ private function systemFind(array $context, string $id): ?array { try { $object = $context['service']->find( id: $id, - register: $context['register'], - schema: $context['schema'], + options: new ObjectFindOptions(register: $context['register'], schema: $context['schema']), _rbac: false, ); } catch (\OCP\AppFramework\Db\DoesNotExistException $e) { diff --git a/lib/Service/Stuf/StufRegisterAccess.php b/lib/Service/Stuf/StufRegisterAccess.php index c8ef411883..6f9ca4a758 100644 --- a/lib/Service/Stuf/StufRegisterAccess.php +++ b/lib/Service/Stuf/StufRegisterAccess.php @@ -29,6 +29,7 @@ namespace OCA\Dossiq\Service\Stuf; use OCA\Dossiq\AppInfo\Application; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\App\IAppManager; use OCP\AppFramework\IAppContainer; use OCP\IAppConfig; @@ -112,7 +113,7 @@ public function findById(string $schema, string $id): ?array { return null; } - $object = $service->find(id: $id, register: $this->getRegisterId(), schema: $schema); + $object = $service->find(id: $id, options: new ObjectFindOptions(register: $this->getRegisterId(), schema: $schema)); } catch (\Throwable $e) { $this->logger->warning( message: 'StUF register findById failed: {err}', diff --git a/lib/Service/Support/OwningCaseResolver.php b/lib/Service/Support/OwningCaseResolver.php index 840708d4b2..9f705c65ff 100644 --- a/lib/Service/Support/OwningCaseResolver.php +++ b/lib/Service/Support/OwningCaseResolver.php @@ -40,6 +40,7 @@ namespace OCA\Dossiq\Service\Support; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Psr\Log\LoggerInterface; use Throwable; @@ -154,7 +155,7 @@ private function loadChild(string $objectId, string $schemaKey): ?array { } try { - $object = $objectService->find($objectId, register: (int)$register, schema: (int)$schema); + $object = $objectService->find($objectId, options: new ObjectFindOptions(register: (int)$register, schema: (int)$schema)); } catch (Throwable $e) { $this->logger->warning( 'Dossiq: owning-case lookup failed — denying: ' . $e->getMessage() diff --git a/lib/Service/Support/SearchesObjects.php b/lib/Service/Support/SearchesObjects.php index fb7eacab91..973caaae36 100644 --- a/lib/Service/Support/SearchesObjects.php +++ b/lib/Service/Support/SearchesObjects.php @@ -40,6 +40,7 @@ namespace OCA\Dossiq\Service\Support; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IUserSession; use RuntimeException; @@ -200,8 +201,7 @@ protected function findObjectAsArray( try { $object = $objectService->find( id: $id, - register: $register, - schema: $schema + options: new ObjectFindOptions(register: $register, schema: $schema) ); } catch (\OCP\AppFramework\Db\DoesNotExistException $e) { return null; diff --git a/lib/Service/Support/UnscopedObjectReader.php b/lib/Service/Support/UnscopedObjectReader.php index 6c8b0d1527..526f965fa6 100644 --- a/lib/Service/Support/UnscopedObjectReader.php +++ b/lib/Service/Support/UnscopedObjectReader.php @@ -29,6 +29,7 @@ namespace OCA\Dossiq\Service\Support; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Db\DoesNotExistException; /** @@ -73,8 +74,7 @@ private function findUnscoped(object $objectService, int|string $register, int|s try { $object = $objectService->find( id: $id, - register: $register, - schema: $schema, + options: new ObjectFindOptions(register: $register, schema: $schema), _rbac: false, _multitenancy: false, ); diff --git a/lib/Service/TenantAuditTrailService.php b/lib/Service/TenantAuditTrailService.php index d3dcd97a97..2bea626119 100644 --- a/lib/Service/TenantAuditTrailService.php +++ b/lib/Service/TenantAuditTrailService.php @@ -40,6 +40,7 @@ namespace OCA\Dossiq\Service; use DateTimeImmutable; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\App\IAppManager; use Psr\Container\ContainerInterface; use Psr\Log\LoggerInterface; @@ -248,8 +249,7 @@ private function resolveTenantEntity(string $tenantId): mixed { $objectService = $this->container->get('OCA\\OpenRegister\\Service\\ObjectService'); return $objectService->find( $tenantId, - register: self::REGISTER, - schema: self::SCHEMA_TENANT, + options: new ObjectFindOptions(register: self::REGISTER, schema: self::SCHEMA_TENANT), _rbac: false, _multitenancy: false ); diff --git a/lib/Service/TenantOnboardingService.php b/lib/Service/TenantOnboardingService.php index 3ff2463363..ff258fd8e7 100644 --- a/lib/Service/TenantOnboardingService.php +++ b/lib/Service/TenantOnboardingService.php @@ -29,6 +29,7 @@ use OCA\Dossiq\AppInfo\Application; use OCA\Dossiq\Command\Backfill\OpenRegisterRowNormaliser; use OCA\Dossiq\Service\Task\OnboardingSteps; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\App\IAppManager; use OCP\IUserSession; use Psr\Container\ContainerInterface; @@ -386,7 +387,7 @@ private function tierOf(string $tenantId): string { } try { - $anchor = $objectService->find($tenantId, register: Application::REGISTER_SLUG, schema: 'tenant', _rbac: false, _multitenancy: false); + $anchor = $objectService->find($tenantId, options: new ObjectFindOptions(register: Application::REGISTER_SLUG, schema: 'tenant'), _rbac: false, _multitenancy: false); } catch (Throwable $e) { return 'basic'; } diff --git a/lib/Service/TenantService.php b/lib/Service/TenantService.php index 9776ee2fbe..6c3afc9fc9 100644 --- a/lib/Service/TenantService.php +++ b/lib/Service/TenantService.php @@ -37,6 +37,7 @@ namespace OCA\Dossiq\Service; use DateTimeInterface; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\App\IAppManager; use OCP\IGroupManager; use Psr\Container\ContainerInterface; @@ -189,8 +190,7 @@ private function anchorExists(object $objectService, string $uuid): bool { try { $found = $objectService->find( $uuid, - register: self::REGISTER, - schema: self::SCHEMA_TENANT, + options: new ObjectFindOptions(register: self::REGISTER, schema: self::SCHEMA_TENANT), _rbac: false, _multitenancy: false ); diff --git a/lib/Service/Timeline/CaseTimeline.php b/lib/Service/Timeline/CaseTimeline.php index 072a5c6003..ba7d6d73e2 100644 --- a/lib/Service/Timeline/CaseTimeline.php +++ b/lib/Service/Timeline/CaseTimeline.php @@ -49,6 +49,7 @@ use OCA\Dossiq\AppInfo\Application; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Support\SearchesObjects; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IUserSession; use Psr\Container\ContainerInterface; use Psr\Log\LoggerInterface; @@ -211,7 +212,7 @@ private function writeEntry(array $coordinates, string $caseId, array $data, arr [$objectService, $register, $schema] = $coordinates; $writer = $this->writer(); - $object = $objectService->find($caseId, register: $register, schema: $schema); + $object = $objectService->find($caseId, options: new ObjectFindOptions(register: $register, schema: $schema)); if ($object === null) { $this->soften(caseId: $caseId, kind: (string)$data['kind'], reason: 'the case could not be read'); return ''; @@ -311,8 +312,7 @@ public function publicEntries(string $caseId, int $limit = 50): array { // entries of the case asked for come back. $object = $objectService->find( $caseId, - register: $register, - schema: $schema, + options: new ObjectFindOptions(register: $register, schema: $schema), _rbac: false, _multitenancy: false ); @@ -423,7 +423,7 @@ private function relatedObjects( $seen[$relatedId] = true; try { - $object = $objectService->find($relatedId, register: $register, schema: $schema); + $object = $objectService->find($relatedId, options: new ObjectFindOptions(register: $register, schema: $schema)); } catch (Throwable $e) { $object = null; } diff --git a/lib/Service/Transitions/CaseResultWriter.php b/lib/Service/Transitions/CaseResultWriter.php index 438c00b0f9..d5894bfc8d 100644 --- a/lib/Service/Transitions/CaseResultWriter.php +++ b/lib/Service/Transitions/CaseResultWriter.php @@ -35,6 +35,7 @@ use OCA\Dossiq\Service\CaseTypeResolver; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Support\LanguageMapText; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use RuntimeException; /** @@ -300,7 +301,10 @@ private function findRow(string $schemaKey, string $id): array { try { return $this->toArray( - value: $context['objectService']->find($id, register: $context['register'], schema: $context['schema']), + value: $context['objectService']->find( + id: $id, + options: new ObjectFindOptions(register: $context['register'], schema: $context['schema']) + ), ); } catch (\Throwable $e) { return []; diff --git a/lib/Service/Transitions/CaseStatusStore.php b/lib/Service/Transitions/CaseStatusStore.php index d8b102e69d..4884394d23 100644 --- a/lib/Service/Transitions/CaseStatusStore.php +++ b/lib/Service/Transitions/CaseStatusStore.php @@ -41,6 +41,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Support\TranslatedText; use OCA\Dossiq\Service\Timeline\StatusMoveEntry; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Psr\Log\LoggerInterface; use RuntimeException; @@ -92,7 +93,7 @@ public function loadCase(string $caseId): ?array { } try { - return $this->toArray(value: $objectService->find($caseId, register: $register, schema: $caseSchema)); + return $this->toArray(value: $objectService->find($caseId, options: new ObjectFindOptions(register: $register, schema: $caseSchema))); } catch (\Throwable $e) { $this->logger->error( 'StatusTransitionService: loadCase failed', diff --git a/lib/Service/Transitions/CaseTypeReader.php b/lib/Service/Transitions/CaseTypeReader.php index d4c81d4de9..041b8c5fa3 100644 --- a/lib/Service/Transitions/CaseTypeReader.php +++ b/lib/Service/Transitions/CaseTypeReader.php @@ -31,6 +31,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Support\LanguageMapText; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; /** * Reads a case type's lifecycle rules and its statuses. @@ -215,7 +216,7 @@ private function findRow(string $schemaKey, string $id): array { } try { - return $this->toArray(value: $objectService->find($id, register: $register, schema: $schema)); + return $this->toArray(value: $objectService->find($id, options: new ObjectFindOptions(register: $register, schema: $schema))); } catch (\Throwable $e) { return []; } diff --git a/lib/Service/Transitions/StatusTypeLookup.php b/lib/Service/Transitions/StatusTypeLookup.php index 8c934940dc..9a75ed6742 100644 --- a/lib/Service/Transitions/StatusTypeLookup.php +++ b/lib/Service/Transitions/StatusTypeLookup.php @@ -39,6 +39,7 @@ use OCA\Dossiq\Service\CaseTypeResolver; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Support\LanguageMapText; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Throwable; /** @@ -322,7 +323,7 @@ private function read(string $schemaKey, string $id): array { } try { - $found = $objectService->find($id, register: $register, schema: $schema); + $found = $objectService->find($id, options: new ObjectFindOptions(register: $register, schema: $schema)); } catch (Throwable $e) { return []; } diff --git a/lib/Service/Vth/LhsRecommendationStore.php b/lib/Service/Vth/LhsRecommendationStore.php index 795fb079bd..a156ad9ded 100644 --- a/lib/Service/Vth/LhsRecommendationStore.php +++ b/lib/Service/Vth/LhsRecommendationStore.php @@ -17,6 +17,7 @@ namespace OCA\Dossiq\Service\Vth; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Psr\Log\LoggerInterface; use RuntimeException; use Throwable; @@ -95,7 +96,7 @@ public function loadRecommendation(string $recommendationId): array { [$objectService, $register, $schema] = $this->recommendationStore(); try { - $row = $objectService->find($recommendationId, register: $register, schema: $schema); + $row = $objectService->find($recommendationId, options: new ObjectFindOptions(register: $register, schema: $schema)); } catch (Throwable $e) { $this->logger->error( 'Dossiq LHS: kon aanbeveling niet lezen: ' . $e->getMessage(), diff --git a/lib/Service/Workflow/WorkflowDefinitionRepository.php b/lib/Service/Workflow/WorkflowDefinitionRepository.php index cf9864c7fd..0ec0fb3808 100644 --- a/lib/Service/Workflow/WorkflowDefinitionRepository.php +++ b/lib/Service/Workflow/WorkflowDefinitionRepository.php @@ -41,6 +41,7 @@ use OCA\Dossiq\AppInfo\Application; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Support\SearchesObjects; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Psr\Log\LoggerInterface; /** @@ -193,9 +194,8 @@ private function findOne(string $schemaKey, string $uuid, string $failure): ?arr try { $obj = $context['objectService']->find( - $uuid, - register: $context['register'], - schema: $context['schema'] + id: $uuid, + options: new ObjectFindOptions(register: $context['register'], schema: $context['schema']) ); } catch (\Throwable $e) { $this->logger->error( @@ -400,9 +400,8 @@ private function mergeOntoStored(array $context, string $uuid, array $payload, a try { $current = $this->normalize( row: $context['objectService']->find( - $uuid, - register: $context['register'], - schema: $context['schema'] + id: $uuid, + options: new ObjectFindOptions(register: $context['register'], schema: $context['schema']) ) ); } catch (\Throwable $e) { diff --git a/lib/Service/WorkflowStepAuthorizationResolver.php b/lib/Service/WorkflowStepAuthorizationResolver.php index e84bb48ccf..eb1e0854e9 100644 --- a/lib/Service/WorkflowStepAuthorizationResolver.php +++ b/lib/Service/WorkflowStepAuthorizationResolver.php @@ -36,6 +36,7 @@ namespace OCA\Dossiq\Service; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Psr\Log\LoggerInterface; use Throwable; @@ -168,7 +169,7 @@ private function ncGroupIdFor(string $roleTypeId): ?string { } try { - $roleType = $this->toArray(value: $objectService->find($roleTypeId, register: $register, schema: $roleTypeSchema)); + $roleType = $this->toArray(value: $objectService->find($roleTypeId, options: new ObjectFindOptions(register: $register, schema: $roleTypeSchema))); } catch (Throwable $e) { $this->logger->warning( 'WorkflowStepAuthorizationResolver: roleType lookup failed', diff --git a/lib/Service/Zgw/BrcDocumentLinkHandler.php b/lib/Service/Zgw/BrcDocumentLinkHandler.php index 5b9d46b7b5..61ee3d5f4c 100644 --- a/lib/Service/Zgw/BrcDocumentLinkHandler.php +++ b/lib/Service/Zgw/BrcDocumentLinkHandler.php @@ -31,6 +31,7 @@ use OCA\Dossiq\Service\ZgwService; use OCA\Dossiq\Support\NormalisesObjectRows; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Http; use OCP\AppFramework\Http\JSONResponse; use OCP\IRequest; @@ -262,8 +263,7 @@ public function destroy(IRequest $request, string $uuid): JSONResponse { // Read the BIO to get besluit URL before deletion. $bioObj = $objectService->find( $uuid, - register: $mappingConfig['sourceRegister'], - schema: $mappingConfig['sourceSchema'] + options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema']) ); } catch (\Throwable $e) { return $this->zgwService->storeFailureResponse(error: $e, operation: 'BRC delete BIO', object: $object); diff --git a/lib/Service/Zgw/ZgwParentStateResolver.php b/lib/Service/Zgw/ZgwParentStateResolver.php index a3dab1e944..4424c5225f 100644 --- a/lib/Service/Zgw/ZgwParentStateResolver.php +++ b/lib/Service/Zgw/ZgwParentStateResolver.php @@ -35,6 +35,7 @@ namespace OCA\Dossiq\Service\Zgw; use OCA\Dossiq\Service\ZgwMappingService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Psr\Log\LoggerInterface; use RuntimeException; @@ -285,8 +286,7 @@ private function findMapped(?object $objectService, string $mappingKey, mixed $u $object = $objectService->find( $uuid, - register: $config['sourceRegister'], - schema: $config['sourceSchema'] + options: new ObjectFindOptions(register: $config['sourceRegister'], schema: $config['sourceSchema']) ); if ($object === null) { return null; diff --git a/lib/Service/Zgw/ZgwRuleLookups.php b/lib/Service/Zgw/ZgwRuleLookups.php index 22dc492d86..9df41da821 100644 --- a/lib/Service/Zgw/ZgwRuleLookups.php +++ b/lib/Service/Zgw/ZgwRuleLookups.php @@ -29,6 +29,7 @@ namespace OCA\Dossiq\Service\Zgw; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Db\DoesNotExistException; use RuntimeException; @@ -262,8 +263,7 @@ public function findBySchemaKey(string $uuid, string $schemaKey): ?array { try { $obj = $this->objectService->find( id: $uuid, - register: $register, - schema: $schema + options: new ObjectFindOptions(register: $register, schema: $schema) ); } catch (DoesNotExistException $e) { return null; diff --git a/lib/Service/Zgw/ZrcCaseTypeDefaults.php b/lib/Service/Zgw/ZrcCaseTypeDefaults.php index 8cf99fa99f..941e053522 100644 --- a/lib/Service/Zgw/ZrcCaseTypeDefaults.php +++ b/lib/Service/Zgw/ZrcCaseTypeDefaults.php @@ -30,6 +30,7 @@ use OCA\Dossiq\Service\CaseType\CaseTypeHandling; use OCA\Dossiq\Service\ZgwRulesBase; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; /** * Default assignee and confidentiality of a zaak, read from its zaaktype. @@ -86,8 +87,7 @@ private function caseTypeDefaultAssignee(object $objectService, mixed $caseTypeU try { $caseType = $objectService->find( id: $extractedUuid, - register: $register, - schema: $schema + options: new ObjectFindOptions(register: $register, schema: $schema) ); $ztData = $caseType; diff --git a/lib/Service/Zgw/ZrcEindstatus.php b/lib/Service/Zgw/ZrcEindstatus.php index f9e89c4c71..e1a9696220 100644 --- a/lib/Service/Zgw/ZrcEindstatus.php +++ b/lib/Service/Zgw/ZrcEindstatus.php @@ -29,6 +29,7 @@ use OCA\Dossiq\Service\ZgwService; use OCA\Dossiq\Support\NormalisesObjectRows; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; /** * Decides whether a new status's type is the eindstatus. @@ -203,8 +204,7 @@ private function statusTypesOf(string $caseTypeUuid, array $stConfig): array { private function find(string $uuid, array $config): mixed { return $this->zgwService->getObjectService()->find( $uuid, - register: $config['sourceRegister'], - schema: $config['sourceSchema'] + options: new ObjectFindOptions(register: $config['sourceRegister'], schema: $config['sourceSchema']) ); }//end find() diff --git a/lib/Service/Zgw/ZrcStatusEffects.php b/lib/Service/Zgw/ZrcStatusEffects.php index fc11c57719..5f4c77fed0 100644 --- a/lib/Service/Zgw/ZrcStatusEffects.php +++ b/lib/Service/Zgw/ZrcStatusEffects.php @@ -36,6 +36,7 @@ use OCA\Dossiq\Service\CaseDateNormaliser; use OCA\Dossiq\Service\ZgwService; use OCA\Dossiq\Support\NormalisesObjectRows; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; /** * The zaak-level effects of creating a status or a resultaat. @@ -380,8 +381,7 @@ private function saveCase(string $caseUuid, array $caseData, array $caseConfig): private function find(string $uuid, array $config): mixed { return $this->zgwService->getObjectService()->find( $uuid, - register: $config['sourceRegister'], - schema: $config['sourceSchema'] + options: new ObjectFindOptions(register: $config['sourceRegister'], schema: $config['sourceSchema']) ); }//end find() diff --git a/lib/Service/Zgw/ZrcUsageRights.php b/lib/Service/Zgw/ZrcUsageRights.php index 0a9fa74f84..f6450e9ec6 100644 --- a/lib/Service/Zgw/ZrcUsageRights.php +++ b/lib/Service/Zgw/ZrcUsageRights.php @@ -29,6 +29,7 @@ use OCA\Dossiq\Service\ZgwService; use OCA\Dossiq\Support\NormalisesObjectRows; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; /** * Settles and checks indicatieGebruiksrecht on a zaak's documents. @@ -283,8 +284,7 @@ private function usageRightsOf(array $docData): mixed { private function find(string $uuid, array $config): mixed { return $this->zgwService->getObjectService()->find( $uuid, - register: $config['sourceRegister'], - schema: $config['sourceSchema'] + options: new ObjectFindOptions(register: $config['sourceRegister'], schema: $config['sourceSchema']) ); }//end find() diff --git a/lib/Service/Zgw/ZtcRelatedTypeLookup.php b/lib/Service/Zgw/ZtcRelatedTypeLookup.php index 918b6e27fd..f8fb372dd4 100644 --- a/lib/Service/Zgw/ZtcRelatedTypeLookup.php +++ b/lib/Service/Zgw/ZtcRelatedTypeLookup.php @@ -31,6 +31,7 @@ use OCA\Dossiq\Service\Support\LanguageMapText; use OCA\Dossiq\Service\ZgwService; use OCA\Dossiq\Support\NormalisesObjectRows; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; /** * Looks up the types a ZTC zaaktype relates to. @@ -232,7 +233,7 @@ public function urlsOfObjectsFor(object $objectService, string $resource, string */ public function findIn(?object $objectService, array $mapping, mixed $id): array { return $this->objectToArray( - row: $objectService->find(id: $id, register: $mapping['sourceRegister'], schema: $mapping['sourceSchema']) + row: $objectService->find(id: $id, options: new ObjectFindOptions(register: $mapping['sourceRegister'], schema: $mapping['sourceSchema'])) ); }//end findIn() diff --git a/lib/Service/Zgw/ZtcUrlValidityFilter.php b/lib/Service/Zgw/ZtcUrlValidityFilter.php index 8c5a5bd8d3..0127a29ff0 100644 --- a/lib/Service/Zgw/ZtcUrlValidityFilter.php +++ b/lib/Service/Zgw/ZtcUrlValidityFilter.php @@ -30,6 +30,7 @@ use OCA\Dossiq\Service\ZgwService; use OCA\Dossiq\Support\NormalisesObjectRows; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; /** * Drops the cross-reference URLs of ZTC types that do not point at a published, current type. @@ -191,7 +192,7 @@ private function isPublishedAndCurrent(array $objectData, string $today): bool { */ private function findIn(?object $objectService, array $mapping, string $id): array { return $this->objectToArray( - row: $objectService->find(id: $id, register: $mapping['sourceRegister'], schema: $mapping['sourceSchema']) + row: $objectService->find(id: $id, options: new ObjectFindOptions(register: $mapping['sourceRegister'], schema: $mapping['sourceSchema'])) ); }//end findIn() }//end class diff --git a/lib/Service/ZgwRulesBase.php b/lib/Service/ZgwRulesBase.php index f1a08bd771..ff1ce3eb0f 100644 --- a/lib/Service/ZgwRulesBase.php +++ b/lib/Service/ZgwRulesBase.php @@ -34,6 +34,7 @@ use OCA\Dossiq\Service\Support\SearchesObjects; use OCA\Dossiq\Service\Zgw\ZgwRuleLookups; use OCA\Dossiq\Service\Zgw\ZgwRuleResults; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Psr\Log\LoggerInterface; /** @@ -288,8 +289,7 @@ protected function validateTypeUrl(string $typeUrl, string $fieldName, string $s try { $typeObject = $this->objectService->find( id: $extractedUuid, - register: $register, - schema: $schema + options: new ObjectFindOptions(register: $register, schema: $schema) ); } catch (\Throwable $e) { return $this->error( @@ -380,8 +380,7 @@ protected function validateInformatieobjectUrl(string $ioUrl): ?array { try { $this->objectService->find( id: $ioUuid, - register: $register, - schema: $docSchema + options: new ObjectFindOptions(register: $register, schema: $docSchema) ); } catch (\Throwable $e) { // Document not found locally — acceptable for external DRC URLs. diff --git a/lib/Service/ZgwService.php b/lib/Service/ZgwService.php index 4ef1664182..32570a1801 100644 --- a/lib/Service/ZgwService.php +++ b/lib/Service/ZgwService.php @@ -28,6 +28,7 @@ use OCA\Dossiq\Service\Support\CallerIdentity; use OCA\OpenRegister\Db\Mapping; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Http; use OCP\AppFramework\Http\JSONResponse; use OCP\IRequest; @@ -1209,9 +1210,8 @@ public function handleShow( try { $object = $this->objectService->find( - register: $mappingConfig['sourceRegister'], - schema: $mappingConfig['sourceSchema'], - id: $uuid + id: $uuid, + options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema']) ); } catch (\Throwable $e) { return $this->storeFailureResponse(error: $e, operation: 'ZGW show', object: $resource . ' ' . $uuid); @@ -1439,8 +1439,7 @@ private function readExisting(string $uuid, array $mappingConfig, string $operat private function findSerialized(string $uuid, array $mappingConfig): ?array { $existingObj = $this->objectService->find( $uuid, - register: $mappingConfig['sourceRegister'], - schema: $mappingConfig['sourceSchema'] + options: new ObjectFindOptions(register: $mappingConfig['sourceRegister'], schema: $mappingConfig['sourceSchema']) ); if ($existingObj === null) { return null; diff --git a/lib/Woo/WooReportReadLog.php b/lib/Woo/WooReportReadLog.php index f1e05c5443..b6e274b2bd 100644 --- a/lib/Woo/WooReportReadLog.php +++ b/lib/Woo/WooReportReadLog.php @@ -27,6 +27,7 @@ use OCA\Dossiq\AppInfo\Application; use OCA\Dossiq\Exception\RefusedException; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Psr\Log\LoggerInterface; use Throwable; @@ -106,7 +107,7 @@ public function recordThroughputRead(string $readerId, array $scope, array $case $written = 0; foreach ($caseIds as $caseId) { try { - $case = $objectService->find($caseId, register: $register, schema: $schema); + $case = $objectService->find($caseId, options: new ObjectFindOptions(register: $register, schema: $schema)); $mapper->createAuditTrailEntry( object: $case, action: self::ACTION_THROUGHPUT, diff --git a/tests/Stubs/Contract/ObjectServiceInterface.php b/tests/Stubs/Contract/ObjectServiceInterface.php index 4491622326..1162e812a9 100644 --- a/tests/Stubs/Contract/ObjectServiceInterface.php +++ b/tests/Stubs/Contract/ObjectServiceInterface.php @@ -28,6 +28,7 @@ namespace OCA\OpenRegister\Contract; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IUser; /** @@ -199,27 +200,17 @@ public function setRegister(string|int $register): static; * Find a single object by id, UUID or slug. * * @param int|string $id Object id, UUID or slug. - * @param ?array $_extend Relations to expand on the result. - * @param bool $files Include file metadata. - * @param string|int|null $register Register id, UUID or slug. - * @param string|int|null $schema Schema id, UUID or slug. + * @param ObjectFindOptions|null $options Register, schema, extend, files, render and audit. * @param bool $_rbac Apply register RBAC. * @param bool $_multitenancy Apply organisation scoping. - * @param bool $_render Render the entity before returning it. - * @param bool $_audit Write an audit-trail entry. * * @return ?ObjectEntityInterface The object, or null when absent or not permitted. */ public function find( int|string $id, - ?array $_extend = [], - bool $files = false, - string|int|null $register = null, - string|int|null $schema = null, + ?ObjectFindOptions $options = null, bool $_rbac = true, bool $_multitenancy = true, - bool $_render = true, - bool $_audit = true, ): ?ObjectEntityInterface; /** @@ -612,10 +603,7 @@ public function findByRelations(string $search, bool $partialMatch = true): arra * Find an object without emitting audit or read events. * * @param string $id Object id, UUID or slug. - * @param ?array $_extend Relations to expand on the result. - * @param bool $files Include file metadata. - * @param string|int|null $register Register id, UUID or slug. - * @param string|int|null $schema Schema id, UUID or slug. + * @param ObjectFindOptions|null $options Register, schema, extend and files. * @param bool $_rbac Apply register RBAC. * @param bool $_multitenancy Apply organisation scoping. * @@ -623,10 +611,7 @@ public function findByRelations(string $search, bool $partialMatch = true): arra */ public function findSilent( string $id, - ?array $_extend = [], - bool $files = false, - string|int|null $register = null, - string|int|null $schema = null, + ?ObjectFindOptions $options = null, bool $_rbac = true, bool $_multitenancy = true, ): ObjectEntityInterface; diff --git a/tests/Stubs/Kernel/Contracts/Value/ObjectFindOptions.php b/tests/Stubs/Kernel/Contracts/Value/ObjectFindOptions.php new file mode 100644 index 0000000000..242b8654d7 --- /dev/null +++ b/tests/Stubs/Kernel/Contracts/Value/ObjectFindOptions.php @@ -0,0 +1,55 @@ + + * @copyright 2026 Conduction B.V. + * @license EUPL-1.2 https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12 + * + * @link https://www.OpenRegister.nl + */ + +declare(strict_types=1); + +namespace OCA\OpenRegister\Kernel\Contracts\Value; + +use OCA\OpenRegister\Kernel\Contracts\RegisterInterface; +use OCA\OpenRegister\Kernel\Contracts\SchemaInterface; + +/** + * The optional part of a single-object read: find() and findSilent(). + * + * Without a register and schema the read searches every table. `render` and + * `audit` apply to find() only; findSilent() never renders or audits. + * + * @spec exclude ADR-011 parameter object of the object read, not a capability of its own + */ +final class ObjectFindOptions { + + /** + * Constructor + * + * @param RegisterInterface|string|int|null $register The register, or its id, uuid or slug. + * @param SchemaInterface|string|int|null $schema The schema, or its id, uuid or slug. + * @param array|null $extend Properties to extend the object with. + * @param bool $files Include file information. + * @param bool $render Render the entity before returning it. + * @param bool $audit Write an audit-trail row for this read. + */ + public function __construct( + public readonly RegisterInterface|string|int|null $register=null, + public readonly SchemaInterface|string|int|null $schema=null, + public readonly ?array $extend=[], + public readonly bool $files=false, + public readonly bool $render=true, + public readonly bool $audit=true, + ) { + }//end __construct() +}//end class diff --git a/tests/Support/AnonymousRefusingRegister.php b/tests/Support/AnonymousRefusingRegister.php index 2ab681064c..9ad9f84705 100644 --- a/tests/Support/AnonymousRefusingRegister.php +++ b/tests/Support/AnonymousRefusingRegister.php @@ -32,6 +32,7 @@ namespace OCA\Dossiq\Tests\Support; use Closure; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use RuntimeException; /** @@ -135,13 +136,11 @@ public function writers(): array { */ public function find( int|string $id, - ?array $_extend = [], - bool $files = false, - string|int|null $register = null, - string|int|null $schema = null, + ?ObjectFindOptions $options = null, bool $_rbac = true, bool $_multitenancy = true, ): ?array { + $schema = ($options?->schema ?? null); if ($schema === null || $schema === '') { foreach ($this->rows as $rows) { if (isset($rows[(string)$id]) === true) { diff --git a/tests/Support/EntityAnsweringRegister.php b/tests/Support/EntityAnsweringRegister.php index 8d4387386b..4ee5e93023 100644 --- a/tests/Support/EntityAnsweringRegister.php +++ b/tests/Support/EntityAnsweringRegister.php @@ -29,6 +29,7 @@ namespace OCA\Dossiq\Tests\Support; use OCA\OpenRegister\Db\ObjectEntity; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Db\DoesNotExistException; class EntityAnsweringRegister { @@ -59,14 +60,13 @@ public function __construct( */ public function find( int|string $id, - mixed $_extend = null, - bool $files = false, - int|string $register = '', - int|string $schema = '', + ?ObjectFindOptions $options = null, bool $_rbac = true, bool $_multitenancy = true, ): ObjectEntity { - $row = $this->register->find(id: $id, register: $register, schema: $schema); + $register = ($options?->register ?? ''); + $schema = ($options?->schema ?? ''); + $row = $this->register->find(id: $id, options: new ObjectFindOptions(register: $register, schema: $schema)); if ($row === null) { throw new DoesNotExistException('no such object'); } diff --git a/tests/Support/InMemoryRegister.php b/tests/Support/InMemoryRegister.php index b82db6d1bf..bcf82479fd 100644 --- a/tests/Support/InMemoryRegister.php +++ b/tests/Support/InMemoryRegister.php @@ -31,6 +31,7 @@ namespace OCA\Dossiq\Tests\Support; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Db\DoesNotExistException; /** @@ -151,13 +152,11 @@ public function all(string $schema): array { */ public function find( int|string $id, - mixed $_extend = null, - bool $files = false, - int|string $register = '', - int|string $schema = '', + ?ObjectFindOptions $options = null, bool $_rbac = true, bool $_multitenancy = true, ): ?array { + $schema = ($options?->schema ?? ''); if ($_rbac === false) { $this->unscopedReads[] = (string)$schema . '/' . (string)$id; } diff --git a/tests/Support/UuidAnsweringRegister.php b/tests/Support/UuidAnsweringRegister.php index c4d7a00bed..46e4395a22 100644 --- a/tests/Support/UuidAnsweringRegister.php +++ b/tests/Support/UuidAnsweringRegister.php @@ -18,6 +18,8 @@ namespace OCA\Dossiq\Tests\Support; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; + /** * Delegates to InMemoryRegister; a save on the named schemas answers an entity with a uuid. */ @@ -57,14 +59,13 @@ public function __construct( */ public function find( int|string $id, - mixed $_extend = null, - bool $files = false, - int|string $register = '', - int|string $schema = '', + ?ObjectFindOptions $options = null, bool $_rbac = true, bool $_multitenancy = true, ): ?array { - return $this->store->find(id: $id, register: $register, schema: $schema); + $register = ($options?->register ?? ''); + $schema = ($options?->schema ?? ''); + return $this->store->find(id: $id, options: new ObjectFindOptions(register: $register, schema: $schema)); }//end find() /** diff --git a/tests/Unit/BackgroundJob/PauseChaseJobServiceAccountTest.php b/tests/Unit/BackgroundJob/PauseChaseJobServiceAccountTest.php index 012113d58a..a5e5fcefc9 100644 --- a/tests/Unit/BackgroundJob/PauseChaseJobServiceAccountTest.php +++ b/tests/Unit/BackgroundJob/PauseChaseJobServiceAccountTest.php @@ -44,6 +44,7 @@ use OCA\Dossiq\Service\WorkingDayCalculator; use OCA\Dossiq\Tests\Support\MakesCaseDateNormaliser; use OCA\Dossiq\Tests\Support\RealSchemaValidator; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\App\IAppManager; use OCP\AppFramework\Utility\ITimeFactory; use OCP\IAppConfig; @@ -507,7 +508,7 @@ public function searchObjects(array $query = [], mixed ...$rest): array { * * @return array|null */ - public function find(string $id, int|string $register = '', int|string $schema = ''): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { return $this->test->row(id: $id); } diff --git a/tests/Unit/Controller/AccruingAmountControllerAuthzTest.php b/tests/Unit/Controller/AccruingAmountControllerAuthzTest.php index 0973fb29ba..974f037f72 100644 --- a/tests/Unit/Controller/AccruingAmountControllerAuthzTest.php +++ b/tests/Unit/Controller/AccruingAmountControllerAuthzTest.php @@ -51,6 +51,7 @@ use OCA\Dossiq\Service\Money\AccruingAmountSettler; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Support\OwningCaseResolver; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Http; use OCP\IRequest; use OCP\IUser; @@ -111,7 +112,7 @@ interface AccruingAmountObjectServiceStub { * * @return mixed */ - public function find(int|string $id, mixed $register = null, mixed $schema = null): mixed; + public function find(int|string $id, ?ObjectFindOptions $options = null): mixed; }//end interface /** diff --git a/tests/Unit/Controller/BrcControllerTest.php b/tests/Unit/Controller/BrcControllerTest.php index 05c6dbf6c8..ed31e6db9a 100644 --- a/tests/Unit/Controller/BrcControllerTest.php +++ b/tests/Unit/Controller/BrcControllerTest.php @@ -32,6 +32,7 @@ use OCA\Dossiq\Service\Zgw\StoreFailureAnswer; use OCA\Dossiq\Service\ZgwBusinessRulesService; use OCA\Dossiq\Service\ZgwService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Http\JSONResponse; use OCP\IRequest; use PHPUnit\Framework\MockObject\MockObject; @@ -95,7 +96,9 @@ private function record(string $method, array $arguments): void { } }//end record() - public function find(string $id, mixed $register = null, mixed $schema = null): mixed { + public function find(string $id, ?ObjectFindOptions $options = null): mixed { + $register = ($options?->register ?? null); + $schema = ($options?->schema ?? null); $this->record('find', [$id, $register, $schema]); if (array_key_exists($id, $this->objects) === false) { throw new \OCP\AppFramework\Db\DoesNotExistException('not found'); diff --git a/tests/Unit/Controller/DrcDownloadLockContractTest.php b/tests/Unit/Controller/DrcDownloadLockContractTest.php index bf9352beaa..1a8ba2e6e5 100644 --- a/tests/Unit/Controller/DrcDownloadLockContractTest.php +++ b/tests/Unit/Controller/DrcDownloadLockContractTest.php @@ -49,6 +49,7 @@ use OCA\Dossiq\Service\ZgwDocumentService; use OCA\Dossiq\Service\ZgwMappingService; use OCA\Dossiq\Service\ZgwService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Http; use OCP\AppFramework\Http\JSONResponse; use OCP\IL10N; @@ -76,7 +77,7 @@ interface DrcDownloadLockObjectServiceStub { * * @return mixed The stored object row. */ - public function find(int|string $id = '', ?string $register = null, ?string $schema = null): mixed; + public function find(int|string $id = '', ?ObjectFindOptions $options = null): mixed; /** * Save or update an object. diff --git a/tests/Unit/Controller/DrcEioLifecycleTest.php b/tests/Unit/Controller/DrcEioLifecycleTest.php index 044cba8f42..096ed99fb3 100644 --- a/tests/Unit/Controller/DrcEioLifecycleTest.php +++ b/tests/Unit/Controller/DrcEioLifecycleTest.php @@ -30,6 +30,7 @@ use OCA\Dossiq\Service\ZgwBusinessRulesService; use OCA\Dossiq\Service\ZgwDocumentService; use OCA\Dossiq\Service\ZgwService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Http; use OCP\AppFramework\Http\JSONResponse; use OCP\IL10N; @@ -41,7 +42,7 @@ * The ObjectService shape the EIO paths call. */ interface DrcLifecycleObjectServiceStub { - public function find(mixed $id, mixed $register, mixed $schema): mixed; + public function find(mixed $id, ?ObjectFindOptions $options = null): mixed; public function buildSearchQuery(array $requestParams, mixed $register, mixed $schema): array; @@ -95,7 +96,7 @@ class DrcEioLifecycleTest extends TestCase { private function controller(mixed $stored, array $searches=[], array $body=[], int $destroyStatus=Http::STATUS_NO_CONTENT): DrcController { $objects = $this->createMock(DrcLifecycleObjectServiceStub::class); $objects->method('find')->willReturnCallback( - static function (mixed $id, mixed $register, mixed $schema) use ($stored): mixed { + static function (mixed $id, ?ObjectFindOptions $options = null) use ($stored): mixed { if ($stored instanceof \Throwable) { throw $stored; } diff --git a/tests/Unit/Controller/MandaatMatrixControllerIdentityTest.php b/tests/Unit/Controller/MandaatMatrixControllerIdentityTest.php index 19fba108a4..3ef0657cc5 100644 --- a/tests/Unit/Controller/MandaatMatrixControllerIdentityTest.php +++ b/tests/Unit/Controller/MandaatMatrixControllerIdentityTest.php @@ -42,6 +42,7 @@ use OCA\Dossiq\Service\MandaatGebruikService; use OCA\Dossiq\Service\MandaatImportService; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IRequest; use OCP\IUserSession; use PHPUnit\Framework\TestCase; @@ -61,7 +62,7 @@ interface MandaatCaseObjectServiceStub { * * @return mixed */ - public function find(int|string $id, mixed $register = null, mixed $schema = null): mixed; + public function find(int|string $id, ?ObjectFindOptions $options = null): mixed; }//end interface /** diff --git a/tests/Unit/Controller/RoutingControllerContractTest.php b/tests/Unit/Controller/RoutingControllerContractTest.php index d6c99fea6c..27f0b932ed 100644 --- a/tests/Unit/Controller/RoutingControllerContractTest.php +++ b/tests/Unit/Controller/RoutingControllerContractTest.php @@ -41,6 +41,7 @@ use OCA\Dossiq\Service\Routing\CaseRouter; use OCA\Dossiq\Exception\RefusedException; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Http; use OCP\IGroupManager; use OCP\IRequest; @@ -69,7 +70,7 @@ interface RoutingControllerContractObjectService { * * @return mixed The object. */ - public function find(int|string $id, string $register = '', string $schema = ''): mixed; + public function find(int|string $id, ?ObjectFindOptions $options = null): mixed; }//end interface /** @@ -244,7 +245,7 @@ public function testRerouteReportsNoAffectedStepsForACaseWithoutAWorkflowTemplat $objectService = $this->createMock(RoutingControllerContractObjectService::class); $objectService->expects($this->once()) ->method('find') - ->with('zaak-1', 'dossiq', 'zaak') + ->with('zaak-1', $this->callback(static fn (ObjectFindOptions $options): bool => $options->register === 'dossiq' && $options->schema === 'zaak')) ->willReturn(['id' => 'zaak-1', 'workflowTemplate' => '']); $this->settingsService->method('getObjectService')->willReturn($objectService); diff --git a/tests/Unit/Controller/WOOAssessmentControllerAuthorizationTest.php b/tests/Unit/Controller/WOOAssessmentControllerAuthorizationTest.php index 2dbb29ca78..115f369728 100644 --- a/tests/Unit/Controller/WOOAssessmentControllerAuthorizationTest.php +++ b/tests/Unit/Controller/WOOAssessmentControllerAuthorizationTest.php @@ -48,6 +48,7 @@ use OCA\Dossiq\Service\WOODecisionService; use OCA\Dossiq\Service\WOODocumentAssessmentService; use OCA\Dossiq\Service\WooPublicationService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Http; use OCP\AppFramework\OCS\OCSForbiddenException; use OCP\IGroupManager; @@ -71,7 +72,7 @@ interface WooCaseObjectServiceStub { * * @return mixed */ - public function find(int|string $id, mixed $register = null, mixed $schema = null): mixed; + public function find(int|string $id, ?ObjectFindOptions $options = null): mixed; }//end interface /** @@ -303,7 +304,7 @@ public function testTheHandlerPublishesAsTheSystem(): void { * * @return array */ - public function find(int|string $id, mixed $register = null, mixed $schema = null): array { + public function find(int|string $id, ?ObjectFindOptions $options = null): array { return ['id' => 'case-1', 'assignee' => 'alice']; } diff --git a/tests/Unit/Fixtures/FakeTermijnStore.php b/tests/Unit/Fixtures/FakeTermijnStore.php index 727887446f..356d4dca65 100644 --- a/tests/Unit/Fixtures/FakeTermijnStore.php +++ b/tests/Unit/Fixtures/FakeTermijnStore.php @@ -30,6 +30,7 @@ namespace OCA\Dossiq\Tests\Unit\Service; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Db\DoesNotExistException; // Idempotence guard. Checked against FakeStoredObject, NOT FakeTermijnStore: @@ -159,11 +160,9 @@ public function get(string $schema, string $id): ?array { */ public function find( int|string $id, - ?array $_extend = [], - bool $files = false, - string|int|null $register = null, - string|int|null $schema = null, + ?ObjectFindOptions $options = null, ): FakeStoredObject { + $schema = ($options?->schema ?? null); $id = (string)$id; $schemas = array_keys($this->store); if ($schema !== null) { diff --git a/tests/Unit/Fixtures/ReplacingObjectService.php b/tests/Unit/Fixtures/ReplacingObjectService.php index b93d70deca..9c74c22c2b 100644 --- a/tests/Unit/Fixtures/ReplacingObjectService.php +++ b/tests/Unit/Fixtures/ReplacingObjectService.php @@ -13,6 +13,7 @@ namespace OCA\Dossiq\Tests\Unit\Fixtures; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Db\DoesNotExistException; use RuntimeException; @@ -74,7 +75,7 @@ public static function forShippedSchema(string $slug): static { * * @throws DoesNotExistException When nothing is stored under the id. */ - public function find(string $id, string|int|null $register = null, string|int|null $schema = null): object { + public function find(string $id, ?ObjectFindOptions $options = null): object { if (isset($this->stored[$id]) === false) { throw new DoesNotExistException('not found: ' . $id); } diff --git a/tests/Unit/Flow/DossiqEnsureCommitteeNodeTest.php b/tests/Unit/Flow/DossiqEnsureCommitteeNodeTest.php index 1fb738d412..36453b0adb 100644 --- a/tests/Unit/Flow/DossiqEnsureCommitteeNodeTest.php +++ b/tests/Unit/Flow/DossiqEnsureCommitteeNodeTest.php @@ -19,6 +19,7 @@ use OCA\Dossiq\Flow\DossiqEnsureCommitteeNode; use OCA\Dossiq\Service\Bezwaar\CommitteeDelegationService; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IL10N; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -103,7 +104,7 @@ public function __construct( * * @return array|null The row. */ - public function find(string $id, string $register = '', string $schema = ''): mixed { + public function find(string $id, ?ObjectFindOptions $options = null): mixed { if ($this->readThrows === true) { throw new RuntimeException('register unavailable'); } diff --git a/tests/Unit/Listener/CaseCompletedSatisfactionListenerTest.php b/tests/Unit/Listener/CaseCompletedSatisfactionListenerTest.php index dd4b0fe05c..feb1682cc6 100644 --- a/tests/Unit/Listener/CaseCompletedSatisfactionListenerTest.php +++ b/tests/Unit/Listener/CaseCompletedSatisfactionListenerTest.php @@ -29,6 +29,7 @@ use OCA\Dossiq\Service\Transitions\CaseTypeReader; use OCA\OpenRegister\Db\ObjectEntity; use OCA\OpenRegister\Event\ObjectUpdatedEvent; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Container\ContainerInterface; use Psr\Log\LoggerInterface; @@ -113,7 +114,7 @@ static function (string $id) use ($pipelinq, $survey): object { * * @return array The row. */ - public function find(string $id, string $register, string $schema): array { + public function find(string $id, ?ObjectFindOptions $options = null): array { return match ($id) { 'st-afgehandeld' => ['id' => $id, 'name' => 'Afgehandeld', 'isFinal' => true], 'st-in-behandeling' => ['id' => $id, 'name' => 'In behandeling', 'isFinal' => false], diff --git a/tests/Unit/Listener/CaseInheritedDeadlineListenerTest.php b/tests/Unit/Listener/CaseInheritedDeadlineListenerTest.php index 5c5a3637bd..ce938e5c56 100644 --- a/tests/Unit/Listener/CaseInheritedDeadlineListenerTest.php +++ b/tests/Unit/Listener/CaseInheritedDeadlineListenerTest.php @@ -31,6 +31,7 @@ use OCA\OpenRegister\Db\ObjectEntity; use OCA\OpenRegister\Event\ObjectCreatingEvent; use OCA\OpenRegister\Event\ObjectUpdatingEvent; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Bootstrap\IRegistrationContext; use OCP\EventDispatcher\Event; use PHPUnit\Framework\TestCase; @@ -95,7 +96,7 @@ public function __construct(private array $stored) { * * @return array The row, or an empty array. */ - public function find(string $id, string $register, string $schema): array { + public function find(string $id, ?ObjectFindOptions $options = null): array { return ($this->stored[$id] ?? []); } }; diff --git a/tests/Unit/Listener/CaseTypeParentCycleListenerTest.php b/tests/Unit/Listener/CaseTypeParentCycleListenerTest.php index f65697ce91..faad847933 100644 --- a/tests/Unit/Listener/CaseTypeParentCycleListenerTest.php +++ b/tests/Unit/Listener/CaseTypeParentCycleListenerTest.php @@ -26,6 +26,7 @@ use OCA\OpenRegister\Db\ObjectEntity; use OCA\OpenRegister\Event\ObjectCreatingEvent; use OCA\OpenRegister\Event\ObjectUpdatingEvent; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\EventDispatcher\Event; use OCP\IL10N; use PHPUnit\Framework\TestCase; @@ -74,7 +75,7 @@ public function __construct(private array $stored) { * * @return array The row, or an empty array. */ - public function find(string $id, string $register, string $schema): array { + public function find(string $id, ?ObjectFindOptions $options = null): array { return ($this->stored[$id] ?? []); } }; diff --git a/tests/Unit/Listener/CaseTypePortalWithdrawalListenerTest.php b/tests/Unit/Listener/CaseTypePortalWithdrawalListenerTest.php index dc709b0884..0f0a8885c6 100644 --- a/tests/Unit/Listener/CaseTypePortalWithdrawalListenerTest.php +++ b/tests/Unit/Listener/CaseTypePortalWithdrawalListenerTest.php @@ -29,6 +29,7 @@ use OCA\OpenRegister\Db\ObjectEntity; use OCA\OpenRegister\Event\ObjectCreatingEvent; use OCA\OpenRegister\Event\ObjectUpdatingEvent; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IL10N; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -98,7 +99,8 @@ public function __construct(private array $rows, private array $named) { * * @return array The row. */ - public function find(string $id, string $register, string $schema): array { + public function find(string $id, ?ObjectFindOptions $options = null): array { + $schema = ($options?->schema ?? ''); if ($schema === 'workflow-template-schema-id') { if (isset($this->named[$id]) === false) { throw new \RuntimeException('not found'); diff --git a/tests/Unit/Listener/DeliberationStartGuardTest.php b/tests/Unit/Listener/DeliberationStartGuardTest.php index 7ac981bba1..b66e54fcae 100644 --- a/tests/Unit/Listener/DeliberationStartGuardTest.php +++ b/tests/Unit/Listener/DeliberationStartGuardTest.php @@ -37,6 +37,7 @@ use OCA\OpenRegister\Event\ObjectCreatingEvent; use OCA\OpenRegister\Event\ObjectUpdatingEvent; use OCA\OpenRegister\Exception\HookStoppedException; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Bootstrap\IRegistrationContext; use OCP\EventDispatcher\Event; use PHPUnit\Framework\TestCase; @@ -548,24 +549,17 @@ private function assertTheTransitionIssuesTheAdvice(string $requestId): void { */ public function find( int|string $id, - mixed $_extend = null, - bool $files = false, - int|string $register = '', - int|string $schema = '', + ?ObjectFindOptions $options = null, bool $_rbac = true, bool $_multitenancy = true, ): ?array { + $_extend = ($options?->extend ?? null); + $files = ($options?->files ?? false); + $register = ($options?->register ?? ''); + $schema = ($options?->schema ?? ''); $uuid = ['bacadvicerequest-req-1' => 'req-1'][(string) $id] ?? $id; - return parent::find( - id: $uuid, - _extend: $_extend, - files: $files, - register: $register, - schema: $schema, - _rbac: $_rbac, - _multitenancy: $_multitenancy - ); + return parent::find(id: $uuid, options: $options, _rbac: $_rbac, _multitenancy: $_multitenancy); } /** diff --git a/tests/Unit/Listener/DeliveryConcludedListenerGoldenTest.php b/tests/Unit/Listener/DeliveryConcludedListenerGoldenTest.php index 48d2781d33..642ccff2e3 100644 --- a/tests/Unit/Listener/DeliveryConcludedListenerGoldenTest.php +++ b/tests/Unit/Listener/DeliveryConcludedListenerGoldenTest.php @@ -27,6 +27,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Tests\Support\MatchesGoldenFiles; use OCA\Integriq\Event\DeliveryConcludedEvent; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; use RuntimeException; @@ -108,7 +109,9 @@ public function __construct(private mixed $case, private bool $saveThrows, priva * * @return mixed */ - public function find(string $id, mixed $register = null, mixed $schema = null): mixed { + public function find(string $id, ?ObjectFindOptions $options = null): mixed { + $register = ($options?->register ?? null); + $schema = ($options?->schema ?? null); $this->trace->append(['find', $id, $register, $schema]); if ($this->case === 'throw') { throw new RuntimeException('store down'); diff --git a/tests/Unit/Listener/DeliveryConcludedListenerTest.php b/tests/Unit/Listener/DeliveryConcludedListenerTest.php index 6dcddd017f..3a8bc1a7cf 100644 --- a/tests/Unit/Listener/DeliveryConcludedListenerTest.php +++ b/tests/Unit/Listener/DeliveryConcludedListenerTest.php @@ -28,6 +28,7 @@ use OCA\Dossiq\Service\ServiceAccount\BackgroundServiceAccount; use OCA\Dossiq\Service\SettingsService; use OCA\Integriq\Event\DeliveryConcludedEvent; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -44,7 +45,7 @@ interface DeliveryObjectServiceStub { * * @return mixed */ - public function find(string $id, string $register, string $schema): mixed; + public function find(string $id, ?ObjectFindOptions $options = null): mixed; /** * Save or update an object. diff --git a/tests/Unit/Listener/DerivedStatusTimelineListenerTest.php b/tests/Unit/Listener/DerivedStatusTimelineListenerTest.php index b00b550ecd..135650f716 100644 --- a/tests/Unit/Listener/DerivedStatusTimelineListenerTest.php +++ b/tests/Unit/Listener/DerivedStatusTimelineListenerTest.php @@ -39,6 +39,7 @@ use OCA\Dossiq\Service\Transitions\StatusTypeLookup; use OCA\OpenRegister\Db\ObjectEntity; use OCA\OpenRegister\Event\ObjectUpdatedEvent; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Log\NullLogger; @@ -129,7 +130,7 @@ function ( * * @return array The row. */ - public function find(string $id, mixed $register = null, mixed $schema = null): array { + public function find(string $id, ?ObjectFindOptions $options = null): array { return ([ 'st-open' => ['id' => 'st-open', 'name' => 'In behandeling'], 'st-compleet' => ['id' => 'st-compleet', 'name' => 'Compleet'], diff --git a/tests/Unit/Listener/IntakeMessageRoutedListenerTest.php b/tests/Unit/Listener/IntakeMessageRoutedListenerTest.php index d140bd811a..d04c55207d 100644 --- a/tests/Unit/Listener/IntakeMessageRoutedListenerTest.php +++ b/tests/Unit/Listener/IntakeMessageRoutedListenerTest.php @@ -34,6 +34,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Timeline\CaseTimeline; use OCA\Integriq\Event\IntakeMessageRoutedEvent; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Utility\ITimeFactory; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -56,7 +57,7 @@ interface ChannelIntakeObjectServiceStub { * * @return mixed The object. */ - public function find(string $id, string $register, string $schema): mixed; + public function find(string $id, ?ObjectFindOptions $options = null): mixed; /** * Save or update an object. @@ -189,7 +190,8 @@ function (array $object, string $register, string $schema, ?string $uuid = null) ); $service->method('find')->willReturnCallback( - function (string $id, string $register, string $schema): array { + function (string $id, ?ObjectFindOptions $options = null): array { + $schema = ($options?->schema ?? ''); if ($schema === 'caseType' && $this->caseTypeExists === true) { return ['id' => $id, 'initialStatus' => 'status-ontvangen']; } diff --git a/tests/Unit/Listener/StufProviderQueryListenerTest.php b/tests/Unit/Listener/StufProviderQueryListenerTest.php index e738026cf8..a74e773644 100644 --- a/tests/Unit/Listener/StufProviderQueryListenerTest.php +++ b/tests/Unit/Listener/StufProviderQueryListenerTest.php @@ -33,6 +33,7 @@ use OCA\Integriq\Event\StufCaseQueryEvent; use OCA\Integriq\Event\StufDocumentMutationEvent; use OCA\Integriq\Event\StufPersonQueryEvent; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; use RuntimeException; @@ -291,7 +292,8 @@ public function findAll(array $config=[], bool $_rbac=true, bool $_multitenancy= * * @return array|null The case type. */ - public function find(string $id, ?string $register=null, ?string $schema=null): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { + $schema = ($options?->schema ?? null); if ($schema === 'caseType' && $id === 'ct-uuid-1') { return (['id' => 'ct-uuid-1'] + StufProviderQueryListenerTest::CASE_TYPE); } diff --git a/tests/Unit/Portal/ApplicantPortalActsTest.php b/tests/Unit/Portal/ApplicantPortalActsTest.php index d7c16818db..8aa7dc1ff1 100644 --- a/tests/Unit/Portal/ApplicantPortalActsTest.php +++ b/tests/Unit/Portal/ApplicantPortalActsTest.php @@ -34,6 +34,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Timeline\CaseTimeline; use OCA\Dossiq\Service\Timeline\TimelineKinds; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\Notification\IManager as INotificationManager; use OCP\Notification\INotification; use PHPUnit\Framework\MockObject\MockObject; @@ -68,7 +69,9 @@ class FakePortalCaseStore { * * @return object|null The entity, or null. */ - public function find(string $id, mixed $register = null, mixed $schema = null): ?object { + public function find(string $id, ?ObjectFindOptions $options = null): ?object { + $register = ($options?->register ?? null); + $schema = ($options?->schema ?? null); $this->askedIn = [$register, $schema]; if (isset($this->cases[$id]) === false) { diff --git a/tests/Unit/Portal/PortalCaseDocumentsTest.php b/tests/Unit/Portal/PortalCaseDocumentsTest.php index fd58781359..98e57deb39 100644 --- a/tests/Unit/Portal/PortalCaseDocumentsTest.php +++ b/tests/Unit/Portal/PortalCaseDocumentsTest.php @@ -34,6 +34,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\OpenRegister\Contract\ObjectEntityInterface; use OCA\OpenRegister\Contract\ObjectServiceInterface; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\NullLogger; @@ -131,7 +132,7 @@ protected function service(): PortalCaseDocuments { $this->assertSame('dossiq', $register); return $this->rows[$schema] ?? []; }); - $objects->method('find')->willReturnCallback(function ($id, $_extend = [], $files = false, $register = null, $schema = null, $_rbac = true, $_multitenancy = true) { + $objects->method('find')->willReturnCallback(function ($id, ?ObjectFindOptions $options = null, $_rbac = true, $_multitenancy = true) { $this->findScopes[] = [$_rbac, $_multitenancy]; if (isset($this->documents[$id]) === false) { return null; diff --git a/tests/Unit/Portal/PortalCaseStepsTest.php b/tests/Unit/Portal/PortalCaseStepsTest.php index 5b7883dc37..0f0228e028 100644 --- a/tests/Unit/Portal/PortalCaseStepsTest.php +++ b/tests/Unit/Portal/PortalCaseStepsTest.php @@ -28,6 +28,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\OpenRegister\Contract\ObjectEntityInterface; use OCA\OpenRegister\Contract\ObjectServiceInterface; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\NullLogger; @@ -57,7 +58,7 @@ class PortalCaseStepsTest extends TestCase { private function service(): PortalCaseSteps { $objects = $this->createMock(ObjectServiceInterface::class); $objects->method('runAsSystem')->willReturnCallback(static fn (callable $operation) => $operation()); - $objects->method('find')->willReturnCallback(function ($id, $_extend = [], $files = false, $register = null, $schema = null, $_rbac = true, $_multitenancy = true) { + $objects->method('find')->willReturnCallback(function ($id, ?ObjectFindOptions $options = null, $_rbac = true, $_multitenancy = true) { $this->findScopes[] = [$_rbac, $_multitenancy]; if ($id !== self::CASE_ID || $_rbac !== false || $_multitenancy !== false) { return null; diff --git a/tests/Unit/Repair/MigrateTenantsToOrganisationsTest.php b/tests/Unit/Repair/MigrateTenantsToOrganisationsTest.php index d1aafdf173..42e5aa1396 100644 --- a/tests/Unit/Repair/MigrateTenantsToOrganisationsTest.php +++ b/tests/Unit/Repair/MigrateTenantsToOrganisationsTest.php @@ -34,6 +34,7 @@ use OCA\Dossiq\Tests\Support\EntityAnsweringRegister; use OCA\Dossiq\Tests\Support\MakesTenantMigration; use OCA\Dossiq\Tests\Support\RefusableRegister; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\App\IAppManager; use OCP\IGroupManager; use Psr\Container\ContainerInterface; @@ -108,8 +109,10 @@ public function findAll(array $config = [], bool $_rbac = true, bool $_multitena return $this->store->findAll(config: $config); } - public function find(int|string $id, mixed $_extend = null, bool $files = false, int|string $register = '', int|string $schema = '', bool $_rbac = true, bool $_multitenancy = true): object { - return $this->entities->find(id: $id, register: $register, schema: $schema); + public function find(int|string $id, ?ObjectFindOptions $options = null, bool $_rbac = true, bool $_multitenancy = true): object { + $register = ($options?->register ?? ''); + $schema = ($options?->schema ?? ''); + return $this->entities->find(id: $id, options: new ObjectFindOptions(register: $register, schema: $schema)); } public function saveObject(array $object, int|string $register = '', int|string $schema = '', ?string $uuid = null, bool $_rbac = true, bool $_multitenancy = true): array { diff --git a/tests/Unit/Repair/RebindCasesOffTheBasisFlowGoldenTest.php b/tests/Unit/Repair/RebindCasesOffTheBasisFlowGoldenTest.php index 8bca78f8a6..b8131e6237 100644 --- a/tests/Unit/Repair/RebindCasesOffTheBasisFlowGoldenTest.php +++ b/tests/Unit/Repair/RebindCasesOffTheBasisFlowGoldenTest.php @@ -26,6 +26,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Workflow\BackfilledTemplateLabels; use OCA\Dossiq\Tests\Support\MatchesGoldenFiles; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\Migration\IOutput; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -234,7 +235,9 @@ public function searchObjectsBySlug(string $register, string $schema, array $fil * * @return array|null The row. */ - public function find(string $id, ?array $extend = null, bool $files = false, ?string $register = null, ?string $schema = null): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { + $register = ($options?->register ?? null); + $schema = ($options?->schema ?? null); $this->test->log[] = ['find' => ['id' => $id, 'register' => $register, 'schema' => $schema]]; if (in_array('find:' . $id, $this->fails, true) === true) { throw new RuntimeException('find ' . $id . ' failed'); diff --git a/tests/Unit/Repair/RebindCasesOffTheBasisFlowTest.php b/tests/Unit/Repair/RebindCasesOffTheBasisFlowTest.php index dbf51325ae..23c2763aec 100644 --- a/tests/Unit/Repair/RebindCasesOffTheBasisFlowTest.php +++ b/tests/Unit/Repair/RebindCasesOffTheBasisFlowTest.php @@ -19,6 +19,7 @@ use OCA\Dossiq\Repair\RebindCasesOffTheBasisFlow; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Workflow\BackfilledTemplateLabels; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\Migration\IOutput; use PHPUnit\Framework\TestCase; use Psr\Log\NullLogger; @@ -120,7 +121,8 @@ public function searchObjectsBySlug(string $register, string $schema, array $fil * * @return array|null The row. */ - public function find(string $id, ?array $extend = null, bool $files = false, ?string $register = null, ?string $schema = null): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { + $schema = ($options?->schema ?? null); return ($this->test->rows[(string)$schema][$id] ?? null); } diff --git a/tests/Unit/Repair/RewriteWooPublicationSummariesTest.php b/tests/Unit/Repair/RewriteWooPublicationSummariesTest.php index 4455491d66..f968bbb0a3 100644 --- a/tests/Unit/Repair/RewriteWooPublicationSummariesTest.php +++ b/tests/Unit/Repair/RewriteWooPublicationSummariesTest.php @@ -22,6 +22,7 @@ use OCA\Dossiq\Repair\RewriteWooPublicationSummaries; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Db\DoesNotExistException; use OCP\Migration\IOutput; use PHPUnit\Framework\TestCase; @@ -121,7 +122,8 @@ private function page(string $schema, array $query): array { * * @throws DoesNotExistException When the row is not there. */ - public function find(string $id, int|string $register, int|string $schema): array { + public function find(string $id, ?ObjectFindOptions $options = null): array { + $schema = ($options?->schema ?? ''); if (isset($this->rows[(string)$schema][$id]) === false) { throw new DoesNotExistException('gone'); } diff --git a/tests/Unit/Service/Access/ObjectReadGrantsTest.php b/tests/Unit/Service/Access/ObjectReadGrantsTest.php index da816fe1aa..520422d583 100644 --- a/tests/Unit/Service/Access/ObjectReadGrantsTest.php +++ b/tests/Unit/Service/Access/ObjectReadGrantsTest.php @@ -30,6 +30,7 @@ use OCA\Dossiq\Service\Access\ObjectReadGrants; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Container\ContainerInterface; use Psr\Log\LoggerInterface; @@ -144,7 +145,7 @@ public function __construct(private object $record) { */ public array $reads = []; - public function find(string $id, mixed $_extend = null, bool $files = false, string $register = '', string $schema = '', bool $_rbac = true, bool $_multitenancy = true): ?object { + public function find(string $id, ?ObjectFindOptions $options = null, bool $_rbac = true, bool $_multitenancy = true): ?object { $this->reads[] = ['rbac' => $_rbac, 'multitenancy' => $_multitenancy]; if ($_rbac === true) { // The caller manages the grants and may not read the record (decision 234). diff --git a/tests/Unit/Service/AcknowledgementDutyTest.php b/tests/Unit/Service/AcknowledgementDutyTest.php index 753f23d59e..6f48293f1a 100644 --- a/tests/Unit/Service/AcknowledgementDutyTest.php +++ b/tests/Unit/Service/AcknowledgementDutyTest.php @@ -51,6 +51,7 @@ use OCA\Dossiq\Woo\WooReceivedAnswers; use OCA\Dossiq\Woo\WooRequestForm; use OCA\Dossiq\Tests\Support\MakesRealTermNoticeSender; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -80,7 +81,7 @@ class AcknowledgementCaseStore { * * @return array|null The case, or null. */ - public function find(string $id, string $register = '', string $schema = ''): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { return ($this->cases[$id] ?? null); }//end find() diff --git a/tests/Unit/Service/AcknowledgementServiceGoldenTest.php b/tests/Unit/Service/AcknowledgementServiceGoldenTest.php index 9ec276be14..844e6b0e5b 100644 --- a/tests/Unit/Service/AcknowledgementServiceGoldenTest.php +++ b/tests/Unit/Service/AcknowledgementServiceGoldenTest.php @@ -43,6 +43,7 @@ use OCA\Dossiq\Service\TermijnService; use OCA\Dossiq\Service\Timeline\CaseTimeline; use OCA\Dossiq\Tests\Support\MatchesGoldenFiles; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Db\DoesNotExistException; use PHPUnit\Framework\TestCase; use Psr\Log\AbstractLogger; @@ -138,7 +139,9 @@ public function __construct(private array $world, private AcknowledgementService * * @return mixed The stored row. */ - public function find(string $id, string $register = '', string $schema = ''): mixed { + public function find(string $id, ?ObjectFindOptions $options = null): mixed { + $register = ($options?->register ?? ''); + $schema = ($options?->schema ?? ''); $this->test->note(call: ['ObjectService::find', ['id' => $id, 'register' => $register, 'schema' => $schema]]); $found = ($this->world['find'] ?? 'missing'); if ($found === 'missing') { diff --git a/tests/Unit/Service/Activity/CaseActivityStampTest.php b/tests/Unit/Service/Activity/CaseActivityStampTest.php index 03b91e3f61..874a91ac51 100644 --- a/tests/Unit/Service/Activity/CaseActivityStampTest.php +++ b/tests/Unit/Service/Activity/CaseActivityStampTest.php @@ -27,6 +27,7 @@ use DateTimeImmutable; use OCA\Dossiq\Service\Activity\CaseActivityStamp; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Db\DoesNotExistException; use OCP\AppFramework\Utility\ITimeFactory; use PHPUnit\Framework\TestCase; @@ -96,7 +97,7 @@ public function __construct(private CaseActivityStampTest $test) { * * @return array The case. */ - public function find(string $id, mixed $register = null, mixed $schema = null): array { + public function find(string $id, ?ObjectFindOptions $options = null): array { if ($id !== 'case-1') { throw new DoesNotExistException('no such object'); } diff --git a/tests/Unit/Service/AdviceServiceAuthorizationTest.php b/tests/Unit/Service/AdviceServiceAuthorizationTest.php index a728c66cf9..d5ca4ae171 100644 --- a/tests/Unit/Service/AdviceServiceAuthorizationTest.php +++ b/tests/Unit/Service/AdviceServiceAuthorizationTest.php @@ -35,6 +35,7 @@ use OCA\Dossiq\Service\AdviceDelegationService; use OCA\Dossiq\Service\AdviceService; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IGroupManager; use OCP\IUser; use OCP\IUserSession; @@ -68,7 +69,7 @@ interface AdviceObjectServiceStub { * * @return mixed */ - public function find(int|string $id, mixed $register = null, mixed $schema = null): mixed; + public function find(int|string $id, ?ObjectFindOptions $options = null): mixed; /** * Save or update an object. diff --git a/tests/Unit/Service/AdvisoryBodyServiceTest.php b/tests/Unit/Service/AdvisoryBodyServiceTest.php index ea90dca6f3..8383817b10 100644 --- a/tests/Unit/Service/AdvisoryBodyServiceTest.php +++ b/tests/Unit/Service/AdvisoryBodyServiceTest.php @@ -26,6 +26,7 @@ use OCA\Dossiq\Service\AdvisoryBodyService; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -64,7 +65,7 @@ public function searchObjects(array $query): array; * * @return array */ - public function find(string $id, string $register, string $schema): array; + public function find(string $id, ?ObjectFindOptions $options = null): array; /** * Save or update an object. diff --git a/tests/Unit/Service/Archival/ArchivalNominationDeriverTest.php b/tests/Unit/Service/Archival/ArchivalNominationDeriverTest.php index 85556e7fbf..9c0f3cf6da 100644 --- a/tests/Unit/Service/Archival/ArchivalNominationDeriverTest.php +++ b/tests/Unit/Service/Archival/ArchivalNominationDeriverTest.php @@ -30,6 +30,7 @@ use OCA\Dossiq\Service\Archival\ArchivalBaseDateResolver; use OCA\Dossiq\Service\Archival\ArchivalNominationDeriver; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -59,7 +60,8 @@ class FakeObjectService { * * @return array|null The row, or null when absent. */ - public function find(string $id, string $register = '', string $schema = ''): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { + $schema = ($options?->schema ?? ''); return ($this->store[$schema][$id] ?? null); }//end find() diff --git a/tests/Unit/Service/Assistant/CaseAssistantServiceTest.php b/tests/Unit/Service/Assistant/CaseAssistantServiceTest.php index e67c89aec5..7c951a7bd5 100644 --- a/tests/Unit/Service/Assistant/CaseAssistantServiceTest.php +++ b/tests/Unit/Service/Assistant/CaseAssistantServiceTest.php @@ -34,6 +34,7 @@ use OCA\Dossiq\Service\Assistant\CaseAssistantService; use OCA\Dossiq\Service\Assistant\HermiqAssistantClient; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IConfig; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -67,7 +68,7 @@ public function __construct( * * @return mixed */ - public function find(string $id, string $register, string $schema): mixed { + public function find(string $id, ?ObjectFindOptions $options = null): mixed { if ($this->throws !== null) { throw $this->throws; } diff --git a/tests/Unit/Service/Beschikking/BezwaarArchiveTriggerTest.php b/tests/Unit/Service/Beschikking/BezwaarArchiveTriggerTest.php index 6b9386ff9f..3d46c63066 100644 --- a/tests/Unit/Service/Beschikking/BezwaarArchiveTriggerTest.php +++ b/tests/Unit/Service/Beschikking/BezwaarArchiveTriggerTest.php @@ -34,6 +34,7 @@ use OCA\Dossiq\Service\BeschikkingService; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Tests\Unit\Service\FakeObjectService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -121,7 +122,7 @@ public function testALapsedTermArchivesTheBeschikking(): void { $outcome = $this->trigger->process(trigger: $this->stored()); $this->assertSame(expected: BezwaarArchiveTrigger::ARCHIVED, actual: $outcome); - $this->assertFalse($this->objects->find('trig-1', 'dossiq', 'bezwaarTrigger')['archiveTriggerActive']); + $this->assertFalse($this->objects->find(id: 'trig-1', options: new ObjectFindOptions(register: 'dossiq', schema: 'bezwaarTrigger'))['archiveTriggerActive']); }//end testALapsedTermArchivesTheBeschikking() /** @@ -135,7 +136,7 @@ public function testAReceivedObjectionSkipsTheArchive(): void { $outcome = $this->trigger->process(trigger: $this->stored(fields: ['objectionReceived' => true])); $this->assertSame(expected: BezwaarArchiveTrigger::OBJECTED, actual: $outcome); - $this->assertFalse($this->objects->find('trig-1', 'dossiq', 'bezwaarTrigger')['archiveTriggerActive']); + $this->assertFalse($this->objects->find(id: 'trig-1', options: new ObjectFindOptions(register: 'dossiq', schema: 'bezwaarTrigger'))['archiveTriggerActive']); }//end testAReceivedObjectionSkipsTheArchive() /** @@ -167,7 +168,7 @@ public function testARefusedArchiveLeavesTheTriggerOn(): void { $outcome = $this->trigger->process(trigger: $this->stored()); $this->assertSame(expected: BezwaarArchiveTrigger::FAILED, actual: $outcome); - $this->assertTrue($this->objects->find('trig-1', 'dossiq', 'bezwaarTrigger')['archiveTriggerActive']); + $this->assertTrue($this->objects->find(id: 'trig-1', options: new ObjectFindOptions(register: 'dossiq', schema: 'bezwaarTrigger'))['archiveTriggerActive']); }//end testARefusedArchiveLeavesTheTriggerOn() /** diff --git a/tests/Unit/Service/BeschikkingServiceTest.php b/tests/Unit/Service/BeschikkingServiceTest.php index b378ae5d54..3d44a9d6c5 100644 --- a/tests/Unit/Service/BeschikkingServiceTest.php +++ b/tests/Unit/Service/BeschikkingServiceTest.php @@ -48,6 +48,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\StateMachineService; use OCA\Dossiq\Service\Timeline\CaseTimeline; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Container\ContainerInterface; @@ -86,7 +87,8 @@ class FakeObjectService { * * @return array|null */ - public function find(string $id, string $register = '', string $schema = ''): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { + $schema = ($options?->schema ?? ''); return ($this->store[$schema][$id] ?? null); }//end find() diff --git a/tests/Unit/Service/Bezwaar/AdvisoryCommitteeServiceGoldenTest.php b/tests/Unit/Service/Bezwaar/AdvisoryCommitteeServiceGoldenTest.php index 566ab900d2..6d3a1eaf62 100644 --- a/tests/Unit/Service/Bezwaar/AdvisoryCommitteeServiceGoldenTest.php +++ b/tests/Unit/Service/Bezwaar/AdvisoryCommitteeServiceGoldenTest.php @@ -34,6 +34,7 @@ use OCA\Dossiq\Service\Governance\GovernanceBodyReader; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Tests\Support\MatchesGoldenFiles; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; use ReflectionMethod; @@ -135,7 +136,9 @@ private function answer(string $method, array $args): mixed { return $answer; } - public function find(string $id, mixed $register = null, mixed $schema = null): mixed { + public function find(string $id, ?ObjectFindOptions $options = null): mixed { + $register = ($options?->register ?? null); + $schema = ($options?->schema ?? null); return $this->answer('find', ['id' => $id, 'register' => $register, 'schema' => $schema]); } diff --git a/tests/Unit/Service/Bezwaar/BeroepServiceGoldenTest.php b/tests/Unit/Service/Bezwaar/BeroepServiceGoldenTest.php index 9e659a4ea8..e007b014ed 100644 --- a/tests/Unit/Service/Bezwaar/BeroepServiceGoldenTest.php +++ b/tests/Unit/Service/Bezwaar/BeroepServiceGoldenTest.php @@ -31,6 +31,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\StatusTransitionService; use OCA\Dossiq\Tests\Support\MatchesGoldenFiles; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\AbstractLogger; use RuntimeException; @@ -61,7 +62,9 @@ public function __construct( * * @return array|null */ - public function find(string $id, int|string $register, int|string $schema): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { + $register = ($options?->register ?? null); + $schema = ($options?->schema ?? null); $this->log[] = ['find' => compact('id', 'register', 'schema')]; return ($this->behaviour['find'][$id] ?? null); }//end find() diff --git a/tests/Unit/Service/Bezwaar/BezwaarCreationHookTest.php b/tests/Unit/Service/Bezwaar/BezwaarCreationHookTest.php index 8c62b90af8..ae9c59a527 100644 --- a/tests/Unit/Service/Bezwaar/BezwaarCreationHookTest.php +++ b/tests/Unit/Service/Bezwaar/BezwaarCreationHookTest.php @@ -26,6 +26,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Tests\Support\LifecycleRegister; use OCA\Dossiq\Tests\Unit\Service\FakeStoredObject; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Db\DoesNotExistException; use OCP\IUserSession; use PHPUnit\Framework\TestCase; @@ -121,7 +122,7 @@ public function testLinksPrimairBesluitAndCreatesObjection(): void { * * @return FakeStoredObject */ - public function find(int|string $id, ?array $_extend = [], bool $files = false, string|int|null $register = null, string|int|null $schema = null): FakeStoredObject { + public function find(int|string $id, ?ObjectFindOptions $options = null): FakeStoredObject { if ($id === 'decision-1') { return new FakeStoredObject(['case' => 'primair-1']); } @@ -192,7 +193,7 @@ public function testTheLinkGoesThroughTheRelationService(): void { * * @return FakeStoredObject */ - public function find(int|string $id, ?array $_extend = [], bool $files = false, string|int|null $register = null, string|int|null $schema = null): FakeStoredObject { + public function find(int|string $id, ?ObjectFindOptions $options = null): FakeStoredObject { return new FakeStoredObject(['case' => 'primair-1']); } @@ -238,7 +239,7 @@ public function testCreatesObjectionWhenDecisionHasNoParentCase(): void { * * @return FakeStoredObject */ - public function find(int|string $id, ?array $_extend = [], bool $files = false, string|int|null $register = null, string|int|null $schema = null): FakeStoredObject { + public function find(int|string $id, ?ObjectFindOptions $options = null): FakeStoredObject { return new FakeStoredObject(['case' => '']); } @@ -284,7 +285,7 @@ public function testThrowsWhenDecisionNotFound(): void { * * @throws DoesNotExistException Always. */ - public function find(int|string $id, ?array $_extend = [], bool $files = false, string|int|null $register = null, string|int|null $schema = null): FakeStoredObject { + public function find(int|string $id, ?ObjectFindOptions $options = null): FakeStoredObject { throw new DoesNotExistException('Object ' . $id . ' does not exist'); } diff --git a/tests/Unit/Service/Bezwaar/GoldenHearingObjectService.php b/tests/Unit/Service/Bezwaar/GoldenHearingObjectService.php index cae48dbf36..32dc4869a4 100644 --- a/tests/Unit/Service/Bezwaar/GoldenHearingObjectService.php +++ b/tests/Unit/Service/Bezwaar/GoldenHearingObjectService.php @@ -24,6 +24,7 @@ namespace OCA\Dossiq\Tests\Unit\Service\Bezwaar; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Db\DoesNotExistException; use RuntimeException; @@ -53,7 +54,9 @@ public function __construct( * * @return mixed */ - public function find(string $id, int|string $register, int|string $schema): mixed { + public function find(string $id, ?ObjectFindOptions $options = null): mixed { + $register = ($options?->register ?? null); + $schema = ($options?->schema ?? null); $this->note(call: ['find' => compact('id', 'register', 'schema')]); $answer = ($this->behaviour['find'][$id] ?? 'missing'); if ($answer === 'missing') { diff --git a/tests/Unit/Service/Bezwaar/PanelIndependenceCheckerGoldenTest.php b/tests/Unit/Service/Bezwaar/PanelIndependenceCheckerGoldenTest.php index 8c396cd9c0..ef94355f08 100644 --- a/tests/Unit/Service/Bezwaar/PanelIndependenceCheckerGoldenTest.php +++ b/tests/Unit/Service/Bezwaar/PanelIndependenceCheckerGoldenTest.php @@ -25,6 +25,7 @@ use OCA\Dossiq\Service\Bezwaar\PanelIndependenceChecker; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Tests\Support\MatchesGoldenFiles; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Db\DoesNotExistException; use PHPUnit\Framework\TestCase; use Psr\Log\AbstractLogger; @@ -86,7 +87,9 @@ public function __construct(private array $world, private array &$calls) { * * @return mixed The object. */ - public function find(int|string $id, int|string $register = '', int|string $schema = ''): mixed { + public function find(int|string $id, ?ObjectFindOptions $options = null): mixed { + $register = ($options?->register ?? ''); + $schema = ($options?->schema ?? ''); $this->calls[] = ['find', $id, $register, $schema]; $found = ($this->world['objects'][$schema][$id] ?? 'missing'); if ($found === 'missing') { diff --git a/tests/Unit/Service/Board/CaseChangesFeedTest.php b/tests/Unit/Service/Board/CaseChangesFeedTest.php index 85dbc747e8..fcbed0ae30 100644 --- a/tests/Unit/Service/Board/CaseChangesFeedTest.php +++ b/tests/Unit/Service/Board/CaseChangesFeedTest.php @@ -22,6 +22,7 @@ use OCA\Dossiq\Controller\CaseChangesController; use OCA\Dossiq\Service\Board\CaseChangesFeed; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Http; use OCP\IL10N; use OCP\IRequest; @@ -193,7 +194,7 @@ public function __construct(private array $cases) { * @param int|string $schema The schema. * @return array */ - public function find(string $id, int|string $register, int|string $schema): array { + public function find(string $id, ?ObjectFindOptions $options = null): array { if (isset($this->cases[$id]) === false) { throw new \OCP\AppFramework\Db\DoesNotExistException(msg: 'not found for this reader'); } diff --git a/tests/Unit/Service/CaseAccessGuardInheritanceTest.php b/tests/Unit/Service/CaseAccessGuardInheritanceTest.php index e8b05e1575..0538da7aaf 100644 --- a/tests/Unit/Service/CaseAccessGuardInheritanceTest.php +++ b/tests/Unit/Service/CaseAccessGuardInheritanceTest.php @@ -49,6 +49,7 @@ use OCA\Dossiq\Service\CaseAccessGuard; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IGroupManager; use OCP\IUser; use PHPUnit\Framework\TestCase; @@ -133,7 +134,7 @@ public function __construct( * * @return array|null The object, or null when absent. */ - public function find(string $id, mixed $register = null, mixed $schema = null): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { return ($this->cases[$id] ?? null); } }; @@ -376,7 +377,7 @@ public function testAResolverWithoutTheMethodDenies(): void { * * @return array The object. */ - public function find(string $id, mixed $register = null, mixed $schema = null): array { + public function find(string $id, ?ObjectFindOptions $options = null): array { return ['id' => $id, 'assignee' => 'carol']; } } @@ -412,7 +413,7 @@ public function testAThrowingResolverDenies(): void { * * @return array|null The object. */ - public function find(string $id, mixed $register = null, mixed $schema = null): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { return null; } } diff --git a/tests/Unit/Service/CaseAccessGuardReadAccessTest.php b/tests/Unit/Service/CaseAccessGuardReadAccessTest.php index 9a8b184d9a..e270ad1761 100644 --- a/tests/Unit/Service/CaseAccessGuardReadAccessTest.php +++ b/tests/Unit/Service/CaseAccessGuardReadAccessTest.php @@ -31,6 +31,7 @@ use OCA\Dossiq\Service\CaseAccessGuard; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IGroupManager; use OCP\IUser; use PHPUnit\Framework\TestCase; @@ -108,7 +109,7 @@ public function __construct( * * @return array|null The object. */ - public function find(string $id, mixed $register = null, mixed $schema = null): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { return $this->case; } }; @@ -239,7 +240,7 @@ public function testThrowingLookupDenies(): void { * * @throws \RuntimeException Always. */ - public function find(string $id, mixed $register = null, mixed $schema = null): array { + public function find(string $id, ?ObjectFindOptions $options = null): array { throw new \RuntimeException('backend down'); } }; @@ -318,7 +319,8 @@ public function __construct( * @param mixed $schema The schema. * @return array|null The object. */ - public function find(string $id, mixed $register = null, mixed $schema = null): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { + $schema = ($options?->schema ?? null); if ($schema === 'case') { return ['id' => $id, 'assignee' => null, 'assignedGroup' => 'elsewhere', 'caseType' => 'type-1']; } diff --git a/tests/Unit/Service/CaseAccessPurposeServiceTest.php b/tests/Unit/Service/CaseAccessPurposeServiceTest.php index a5a0e46a2c..a3cbeae11d 100644 --- a/tests/Unit/Service/CaseAccessPurposeServiceTest.php +++ b/tests/Unit/Service/CaseAccessPurposeServiceTest.php @@ -30,6 +30,7 @@ use OCA\Dossiq\Service\CaseAccessPurposeService; use OCA\Dossiq\Service\People\CaseRoleHolder; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\NullLogger; use RuntimeException; @@ -90,7 +91,7 @@ public function __construct(private array $objects) { * * @return object The entity. */ - public function find(string $id, string $register, string $schema): object { + public function find(string $id, ?ObjectFindOptions $options = null): object { if (isset($this->objects[$id]) === false) { throw new RuntimeException('Object not found'); } diff --git a/tests/Unit/Service/CaseAssignmentServiceTest.php b/tests/Unit/Service/CaseAssignmentServiceTest.php index 431dfe9f69..eb57c3bdf3 100644 --- a/tests/Unit/Service/CaseAssignmentServiceTest.php +++ b/tests/Unit/Service/CaseAssignmentServiceTest.php @@ -24,6 +24,7 @@ use OCA\Dossiq\Service\CaseAssignmentService; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\Notification\IManager; use OCP\Notification\INotification; use PHPUnit\Framework\TestCase; @@ -58,7 +59,7 @@ protected function setUp(): void { /** @var array> */ public array $patches = []; - public function find(string $id, mixed $register = null, mixed $schema = null): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { return ($this->cases[$id] ?? null); } diff --git a/tests/Unit/Service/CaseCopyServiceTest.php b/tests/Unit/Service/CaseCopyServiceTest.php index ae7d407699..3c88c6b11b 100644 --- a/tests/Unit/Service/CaseCopyServiceTest.php +++ b/tests/Unit/Service/CaseCopyServiceTest.php @@ -30,6 +30,7 @@ use OCA\Dossiq\Service\CaseCopyService; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; use RuntimeException; @@ -140,7 +141,7 @@ public function __construct( * * @return array|null The object. */ - public function find(string $id, $register = null, $schema = null): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { return ($this->store[$id] ?? null); }//end find() diff --git a/tests/Unit/Service/CaseDefinition/PackageWriterGoldenTest.php b/tests/Unit/Service/CaseDefinition/PackageWriterGoldenTest.php index b50abcd5a9..b0ff936934 100644 --- a/tests/Unit/Service/CaseDefinition/PackageWriterGoldenTest.php +++ b/tests/Unit/Service/CaseDefinition/PackageWriterGoldenTest.php @@ -31,6 +31,7 @@ use OCA\Dossiq\Service\CaseDefinition\PackageWriter; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Tests\Support\MatchesGoldenFiles; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\AbstractLogger; use RuntimeException; @@ -118,13 +119,12 @@ public function __construct( */ public function find( int|string $id, - mixed $_extend = null, - bool $files = false, - int|string $register = '', - int|string $schema = '', + ?ObjectFindOptions $options = null, bool $_rbac = true, bool $_multitenancy = true, ): ?array { + $register = ($options?->register ?? null); + $schema = ($options?->schema ?? ''); $this->log[] = ['find' => compact('id', 'register', 'schema', '_rbac', '_multitenancy')]; if (in_array((string)$id, ($this->behaviour['findThrows'] ?? []), true) === true) { throw new RuntimeException('find failed for ' . $id); diff --git a/tests/Unit/Service/CaseEmailMatchServiceTest.php b/tests/Unit/Service/CaseEmailMatchServiceTest.php index 70049661eb..2769619e16 100644 --- a/tests/Unit/Service/CaseEmailMatchServiceTest.php +++ b/tests/Unit/Service/CaseEmailMatchServiceTest.php @@ -44,6 +44,7 @@ use OCA\Dossiq\Service\Email\MailMessageSource; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\TermijnService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCA\OpenRegister\Service\EmailMessageRef; use OCA\OpenRegister\Service\LinkTarget; use OCP\Config\IUserConfig; @@ -349,10 +350,7 @@ public function searchObjectsBySlug(string $register, string $schema, array $fil */ public function find( int|string $id, - ?array $_extend = null, - bool $files = false, - int|string|null $register = null, - int|string|null $schema = null, + ?ObjectFindOptions $options = null, ): array { return ($this->merged[(string)$id] ?? ['id' => (string)$id]); } diff --git a/tests/Unit/Service/CaseFieldWriterTest.php b/tests/Unit/Service/CaseFieldWriterTest.php index bb6ebd679c..c0a77af90c 100644 --- a/tests/Unit/Service/CaseFieldWriterTest.php +++ b/tests/Unit/Service/CaseFieldWriterTest.php @@ -20,6 +20,7 @@ namespace OCA\Dossiq\Tests\Unit\Service; use OCA\Dossiq\Service\CaseFieldWriter; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use RuntimeException; @@ -88,7 +89,7 @@ public function testFallsBackToReadThenSaveOnAnOlderObjectService(): void { 'besluitDocument' => 'Besluit op de aanvraag', ]; - public function find(int|string $id, ?array $_extend = [], bool $files = false, ?string $register = null, ?string $schema = null): array { + public function find(int|string $id, ?ObjectFindOptions $options = null): array { return $this->stored; } @@ -216,7 +217,7 @@ public function saveObject(array $object, string $register, string $schema): arr */ public function testAnUnreadableStoredCaseIsRefusedOnTheFallback(): void { $objectService = new class { - public function find(int|string $id, ?array $_extend = [], bool $files = false, ?string $register = null, ?string $schema = null): ?array { + public function find(int|string $id, ?ObjectFindOptions $options = null): ?array { return null; } diff --git a/tests/Unit/Service/CaseMergeServiceTest.php b/tests/Unit/Service/CaseMergeServiceTest.php index 91624661aa..728fc26434 100644 --- a/tests/Unit/Service/CaseMergeServiceTest.php +++ b/tests/Unit/Service/CaseMergeServiceTest.php @@ -26,6 +26,7 @@ use OCA\Dossiq\Service\Cases\CaseMergeStore; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\TermijnService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Log\NullLogger; @@ -340,11 +341,9 @@ public function read(string $schema, string $uuid): array { */ public function find( int|string $id, - ?array $_extend = null, - bool $files = false, - int|string|null $register = null, - int|string|null $schema = null, + ?ObjectFindOptions $options = null, ): ?array { + $schema = ($options?->schema ?? null); return ($this->rows[(string)$schema][(string)$id] ?? null); }//end find() diff --git a/tests/Unit/Service/CasePlanDrain/CasePlanMigrationServiceTest.php b/tests/Unit/Service/CasePlanDrain/CasePlanMigrationServiceTest.php index fc7957d892..3b8e586105 100644 --- a/tests/Unit/Service/CasePlanDrain/CasePlanMigrationServiceTest.php +++ b/tests/Unit/Service/CasePlanDrain/CasePlanMigrationServiceTest.php @@ -33,6 +33,7 @@ use OCA\Dossiq\Service\CasePlanDrain\CasePlanMigrationService; use OCA\Dossiq\Service\CasePlanProjectionService; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; use UnexpectedValueException; @@ -348,7 +349,9 @@ public function searchObjects(array $query, bool $_rbac = true, bool $_multitena * * @return array|null The case. */ - public function find(string $id, int|string $register, int|string $schema): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { + $register = ($options?->register ?? ''); + $schema = ($options?->schema ?? ''); unset($register, $schema); return ($this->cases[$id] ?? null); diff --git a/tests/Unit/Service/CaseRebindServiceGoldenTest.php b/tests/Unit/Service/CaseRebindServiceGoldenTest.php index fd6e6fb2ea..387549b46d 100644 --- a/tests/Unit/Service/CaseRebindServiceGoldenTest.php +++ b/tests/Unit/Service/CaseRebindServiceGoldenTest.php @@ -39,6 +39,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Support\TranslatedText; use OCA\Dossiq\Tests\Support\MatchesGoldenFiles; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\AbstractLogger; use ReflectionMethod; @@ -70,7 +71,9 @@ public function __construct( * * @return mixed */ - public function find(string $id, int|string $register = '', int|string $schema = ''): mixed { + public function find(string $id, ?ObjectFindOptions $options = null): mixed { + $register = ($options?->register ?? null); + $schema = ($options?->schema ?? null); $this->log[] = ['objects.find' => compact('id', 'register', 'schema')]; if (($this->behaviour['findThrows'] ?? false) === true) { throw new RuntimeException('find failed'); diff --git a/tests/Unit/Service/CaseRebindServiceTest.php b/tests/Unit/Service/CaseRebindServiceTest.php index 9c1a5d9013..b19a36a1d9 100644 --- a/tests/Unit/Service/CaseRebindServiceTest.php +++ b/tests/Unit/Service/CaseRebindServiceTest.php @@ -40,6 +40,7 @@ use OCA\Dossiq\Service\Support\TranslatedText; use OCA\Dossiq\Service\Termijn\TermRearm; use OCA\Dossiq\Tests\Unit\Service\Cases\BuildsRebindConverter; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IGroupManager; use OCP\IL10N; use PHPUnit\Framework\TestCase; @@ -321,7 +322,8 @@ public function __construct( * * @return array|null The row. */ - public function find(string $id, $register = null, $schema = null): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { + $schema = ($options?->schema ?? null); $entry = ($this->store[$id] ?? null); if ($entry === null || ($schema !== null && $entry['__schema'] !== $schema)) { return null; diff --git a/tests/Unit/Service/CaseRelationServiceGoldenTest.php b/tests/Unit/Service/CaseRelationServiceGoldenTest.php index b508b204b8..b030bdbe57 100644 --- a/tests/Unit/Service/CaseRelationServiceGoldenTest.php +++ b/tests/Unit/Service/CaseRelationServiceGoldenTest.php @@ -33,6 +33,7 @@ use OCA\Dossiq\Service\Relation\CaseRelationStore; use OCA\Dossiq\Service\Relation\SubjectLinkRule; use OCA\Dossiq\Service\Notice\CaseActNotices; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IL10N; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Tests\Support\MatchesGoldenFiles; @@ -110,7 +111,9 @@ public function setSchema($schema): void { * * @return array|null The case. */ - public function find(string $id, $register = null, $schema = null): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { + $register = ($options?->register ?? null); + $schema = ($options?->schema ?? null); $this->calls[] = ['find', $id, $register, $schema]; if (in_array($id, ($this->knobs['findThrows'] ?? []), true) === true) { throw new RuntimeException('find failed on ' . $id); diff --git a/tests/Unit/Service/CaseRelationServiceTest.php b/tests/Unit/Service/CaseRelationServiceTest.php index 51aa27eb86..e49c954cba 100644 --- a/tests/Unit/Service/CaseRelationServiceTest.php +++ b/tests/Unit/Service/CaseRelationServiceTest.php @@ -34,6 +34,7 @@ use OCA\Dossiq\Service\Relation\CaseRelationStore; use OCA\Dossiq\Service\Relation\SubjectLinkRule; use OCA\Dossiq\Service\Notice\CaseActNotices; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IL10N; use OCA\Dossiq\Service\SettingsService; use PHPUnit\Framework\TestCase; @@ -133,7 +134,7 @@ public function setSchema($schema): void { * * @return array|null */ - public function find(string $id, $register = null, $schema = null): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { return ($this->store[$id] ?? null); }//end find() diff --git a/tests/Unit/Service/CaseType/CaseVersionMoveTest.php b/tests/Unit/Service/CaseType/CaseVersionMoveTest.php index ba95d95084..64060eb861 100644 --- a/tests/Unit/Service/CaseType/CaseVersionMoveTest.php +++ b/tests/Unit/Service/CaseType/CaseVersionMoveTest.php @@ -39,6 +39,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Support\TranslatedText; use OCA\Dossiq\Tests\Unit\Service\Cases\BuildsRebindConverter; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IL10N; use PHPUnit\Framework\TestCase; use Psr\Log\NullLogger; @@ -203,7 +204,8 @@ public function __construct( * * @return array|null The row. */ - public function find(string $id, $register = null, $schema = null): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { + $schema = ($options?->schema ?? null); $entry = ($this->store[$id] ?? null); if ($entry === null || ($schema !== null && $entry['__schema'] !== $schema)) { return null; diff --git a/tests/Unit/Service/CaseTypeCopyServiceGoldenTest.php b/tests/Unit/Service/CaseTypeCopyServiceGoldenTest.php index c14005be6c..e3e4c3a8e1 100644 --- a/tests/Unit/Service/CaseTypeCopyServiceGoldenTest.php +++ b/tests/Unit/Service/CaseTypeCopyServiceGoldenTest.php @@ -34,6 +34,7 @@ use OCA\Dossiq\Service\CaseTypeCopyService; use OCA\Dossiq\Service\CaseTypeStore; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\AbstractLogger; @@ -222,7 +223,9 @@ public function __construct( * * @return array|null */ - public function find(string $id, $register = null, $schema = null): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { + $register = ($options?->register ?? null); + $schema = ($options?->schema ?? null); $this->calls[] = ['find' => ['id' => $id, 'register' => $register, 'schema' => $schema]]; if (($this->behaviour['findThrows'] ?? false) === true) { throw new \RuntimeException('find failed'); diff --git a/tests/Unit/Service/CaseTypeCopyServiceTest.php b/tests/Unit/Service/CaseTypeCopyServiceTest.php index 595809d1c6..515705bd6e 100644 --- a/tests/Unit/Service/CaseTypeCopyServiceTest.php +++ b/tests/Unit/Service/CaseTypeCopyServiceTest.php @@ -34,6 +34,7 @@ use OCA\Dossiq\Service\CaseTypeCopyService; use OCA\Dossiq\Service\CaseTypeStore; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -120,7 +121,8 @@ public function __construct( * * @return array|null */ - public function find(string $id, $register = null, $schema = null): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { + $schema = ($options?->schema ?? null); $entry = ($this->store[$id] ?? null); if ($entry === null) { return null; @@ -574,7 +576,7 @@ public function __construct( * * @return array|null */ - public function find(string $id, $register = null, $schema = null): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { $entry = ($this->store[$id] ?? null); if ($entry === null) { return null; @@ -637,7 +639,7 @@ public function __construct( * * @return array|null */ - public function find(string $id, $register = null, $schema = null): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { $entry = ($this->store[$id] ?? null); if ($entry === null) { return null; diff --git a/tests/Unit/Service/CaseTypePublishServiceTest.php b/tests/Unit/Service/CaseTypePublishServiceTest.php index 373b7e9eef..2c11ace633 100644 --- a/tests/Unit/Service/CaseTypePublishServiceTest.php +++ b/tests/Unit/Service/CaseTypePublishServiceTest.php @@ -46,6 +46,7 @@ use OCA\Dossiq\Service\Status\StatusFieldRuleDeclaration; use OCA\Dossiq\Service\UnreadTriggerService; use OCA\Dossiq\Tests\Unit\Service\Transitions\SourceL10n; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Utility\ITimeFactory; use OCA\Dossiq\Service\Email\SenderIdentity; use PHPUnit\Framework\TestCase; @@ -141,7 +142,7 @@ public function __construct( * * @return array The row. */ - public function find(string $id, string $register, string $schema): array { + public function find(string $id, ?ObjectFindOptions $options = null): array { return ($this->caseTypes[$id] ?? []); } diff --git a/tests/Unit/Service/CaseTypeResolverTest.php b/tests/Unit/Service/CaseTypeResolverTest.php index 7d8053bfea..90dc50daaf 100644 --- a/tests/Unit/Service/CaseTypeResolverTest.php +++ b/tests/Unit/Service/CaseTypeResolverTest.php @@ -30,6 +30,7 @@ use OCA\Dossiq\Service\CaseTypeResolver; use OCA\Dossiq\Service\CaseTypeStore; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use RuntimeException; @@ -67,7 +68,7 @@ public function __construct( * * @return array The row. */ - public function find(string $id, string $register, string $schema): array { + public function find(string $id, ?ObjectFindOptions $options = null): array { if ($this->throws === true) { throw new RuntimeException('unreadable'); } diff --git a/tests/Unit/Service/Cases/CaseSplitExecutorGoldenTest.php b/tests/Unit/Service/Cases/CaseSplitExecutorGoldenTest.php index 4a493c0686..6854a1190b 100644 --- a/tests/Unit/Service/Cases/CaseSplitExecutorGoldenTest.php +++ b/tests/Unit/Service/Cases/CaseSplitExecutorGoldenTest.php @@ -38,6 +38,7 @@ use OCA\Dossiq\Service\Transitions\SideEffectDispatcher; use OCA\Dossiq\Service\Transitions\StatusTypeLookup; use OCA\Dossiq\Tests\Support\MatchesGoldenFiles; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\AbstractLogger; use RuntimeException; @@ -96,7 +97,9 @@ public function __construct(public array $rows, private array $knobs) { * * @return array|null The row. */ - public function find(int|string $id, mixed $_extend = null, bool $files = false, int|string $register = '', int|string $schema = ''): ?array { + public function find(int|string $id, ?ObjectFindOptions $options = null): ?array { + $register = ($options?->register ?? ''); + $schema = ($options?->schema ?? ''); $this->calls[] = ['find', ['id' => $id, 'register' => $register, 'schema' => $schema]]; if (in_array($schema, ($this->knobs['findThrows'] ?? []), true) === true) { throw new RuntimeException('find failed on ' . $schema); diff --git a/tests/Unit/Service/ConsultationServiceTest.php b/tests/Unit/Service/ConsultationServiceTest.php index 59e175e100..9b841df26b 100644 --- a/tests/Unit/Service/ConsultationServiceTest.php +++ b/tests/Unit/Service/ConsultationServiceTest.php @@ -33,6 +33,7 @@ use OCA\Dossiq\Service\Obligations\ObligationService; use OCA\Dossiq\Service\ConsultationService; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\MockObject\MockObject; use OCA\Dossiq\Tests\Support\MakesCaseDateNormaliser; use PHPUnit\Framework\TestCase; @@ -72,7 +73,7 @@ public function searchObjects(array $query): array; * * @return array */ - public function find(string $id, string $register, string $schema): array; + public function find(string $id, ?ObjectFindOptions $options = null): array; /** * Save or update an object. diff --git a/tests/Unit/Service/Custody/CaseTransferConsentGateGoldenTest.php b/tests/Unit/Service/Custody/CaseTransferConsentGateGoldenTest.php index 0ea1629cf2..6b041d25c6 100644 --- a/tests/Unit/Service/Custody/CaseTransferConsentGateGoldenTest.php +++ b/tests/Unit/Service/Custody/CaseTransferConsentGateGoldenTest.php @@ -27,6 +27,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Tests\Support\MatchesGoldenFiles; use OCA\Dossiq\Tests\Unit\Service\Transitions\SourceL10n; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Db\DoesNotExistException; use PHPUnit\Framework\TestCase; use Psr\Log\AbstractLogger; @@ -90,7 +91,9 @@ public function __construct(private array $world, private array &$calls) { * * @return mixed The object. */ - public function find(int|string $id, int|string $register = '', int|string $schema = ''): mixed { + public function find(int|string $id, ?ObjectFindOptions $options = null): mixed { + $register = ($options?->register ?? ''); + $schema = ($options?->schema ?? ''); $this->calls[] = ['find', $id, $register, $schema]; $found = ($this->world['objects'][$schema][$id] ?? 'missing'); if ($found === 'missing') { diff --git a/tests/Unit/Service/DecisionDocument/DecisionRecordComposerTest.php b/tests/Unit/Service/DecisionDocument/DecisionRecordComposerTest.php index 5e89ddc1a4..17f6ee6596 100644 --- a/tests/Unit/Service/DecisionDocument/DecisionRecordComposerTest.php +++ b/tests/Unit/Service/DecisionDocument/DecisionRecordComposerTest.php @@ -23,6 +23,7 @@ use OCA\Dossiq\Service\DecisionDocument\DecisionRecordComposer; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Tests\Support\InMemoryRegister; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -81,10 +82,7 @@ public function testAnUnreadableCaseCostsOnlyTheTitle(): void { $register = new class extends InMemoryRegister { public function find( int|string $id, - mixed $_extend = null, - bool $files = false, - int|string $register = '', - int|string $schema = '', + ?ObjectFindOptions $options = null, bool $_rbac = true, bool $_multitenancy = true, ): ?array { diff --git a/tests/Unit/Service/DecisionDocument/PublicationReadinessTest.php b/tests/Unit/Service/DecisionDocument/PublicationReadinessTest.php index 69b3e1e013..bc1af667c4 100644 --- a/tests/Unit/Service/DecisionDocument/PublicationReadinessTest.php +++ b/tests/Unit/Service/DecisionDocument/PublicationReadinessTest.php @@ -23,6 +23,7 @@ use OCA\Dossiq\Service\DecisionDocument\PublicationReadiness; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Tests\Support\InMemoryRegister; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -81,10 +82,7 @@ public function testACaseThatCannotBeMarkedIsLogged(): void { $register = new class extends InMemoryRegister { public function find( int|string $id, - mixed $_extend = null, - bool $files = false, - int|string $register = '', - int|string $schema = '', + ?ObjectFindOptions $options = null, bool $_rbac = true, bool $_multitenancy = true, ): ?array { diff --git a/tests/Unit/Service/Deelzaak/SubCaseDeriverGoldenTest.php b/tests/Unit/Service/Deelzaak/SubCaseDeriverGoldenTest.php index 5422cda946..14b1bc8dc7 100644 --- a/tests/Unit/Service/Deelzaak/SubCaseDeriverGoldenTest.php +++ b/tests/Unit/Service/Deelzaak/SubCaseDeriverGoldenTest.php @@ -33,6 +33,7 @@ use OCA\Dossiq\Service\Deelzaak\SubCaseDeriver; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Tests\Support\MatchesGoldenFiles; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Db\DoesNotExistException; use PHPUnit\Framework\TestCase; use Psr\Log\AbstractLogger; @@ -182,7 +183,9 @@ public function __construct(private SubCaseDeriverGoldenTest $test, private arra * * @return mixed The object. */ - public function find(string|int $id, mixed $register = null, mixed $schema = null): mixed { + public function find(string|int $id, ?ObjectFindOptions $options = null): mixed { + $register = ($options?->register ?? null); + $schema = ($options?->schema ?? null); $this->test->calls[] = ['find', ['id' => $id, 'register' => $register, 'schema' => $schema]]; if ($id !== 'parent-1') { throw new DoesNotExistException('Object not found'); diff --git a/tests/Unit/Service/Deelzaak/SubCaseDeriverTest.php b/tests/Unit/Service/Deelzaak/SubCaseDeriverTest.php index 713625adc9..9f15637abf 100644 --- a/tests/Unit/Service/Deelzaak/SubCaseDeriverTest.php +++ b/tests/Unit/Service/Deelzaak/SubCaseDeriverTest.php @@ -38,6 +38,7 @@ use OCA\Dossiq\Service\Deelzaak\SubCaseDeriver; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -161,7 +162,7 @@ public function __construct(private object $entity, private array &$saved) { * * @return object|null */ - public function find(string $id, $register = null, $schema = null): ?object { + public function find(string $id, ?ObjectFindOptions $options = null): ?object { return ($id === 'parent') ? $this->entity : null; }//end find() diff --git a/tests/Unit/Service/DeelzaakServiceTest.php b/tests/Unit/Service/DeelzaakServiceTest.php index a917d22998..b573aafb62 100644 --- a/tests/Unit/Service/DeelzaakServiceTest.php +++ b/tests/Unit/Service/DeelzaakServiceTest.php @@ -30,6 +30,7 @@ use OCA\Dossiq\Service\Deelzaak\SubCaseDeriver; use OCA\Dossiq\Service\DeelzaakService; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -130,7 +131,7 @@ public function __construct( * * @return object|null */ - public function find(string $id, $register = null, $schema = null): ?object { + public function find(string $id, ?ObjectFindOptions $options = null): ?object { if (isset($this->store[$id]) === false) { return null; } diff --git a/tests/Unit/Service/DossierCompilerTest.php b/tests/Unit/Service/DossierCompilerTest.php index 1c6ebe186e..0612d0f6b6 100644 --- a/tests/Unit/Service/DossierCompilerTest.php +++ b/tests/Unit/Service/DossierCompilerTest.php @@ -24,6 +24,7 @@ use OCA\Dossiq\Service\DossierCompiler; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; use RuntimeException; @@ -142,7 +143,7 @@ public function __construct( /** * Entity-shaped find, mirroring the real ObjectService contract. */ - public function find(int|string $id, ?array $_extend = [], bool $files = false, string|int|null $register = null, string|int|null $schema = null): FakeStoredObject { + public function find(int|string $id, ?ObjectFindOptions $options = null): FakeStoredObject { return new FakeStoredObject($this->case); } @@ -196,7 +197,7 @@ public function testCompileToleratesDocumentListingFailure(): void { /** * Entity-shaped find, mirroring the real ObjectService contract. */ - public function find(int|string $id, ?array $_extend = [], bool $files = false, string|int|null $register = null, string|int|null $schema = null): FakeStoredObject { + public function find(int|string $id, ?ObjectFindOptions $options = null): FakeStoredObject { return new FakeStoredObject(['relatedCases' => []]); } diff --git a/tests/Unit/Service/Dso/DsoDeadlineActsTest.php b/tests/Unit/Service/Dso/DsoDeadlineActsTest.php index 004f314465..573af728bb 100644 --- a/tests/Unit/Service/Dso/DsoDeadlineActsTest.php +++ b/tests/Unit/Service/Dso/DsoDeadlineActsTest.php @@ -33,6 +33,7 @@ use OCA\Dossiq\Service\Dso\DsoDeadlineActs; use OCA\Dossiq\Service\Lifecycle\CaseJournal; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IUserSession; use OCP\Notification\IManager; use OCP\Notification\INotification; @@ -94,7 +95,7 @@ public function __construct(private array $stored, private array &$patches) { * * @return array|null */ - public function find(string $id, mixed $register = null, mixed $schema = null): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { return $this->stored[$id] ?? null; } diff --git a/tests/Unit/Service/Email/IntakeLogGoldenTest.php b/tests/Unit/Service/Email/IntakeLogGoldenTest.php index 10c1747d58..be3f64c367 100644 --- a/tests/Unit/Service/Email/IntakeLogGoldenTest.php +++ b/tests/Unit/Service/Email/IntakeLogGoldenTest.php @@ -34,6 +34,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Timeline\CaseTimeline; use OCA\Dossiq\Tests\Support\MatchesGoldenFiles; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Utility\ITimeFactory; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -96,7 +97,9 @@ public function patchObject(string $objectId, array $data, string $register = '' return $this->answer('patchObject', ['objectId' => $objectId, 'data' => $data, 'register' => $register, 'schema' => $schema]); } - public function find(string $id, string $register = '', string $schema = ''): mixed { + public function find(string $id, ?ObjectFindOptions $options = null): mixed { + $register = ($options?->register ?? ''); + $schema = ($options?->schema ?? ''); return $this->answer('find', ['id' => $id, 'register' => $register, 'schema' => $schema]); } diff --git a/tests/Unit/Service/Email/UnmatchedMailIntakeGoldenTest.php b/tests/Unit/Service/Email/UnmatchedMailIntakeGoldenTest.php index 2a656c24a1..d61072cd58 100644 --- a/tests/Unit/Service/Email/UnmatchedMailIntakeGoldenTest.php +++ b/tests/Unit/Service/Email/UnmatchedMailIntakeGoldenTest.php @@ -30,6 +30,7 @@ use OCA\Dossiq\Service\Email\UnmatchedMailIntake; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Tests\Support\MatchesGoldenFiles; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Db\DoesNotExistException; use OCP\IAppConfig; use PHPUnit\Framework\TestCase; @@ -104,7 +105,9 @@ public function __construct(private UnmatchedMailIntakeGoldenTest $test, private * * @return mixed The object. */ - public function find(string|int $id, mixed $register = null, mixed $schema = null): mixed { + public function find(string|int $id, ?ObjectFindOptions $options = null): mixed { + $register = ($options?->register ?? null); + $schema = ($options?->schema ?? null); $this->test->calls[] = ['find', ['id' => $id, 'register' => $register, 'schema' => $schema]]; if (array_key_exists('caseType', $this->world) === false) { throw new DoesNotExistException('Object not found'); diff --git a/tests/Unit/Service/Email/UnmatchedMailIntakeTest.php b/tests/Unit/Service/Email/UnmatchedMailIntakeTest.php index a89d29289c..13d7bfcb86 100644 --- a/tests/Unit/Service/Email/UnmatchedMailIntakeTest.php +++ b/tests/Unit/Service/Email/UnmatchedMailIntakeTest.php @@ -33,6 +33,7 @@ use OCA\Dossiq\Service\AssigneeResolver; use OCA\Dossiq\Service\Email\UnmatchedMailIntake; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IAppConfig; use PHPUnit\Framework\TestCase; use Psr\Log\NullLogger; @@ -94,7 +95,7 @@ public function __construct( * * @return array The row. */ - public function find(string $id, string $register, string $schema): array { + public function find(string $id, ?ObjectFindOptions $options = null): array { return $this->caseType; } diff --git a/tests/Unit/Service/FlowHandlerSnapshotClobberTest.php b/tests/Unit/Service/FlowHandlerSnapshotClobberTest.php index e9af4f97d1..2585ac42d9 100644 --- a/tests/Unit/Service/FlowHandlerSnapshotClobberTest.php +++ b/tests/Unit/Service/FlowHandlerSnapshotClobberTest.php @@ -35,6 +35,7 @@ use OCA\Dossiq\Service\Transitions\SetStatusHandler; use OCA\Dossiq\Service\Transitions\StatusTypeLookup; use OCA\OpenRegister\Db\ObjectEntity; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\NullLogger; @@ -127,7 +128,7 @@ public function patchObject(string $objectId, array $data, ?string $register = n * * @return ObjectEntity The stored entity. */ - public function find(int|string $id, ?array $_extend = [], bool $files = false, ?string $register = null, ?string $schema = null): ObjectEntity { + public function find(int|string $id, ?ObjectFindOptions $options = null): ObjectEntity { return $this->entity(); } diff --git a/tests/Unit/Service/Inspection/InspectionRunServiceTest.php b/tests/Unit/Service/Inspection/InspectionRunServiceTest.php index 2b5851e24e..0e2d7243fa 100644 --- a/tests/Unit/Service/Inspection/InspectionRunServiceTest.php +++ b/tests/Unit/Service/Inspection/InspectionRunServiceTest.php @@ -27,6 +27,7 @@ use OCA\Dossiq\Service\Inspection\InspectionRunService; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Task\EngineInboxQuery; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use RuntimeException; @@ -201,7 +202,9 @@ public function __construct(private readonly array $templates, private readonly * * @return array|null The template. */ - public function find(string $id, int|string $register, int|string $schema): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { + $register = ($options?->register ?? ''); + $schema = ($options?->schema ?? ''); unset($register, $schema); return ($this->templates[$id] ?? null); diff --git a/tests/Unit/Service/Intake/SystemCaseStoreTest.php b/tests/Unit/Service/Intake/SystemCaseStoreTest.php index 3168c79d11..f5dba1d3e0 100644 --- a/tests/Unit/Service/Intake/SystemCaseStoreTest.php +++ b/tests/Unit/Service/Intake/SystemCaseStoreTest.php @@ -23,6 +23,7 @@ use OCA\Dossiq\Service\Intake\SystemCaseStore; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Tests\Support\InMemoryRegister; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -84,7 +85,7 @@ public function testTheCaseTypeAndTheCaseAreReadFromTheirSchemas(): void { */ public function testAFailedReadIsLoggedAndReadsAsAbsent(): void { $broken = new class { - public function find(int|string $id, int|string $register, int|string $schema, bool $_rbac, bool $_multitenancy): array { + public function find(int|string $id, ?ObjectFindOptions $options = null, bool $_rbac, bool $_multitenancy): array { throw new RuntimeException('down'); } }; diff --git a/tests/Unit/Service/Kcc/ContactMomentWritePathTest.php b/tests/Unit/Service/Kcc/ContactMomentWritePathTest.php index 22511dfd2c..ec60a13472 100644 --- a/tests/Unit/Service/Kcc/ContactMomentWritePathTest.php +++ b/tests/Unit/Service/Kcc/ContactMomentWritePathTest.php @@ -25,6 +25,7 @@ use OCA\Dossiq\Service\Kcc\ContactMomentService; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Tests\Support\MakesCaseDateNormaliser; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\OCS\OCSBadRequestException; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -75,7 +76,7 @@ public function saveObject(array $object, string $register, string $schema, ?str return $object + ['id' => $uuid ?? 'new-1']; } - public function find(string $id, string $register, string $schema): mixed { + public function find(string $id, ?ObjectFindOptions $options = null): mixed { if ($this->findThrows === true) { throw new \RuntimeException('gone'); } diff --git a/tests/Unit/Service/LhsOverrideAuthorizationTest.php b/tests/Unit/Service/LhsOverrideAuthorizationTest.php index 56ca0001b1..e48f0fd3b0 100644 --- a/tests/Unit/Service/LhsOverrideAuthorizationTest.php +++ b/tests/Unit/Service/LhsOverrideAuthorizationTest.php @@ -20,6 +20,7 @@ use OCA\Dossiq\Service\Vth\LhsDecisionTableLookup; use OCA\Dossiq\Service\Vth\LhsRecommendationService; use OCA\Dossiq\Service\Vth\LhsRecommendationStore; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IUser; use OCP\IUserSession; use PHPUnit\Framework\TestCase; @@ -82,7 +83,7 @@ public function __construct(private array &$rows, private ?array &$saved) { * * @return array|null The row. */ - public function find(string $id, string $register = '', string $schema = ''): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { return ($this->rows[$id] ?? null); } diff --git a/tests/Unit/Service/OneDateWritePathRoundTripTest.php b/tests/Unit/Service/OneDateWritePathRoundTripTest.php index 05b4b59130..54895eaef6 100644 --- a/tests/Unit/Service/OneDateWritePathRoundTripTest.php +++ b/tests/Unit/Service/OneDateWritePathRoundTripTest.php @@ -52,6 +52,7 @@ use OCA\Dossiq\Service\WorkingDayCalculator; use OCA\Dossiq\Tests\Support\MakesCaseDateNormaliser; use OCA\Dossiq\Tests\Support\PhpInputStream; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IGroupManager; use OCP\IRequest; use OCP\IUser; @@ -73,7 +74,7 @@ interface RoundTripObjectStoreStub { * * @return mixed */ - public function find(int|string $id, mixed $register = null, mixed $schema = null): mixed; + public function find(int|string $id, ?ObjectFindOptions $options = null): mixed; /** * Persist an object and hand the payload back to the test. diff --git a/tests/Unit/Service/People/CaseRoleProjectionTest.php b/tests/Unit/Service/People/CaseRoleProjectionTest.php index 4aa3e07398..751d218e88 100644 --- a/tests/Unit/Service/People/CaseRoleProjectionTest.php +++ b/tests/Unit/Service/People/CaseRoleProjectionTest.php @@ -12,6 +12,7 @@ use OCA\Dossiq\Service\People\CaseRoleProjection; use OCA\Dossiq\Service\People\PersonLinkReader; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -99,7 +100,8 @@ protected function setUp(): void { * * @return array The row. */ - public function find(string $id, string|int|null $register = null, string|int|null $schema = null): array { + public function find(string $id, ?ObjectFindOptions $options = null): array { + $schema = ($options?->schema ?? null); if (isset($this->rows[$id]) === false) { throw new RuntimeException('not found: ' . $id); } @@ -428,8 +430,10 @@ public function __construct(private object $inner) { * * @return array The row. */ - public function find(string $id, string|int|null $register = null, string|int|null $schema = null): array { - return $this->inner->find($id, $register, $schema); + public function find(string $id, ?ObjectFindOptions $options = null): array { + $register = ($options?->register ?? null); + $schema = ($options?->schema ?? null); + return $this->inner->find(id: $id, options: new ObjectFindOptions(register: $register, schema: $schema)); } /** diff --git a/tests/Unit/Service/Permit/PermitPlateChangeGoldenTest.php b/tests/Unit/Service/Permit/PermitPlateChangeGoldenTest.php index f2759bca3e..f6fda77571 100644 --- a/tests/Unit/Service/Permit/PermitPlateChangeGoldenTest.php +++ b/tests/Unit/Service/Permit/PermitPlateChangeGoldenTest.php @@ -27,6 +27,7 @@ use OCA\Dossiq\Service\Permit\PermitPlateChange; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Tests\Support\MatchesGoldenFiles; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Db\DoesNotExistException; use PHPUnit\Framework\TestCase; use RuntimeException; @@ -129,7 +130,9 @@ public function runAsSystem(callable $operation): mixed { * * @throws DoesNotExistException When there is none. */ - public function find(string $id, mixed $register = null, mixed $schema = null): array { + public function find(string $id, ?ObjectFindOptions $options = null): array { + $register = ($options?->register ?? null); + $schema = ($options?->schema ?? null); $this->trace->append(['find', $register, $schema, $id]); if (($this->config['readThrows'] ?? '') === $schema) { throw new RuntimeException('database gone'); diff --git a/tests/Unit/Service/Permit/PermitPlateChangeTest.php b/tests/Unit/Service/Permit/PermitPlateChangeTest.php index 9da05f0784..3f067e272a 100644 --- a/tests/Unit/Service/Permit/PermitPlateChangeTest.php +++ b/tests/Unit/Service/Permit/PermitPlateChangeTest.php @@ -19,6 +19,7 @@ use OCA\Dossiq\Service\Permit\PermitPlateChange; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Tests\Support\RealSchemaValidator; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Db\DoesNotExistException; use PHPUnit\Framework\TestCase; @@ -55,7 +56,8 @@ protected function setUp(): void { * * @throws DoesNotExistException When there is none. */ - public function find(string $id, string $register = '', string $schema = ''): array { + public function find(string $id, ?ObjectFindOptions $options = null): array { + $schema = ($options?->schema ?? ''); if ($this->broken === true) { throw new \RuntimeException('database gone'); } diff --git a/tests/Unit/Service/Product/CaseOutcomeProductGoldenTest.php b/tests/Unit/Service/Product/CaseOutcomeProductGoldenTest.php index 636391ea09..f3ebe1ca9e 100644 --- a/tests/Unit/Service/Product/CaseOutcomeProductGoldenTest.php +++ b/tests/Unit/Service/Product/CaseOutcomeProductGoldenTest.php @@ -25,6 +25,7 @@ use OCA\Dossiq\Service\Product\CaseOutcomeProductIssuer; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Tests\Support\MatchesGoldenFiles; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Db\DoesNotExistException; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -219,7 +220,9 @@ private function log(string $call, array $args): void { * * @throws DoesNotExistException When there is none. */ - public function find(string $id, string $register = '', string $schema = ''): array { + public function find(string $id, ?ObjectFindOptions $options = null): array { + $register = ($options?->register ?? ''); + $schema = ($options?->schema ?? ''); $this->log(call: 'find', args: ['id' => $id, 'register' => $register, 'schema' => $schema]); if (isset($this->world[$schema][$id]) === false) { throw new DoesNotExistException('none'); diff --git a/tests/Unit/Service/Product/CaseOutcomeProductIssuerTest.php b/tests/Unit/Service/Product/CaseOutcomeProductIssuerTest.php index bdddd69e5b..93e3152fdc 100644 --- a/tests/Unit/Service/Product/CaseOutcomeProductIssuerTest.php +++ b/tests/Unit/Service/Product/CaseOutcomeProductIssuerTest.php @@ -23,6 +23,7 @@ use OCA\Dossiq\Service\Product\CaseOutcomeProductIssuer; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Tests\Support\RealSchemaValidator; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Db\DoesNotExistException; use PHPUnit\Framework\TestCase; use Psr\Log\NullLogger; @@ -78,7 +79,8 @@ protected function setUp(): void { * * @throws DoesNotExistException When there is none. */ - public function find(string $id, string $register = '', string $schema = ''): array { + public function find(string $id, ?ObjectFindOptions $options = null): array { + $schema = ($options?->schema ?? ''); if (isset($this->store[$schema][$id]) === false) { throw new DoesNotExistException('none'); } diff --git a/tests/Unit/Service/Publication/OpenCatalogiApiClientTest.php b/tests/Unit/Service/Publication/OpenCatalogiApiClientTest.php index 7acd22feb9..733ed5c994 100644 --- a/tests/Unit/Service/Publication/OpenCatalogiApiClientTest.php +++ b/tests/Unit/Service/Publication/OpenCatalogiApiClientTest.php @@ -47,6 +47,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Publication\OpenCatalogiApiClient; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\Http\Client\IClient; use OCP\Http\Client\IClientService; use OCP\Http\Client\IResponse; @@ -212,13 +213,12 @@ public function saveObject( */ public function findSilent( string $id, - ?array $_extend = [], - bool $files = false, - string|int|null $register = null, - string|int|null $schema = null, + ?ObjectFindOptions $options = null, bool $_rbac = true, bool $_multitenancy = true, ): OpenCatalogiApiClientObjectEntityDouble { + $register = ($options?->register ?? null); + $schema = ($options?->schema ?? null); $this->findCalls[] = [ 'id' => $id, 'register' => $register, diff --git a/tests/Unit/Service/PublicationServiceGoldenTest.php b/tests/Unit/Service/PublicationServiceGoldenTest.php index 4ae32c9849..4f7615a0ea 100644 --- a/tests/Unit/Service/PublicationServiceGoldenTest.php +++ b/tests/Unit/Service/PublicationServiceGoldenTest.php @@ -26,6 +26,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Tests\Support\MatchesGoldenFiles; use OCA\Integriq\Event\DeliveryRequestedEvent; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\EventDispatcher\IEventDispatcher; use PHPUnit\Framework\TestCase; use Psr\Log\AbstractLogger; @@ -112,7 +113,9 @@ public function __construct(private array $world, private array &$calls) { * * @return mixed The case. */ - public function find(string $id, mixed $register, mixed $schema): mixed { + public function find(string $id, ?ObjectFindOptions $options = null): mixed { + $register = ($options?->register ?? null); + $schema = ($options?->schema ?? null); $this->calls[] = ['find', $id, $register, $schema]; $found = ($this->world['case'] ?? null); if ($found === 'throw') { diff --git a/tests/Unit/Service/PublicationServiceTest.php b/tests/Unit/Service/PublicationServiceTest.php index 3922017e9d..6b2bbb7ebc 100644 --- a/tests/Unit/Service/PublicationServiceTest.php +++ b/tests/Unit/Service/PublicationServiceTest.php @@ -28,6 +28,7 @@ use OCA\Dossiq\Service\PublicationService; use OCA\Dossiq\Service\SettingsService; use OCA\Integriq\Event\DeliveryRequestedEvent; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\EventDispatcher\IEventDispatcher; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -45,7 +46,7 @@ interface PublicationObjectServiceStub { * * @return mixed */ - public function find(string $id, string $register, string $schema): mixed; + public function find(string $id, ?ObjectFindOptions $options = null): mixed; /** * Save or update an object. diff --git a/tests/Unit/Service/Queue/EndOfDayRowMetaTest.php b/tests/Unit/Service/Queue/EndOfDayRowMetaTest.php index 8e950ea981..096ea2e105 100644 --- a/tests/Unit/Service/Queue/EndOfDayRowMetaTest.php +++ b/tests/Unit/Service/Queue/EndOfDayRowMetaTest.php @@ -28,6 +28,7 @@ use OCA\Dossiq\Service\Queue\EndOfDayRowMeta; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Task\EngineTaskGateway; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Db\DoesNotExistException; use OCP\IL10N; use PHPUnit\Framework\TestCase; @@ -61,7 +62,7 @@ public function __construct(private array $objects) { * * @return object The object. */ - public function find(string $id, string $register, string $schema): object { + public function find(string $id, ?ObjectFindOptions $options = null): object { if (isset($this->objects[$id]) === false) { throw new DoesNotExistException('not found'); } diff --git a/tests/Unit/Service/Queue/EndOfDayServiceTest.php b/tests/Unit/Service/Queue/EndOfDayServiceTest.php index 57d82f46ad..09b49a7ea0 100644 --- a/tests/Unit/Service/Queue/EndOfDayServiceTest.php +++ b/tests/Unit/Service/Queue/EndOfDayServiceTest.php @@ -33,6 +33,7 @@ use OCA\Dossiq\Service\Queue\PersonalQueueService; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Task\EngineTaskGateway; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IL10N; use PHPUnit\Framework\TestCase; use Psr\Log\NullLogger; @@ -65,7 +66,8 @@ private function service(array $items, array $lastSeen, array $notes, array $una * * @return object The object, its own `updated` always today. */ - public function find(string $id, string $register, string $schema): object { + public function find(string $id, ?ObjectFindOptions $options = null): object { + $schema = ($options?->schema ?? ''); if ($schema === 'task') { throw new RuntimeException('not an object'); } diff --git a/tests/Unit/Service/Queue/QueueCaseFactsTest.php b/tests/Unit/Service/Queue/QueueCaseFactsTest.php index 4b001042d3..403a302f52 100644 --- a/tests/Unit/Service/Queue/QueueCaseFactsTest.php +++ b/tests/Unit/Service/Queue/QueueCaseFactsTest.php @@ -27,6 +27,7 @@ use OCA\Dossiq\Service\Queue\UrgencyProfile; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Tests\Support\MakesCaseDateNormaliser; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IUserSession; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -109,7 +110,8 @@ public function searchObjectsBySlug(string $register, string $schema, array $fil return $this->rows; }//end searchObjectsBySlug() - public function find(string $id, int|string|null $register = null, int|string|null $schema = null): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { + $schema = ($options?->schema ?? null); $this->calls[] = ['find', $schema, $id]; if ($this->found instanceof \Throwable) { throw $this->found; diff --git a/tests/Unit/Service/Routing/RefusalOutcomeTest.php b/tests/Unit/Service/Routing/RefusalOutcomeTest.php index 6d6a19d367..0ba0e81373 100644 --- a/tests/Unit/Service/Routing/RefusalOutcomeTest.php +++ b/tests/Unit/Service/Routing/RefusalOutcomeTest.php @@ -40,6 +40,7 @@ use OCA\Dossiq\Service\CaseTypeResolver; use OCA\Dossiq\Service\Routing\RefusalOutcome; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Utility\ITimeFactory; use PHPUnit\Framework\TestCase; use Psr\Log\NullLogger; @@ -101,7 +102,7 @@ public function searchObjectsBySlug(string $register, string $schema, array $fil * * @return array|null The case, or null. */ - public function find(string $id, string $register = '', string $schema = ''): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { return ($this->cases[$id] ?? null); }//end find() diff --git a/tests/Unit/Service/Routing/TakeBackTest.php b/tests/Unit/Service/Routing/TakeBackTest.php index 967cfb077c..380dfe1d49 100644 --- a/tests/Unit/Service/Routing/TakeBackTest.php +++ b/tests/Unit/Service/Routing/TakeBackTest.php @@ -32,6 +32,7 @@ use OCA\Dossiq\Service\Routing\RoutingStrategyMissingException; use OCA\Dossiq\Service\Routing\TakeBackWindow; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Utility\ITimeFactory; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -66,7 +67,7 @@ class TakeBackCaseStore { * * @return array|null */ - public function find(string $id, string $register = '', string $schema = ''): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { return ($this->cases[$id] ?? null); }//end find() diff --git a/tests/Unit/Service/Setup/ExampleDataFragmentsTest.php b/tests/Unit/Service/Setup/ExampleDataFragmentsTest.php index bfa094819b..654b6bcda5 100644 --- a/tests/Unit/Service/Setup/ExampleDataFragmentsTest.php +++ b/tests/Unit/Service/Setup/ExampleDataFragmentsTest.php @@ -25,6 +25,7 @@ use DateTimeImmutable; use OCA\Dossiq\Service\Setup\ExampleDataFragments; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Db\DoesNotExistException; use OCP\App\IAppManager; use OCP\AppFramework\Utility\ITimeFactory; @@ -261,7 +262,9 @@ public function __construct(private array $stored) { * * @return array The object. */ - public function find(string $id, mixed $register, string $schema): array { + public function find(string $id, ?ObjectFindOptions $options = null): array { + $register = ($options?->register ?? null); + $schema = ($options?->schema ?? ''); if (isset($this->stored[$schema . ':' . $id]) === false) { throw new DoesNotExistException('not stored'); } diff --git a/tests/Unit/Service/SociaalDomein/FakeSociaalDomeinObjects.php b/tests/Unit/Service/SociaalDomein/FakeSociaalDomeinObjects.php index 59eda56667..d942a0b0db 100644 --- a/tests/Unit/Service/SociaalDomein/FakeSociaalDomeinObjects.php +++ b/tests/Unit/Service/SociaalDomein/FakeSociaalDomeinObjects.php @@ -25,6 +25,8 @@ namespace OCA\Dossiq\Tests\Unit\Service\SociaalDomein; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; + /** * A store of rows, keyed by schema slug then by uuid. */ @@ -143,7 +145,8 @@ public function searchObjectsBySlug(string $registerSlug, string $schemaSlug, ar * * @return array|null The row. */ - public function find(string $id, $register = null, $schema = null): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { + $schema = ($options?->schema ?? null); if ($this->broken === true) { throw new \RuntimeException('the store is unreachable'); } diff --git a/tests/Unit/Service/StatusTransitionServiceRouteSeamTest.php b/tests/Unit/Service/StatusTransitionServiceRouteSeamTest.php index 0d4ab1f94f..2221d22c01 100644 --- a/tests/Unit/Service/StatusTransitionServiceRouteSeamTest.php +++ b/tests/Unit/Service/StatusTransitionServiceRouteSeamTest.php @@ -43,6 +43,7 @@ use OCA\Dossiq\Service\Transitions\TransitionAuthorizer; use OCA\Dossiq\Service\Transitions\TransitionSpecReader; use OCA\Dossiq\Service\WorkflowTemplateLoader; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IGroupManager; use OCP\IUserSession; use PHPUnit\Framework\MockObject\MockObject; @@ -59,7 +60,7 @@ * over as the strings app-config stores. */ interface RouteSeamObjectServiceStub { - public function find(string $id, mixed $register = null, mixed $schema = null): mixed; + public function find(string $id, ?ObjectFindOptions $options = null): mixed; public function searchObjects(array $query): array; diff --git a/tests/Unit/Service/Subsidie/VaststellingServiceTest.php b/tests/Unit/Service/Subsidie/VaststellingServiceTest.php index c8a86a7ce0..99cdcf0ecf 100644 --- a/tests/Unit/Service/Subsidie/VaststellingServiceTest.php +++ b/tests/Unit/Service/Subsidie/VaststellingServiceTest.php @@ -30,6 +30,7 @@ use OCA\Dossiq\Service\Subsidie\TerugvorderingService; use OCA\Dossiq\Service\Subsidie\VaststellingService; use OCA\Dossiq\Tests\Unit\Service\FakeStoredObject; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Db\DoesNotExistException; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -66,7 +67,8 @@ class VaststellingFakeObjectService { * * @throws DoesNotExistException When the id is unknown. */ - public function find(int|string $id, ?array $_extend = [], bool $files = false, string|int|null $register = null, string|int|null $schema = null): FakeStoredObject { + public function find(int|string $id, ?ObjectFindOptions $options = null): FakeStoredObject { + $schema = ($options?->schema ?? null); $row = ($this->store[(string)$schema][(string)$id] ?? null); if ($row === null) { throw new DoesNotExistException('Object ' . $id . ' does not exist'); diff --git a/tests/Unit/Service/Support/BackgroundReadsRunAsSystemTest.php b/tests/Unit/Service/Support/BackgroundReadsRunAsSystemTest.php index 56bb6bd132..471b12b003 100644 --- a/tests/Unit/Service/Support/BackgroundReadsRunAsSystemTest.php +++ b/tests/Unit/Service/Support/BackgroundReadsRunAsSystemTest.php @@ -24,6 +24,7 @@ use OCA\Dossiq\Service\CasePlanProjectionService; use OCA\Dossiq\Service\CaseTypeSlugResolver; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IUser; use OCP\IUserSession; use PHPUnit\Framework\TestCase; @@ -74,7 +75,7 @@ public function runAsSystem(callable $operation): mixed { * * @return array The row. */ - public function find(string $id, mixed $register = null, mixed $schema = null): array { + public function find(string $id, ?ObjectFindOptions $options = null): array { if ($this->inSystem === false && $this->signedIn === false) { throw new RuntimeException("User 'Anonymous' does not have permission to 'read' objects in schema 'Case Type'"); } @@ -194,9 +195,11 @@ public function __construct(public array &$seen) { * * @return array */ - public function find(string $id, mixed $register = null, mixed $schema = null): array { + public function find(string $id, ?ObjectFindOptions $options = null): array { + $register = ($options?->register ?? null); + $schema = ($options?->schema ?? null); $this->seen[] = $this->inSystem; - return parent::find($id, $register, $schema); + return parent::find(id: $id, options: $options); } }; $this->objects = $objects; diff --git a/tests/Unit/Service/Support/PatchObjectAsArrayTest.php b/tests/Unit/Service/Support/PatchObjectAsArrayTest.php index ce8e06ff12..85dfb2e75a 100644 --- a/tests/Unit/Service/Support/PatchObjectAsArrayTest.php +++ b/tests/Unit/Service/Support/PatchObjectAsArrayTest.php @@ -14,6 +14,7 @@ namespace OCA\Dossiq\Tests\Unit\Service\Support; use OCA\Dossiq\Service\Support\SearchesObjects; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use RuntimeException; @@ -94,7 +95,7 @@ public function testTheFallbackSavesTheWholeObjectWithoutItsMetadata(): void { /** @var string|null */ public ?string $savedUuid = null; - public function find(string $id, string|int|null $register = null, string|int|null $schema = null): array { + public function find(string $id, ?ObjectFindOptions $options = null): array { return [ 'id' => $id, 'title' => 'Advies brandweer', @@ -125,7 +126,7 @@ public function saveObject(array $object, string|int|null $register = null, stri */ public function testAnUnreadableObjectIsRefused(): void { $objectService = new class { - public function find(string $id, string|int|null $register = null, string|int|null $schema = null): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { return null; } diff --git a/tests/Unit/Service/Support/UnscopedObjectReaderTest.php b/tests/Unit/Service/Support/UnscopedObjectReaderTest.php index 74ec997e67..3bca056070 100644 --- a/tests/Unit/Service/Support/UnscopedObjectReaderTest.php +++ b/tests/Unit/Service/Support/UnscopedObjectReaderTest.php @@ -22,6 +22,7 @@ use JsonSerializable; use OCA\Dossiq\Service\Support\UnscopedObjectReader; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Db\DoesNotExistException; use PHPUnit\Framework\TestCase; @@ -48,7 +49,9 @@ public function runAsSystem(callable $operation): mixed { return $operation(); } - public function find(int|string $id, int|string $register, int|string $schema, bool $_rbac, bool $_multitenancy): array { + public function find(int|string $id, ?ObjectFindOptions $options = null, bool $_rbac, bool $_multitenancy): array { + $register = ($options?->register ?? ''); + $schema = ($options?->schema ?? ''); $this->calls[] = ['id' => $id, 'register' => $register, 'schema' => $schema, 'rbac' => $_rbac, 'multitenancy' => $_multitenancy]; return ['id' => $id, 'title' => 'Found']; } @@ -68,7 +71,7 @@ public function find(int|string $id, int|string $register, int|string $schema, b */ public function testAnEntityIsAnsweredAsItsArray(): void { $service = new class { - public function find(int|string $id, int|string $register, int|string $schema, bool $_rbac, bool $_multitenancy): JsonSerializable { + public function find(int|string $id, ?ObjectFindOptions $options = null, bool $_rbac, bool $_multitenancy): JsonSerializable { return new class implements JsonSerializable { public function jsonSerialize(): array { return ['id' => 'uuid-2']; @@ -87,12 +90,12 @@ public function jsonSerialize(): array { */ public function testAMissingRowReadsAsNull(): void { $missing = new class { - public function find(int|string $id, int|string $register, int|string $schema, bool $_rbac, bool $_multitenancy): array { + public function find(int|string $id, ?ObjectFindOptions $options = null, bool $_rbac, bool $_multitenancy): array { throw new DoesNotExistException('gone'); } }; $nothing = new class { - public function find(int|string $id, int|string $register, int|string $schema, bool $_rbac, bool $_multitenancy): ?string { + public function find(int|string $id, ?ObjectFindOptions $options = null, bool $_rbac, bool $_multitenancy): ?string { return null; } }; diff --git a/tests/Unit/Service/Task/TaskAttachmentTest.php b/tests/Unit/Service/Task/TaskAttachmentTest.php index e61f1760bf..2a0ca4bf53 100644 --- a/tests/Unit/Service/Task/TaskAttachmentTest.php +++ b/tests/Unit/Service/Task/TaskAttachmentTest.php @@ -30,6 +30,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Task\TaskAttachmentService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\NullLogger; @@ -101,7 +102,7 @@ public function saveObject(array $object, mixed $register, mixed $schema, ?strin * * @return array The case. */ - public function find(string $id, mixed $register, mixed $schema): array { + public function find(string $id, ?ObjectFindOptions $options = null): array { return $this->case; } }; diff --git a/tests/Unit/Service/TenantAuditTrailServiceTest.php b/tests/Unit/Service/TenantAuditTrailServiceTest.php index 4f2d307fd0..d73cd100a3 100644 --- a/tests/Unit/Service/TenantAuditTrailServiceTest.php +++ b/tests/Unit/Service/TenantAuditTrailServiceTest.php @@ -22,6 +22,7 @@ namespace OCA\Dossiq\Tests\Unit\Service; use OCA\Dossiq\Service\TenantAuditTrailService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\App\IAppManager; use OCA\Dossiq\Tests\Support\MakesTenantAnchors; use PHPUnit\Framework\TestCase; @@ -72,7 +73,9 @@ private function makeService(bool $orAvailable = true, ?string $multitenancy = ' * * @return object */ - public function find(string $id, string $register = '', string $schema = '', bool $_rbac = true, bool $_multitenancy = true): object { + public function find(string $id, ?ObjectFindOptions $options = null, bool $_rbac = true, bool $_multitenancy = true): object { + $register = ($options?->register ?? ''); + $schema = ($options?->schema ?? ''); return (object)['uuid' => $id, 'register' => $register, 'schema' => $schema]; } }; diff --git a/tests/Unit/Service/Termijn/TermHandlerNoticeTest.php b/tests/Unit/Service/Termijn/TermHandlerNoticeTest.php index 61d7ea4fb2..70854c68e2 100644 --- a/tests/Unit/Service/Termijn/TermHandlerNoticeTest.php +++ b/tests/Unit/Service/Termijn/TermHandlerNoticeTest.php @@ -26,6 +26,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Termijn\TermHandlerNotice; use OCA\Dossiq\Service\TermijnService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\Notification\IManager; use OCP\Notification\INotification; use PHPUnit\Framework\TestCase; @@ -76,7 +77,8 @@ public function __construct(public array $rows) { /** * @return array|null */ - public function find(string $id, string $register, string $schema): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { + $schema = ($options?->schema ?? ''); return $this->rows[$schema][$id] ?? null; } }; diff --git a/tests/Unit/Service/Termijn/TermsEndingFirstTest.php b/tests/Unit/Service/Termijn/TermsEndingFirstTest.php index 9e8dd70bdd..9cafd7fea1 100644 --- a/tests/Unit/Service/Termijn/TermsEndingFirstTest.php +++ b/tests/Unit/Service/Termijn/TermsEndingFirstTest.php @@ -26,6 +26,7 @@ use OCA\Dossiq\Service\Termijn\TermsEndingFirst; use OCA\Dossiq\Service\TermijnService; use OCA\Dossiq\Service\TermijnTimerService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -149,7 +150,7 @@ public function searchObjects(array $query): array { * @param int|string $schema The schema. * @return array */ - public function find(string $id, int|string $register, int|string $schema): array { + public function find(string $id, ?ObjectFindOptions $options = null): array { return ($this->cases[$id] ?? []); } }; diff --git a/tests/Unit/Service/TermijnNotificationServiceTest.php b/tests/Unit/Service/TermijnNotificationServiceTest.php index 6e9af607bd..0f2f8d77bd 100644 --- a/tests/Unit/Service/TermijnNotificationServiceTest.php +++ b/tests/Unit/Service/TermijnNotificationServiceTest.php @@ -33,6 +33,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\TermijnNotificationService; use OCA\Dossiq\Service\TermijnService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -275,7 +276,7 @@ public function __construct(private array $cases) { * * @return array */ - public function find(string $id, string $register, string $schema): array { + public function find(string $id, ?ObjectFindOptions $options = null): array { if (isset($this->cases[$id]) === false) { throw new \OCP\AppFramework\Db\DoesNotExistException('no case ' . $id); } diff --git a/tests/Unit/Service/Timeline/CaseTimelineTest.php b/tests/Unit/Service/Timeline/CaseTimelineTest.php index 1c9c9882f6..5e9318e1e7 100644 --- a/tests/Unit/Service/Timeline/CaseTimelineTest.php +++ b/tests/Unit/Service/Timeline/CaseTimelineTest.php @@ -41,6 +41,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Timeline\CaseTimeline; use OCA\Dossiq\Service\Timeline\TimelineKinds; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IUser; use OCP\IUserSession; use PHPUnit\Framework\MockObject\MockObject; @@ -288,8 +289,7 @@ public function runAsSystem(callable $operation): mixed { */ public function find( string $id, - mixed $register = null, - mixed $schema = null, + ?ObjectFindOptions $options = null, bool $_rbac = true, bool $_multitenancy = true, ): ?object { diff --git a/tests/Unit/Service/Timeline/StatusAndTermEventsOnTheTimelineTest.php b/tests/Unit/Service/Timeline/StatusAndTermEventsOnTheTimelineTest.php index 232a3d06a5..b23d6bb0a7 100644 --- a/tests/Unit/Service/Timeline/StatusAndTermEventsOnTheTimelineTest.php +++ b/tests/Unit/Service/Timeline/StatusAndTermEventsOnTheTimelineTest.php @@ -46,6 +46,7 @@ use OCA\Dossiq\Service\CaseTypeStore; use OCA\Dossiq\Service\Transitions\StatusTypeLookup; use OCA\Dossiq\Tests\Unit\Service\FakeTermijnStore; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IUser; use OCP\IUserSession; use PHPUnit\Framework\MockObject\MockObject; @@ -79,7 +80,7 @@ public function saveObject(array $object, string $register, string $schema): arr * * @return array */ - public function find(string $id, mixed $register = null, mixed $schema = null): array; + public function find(string $id, ?ObjectFindOptions $options = null): array; }//end interface /** diff --git a/tests/Unit/Service/Transitions/CaseResultWriterTest.php b/tests/Unit/Service/Transitions/CaseResultWriterTest.php index 51867535d4..ff010fcbef 100644 --- a/tests/Unit/Service/Transitions/CaseResultWriterTest.php +++ b/tests/Unit/Service/Transitions/CaseResultWriterTest.php @@ -26,6 +26,7 @@ use OCA\Dossiq\Service\CaseTypeResolver; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Transitions\CaseResultWriter; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; @@ -171,7 +172,7 @@ public function saveObject(array $object, string $register, string $schema): arr * * @return array An empty row. */ - public function find(string $id, string $register, string $schema): array { + public function find(string $id, ?ObjectFindOptions $options = null): array { return []; }//end find() }//end class diff --git a/tests/Unit/Service/Transitions/CaseStatusStoreOwnershipTest.php b/tests/Unit/Service/Transitions/CaseStatusStoreOwnershipTest.php index ef42a304f9..2c49ec7229 100644 --- a/tests/Unit/Service/Transitions/CaseStatusStoreOwnershipTest.php +++ b/tests/Unit/Service/Transitions/CaseStatusStoreOwnershipTest.php @@ -34,6 +34,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Transitions\CaseStatusStore; use OCA\Dossiq\Service\Transitions\StatusTypeLookup; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\NullLogger; use RuntimeException; @@ -137,7 +138,7 @@ public function __construct(private array $objects) { * * @return array The object. */ - public function find(string $id, mixed $register = null, mixed $schema = null): array { + public function find(string $id, ?ObjectFindOptions $options = null): array { if (isset($this->objects[$id]) === false) { throw new RuntimeException('not found'); } diff --git a/tests/Unit/Service/Transitions/CaseTypeReaderExtensionLimitTest.php b/tests/Unit/Service/Transitions/CaseTypeReaderExtensionLimitTest.php index bf0b89db3c..884f97316a 100644 --- a/tests/Unit/Service/Transitions/CaseTypeReaderExtensionLimitTest.php +++ b/tests/Unit/Service/Transitions/CaseTypeReaderExtensionLimitTest.php @@ -15,6 +15,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Transitions\CaseTypeReader; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; @@ -69,7 +70,7 @@ public function __construct(private readonly mixed $stored) { * * @return array */ - public function find(string $id, ?string $register = null, ?string $schema = null): array { + public function find(string $id, ?ObjectFindOptions $options = null): array { return ['title' => 'Woo-verzoek', 'extensionAllowed' => true, 'extensionPeriod' => 'P14D', 'maxExtensions' => $this->stored]; }//end find() }; diff --git a/tests/Unit/Service/Transitions/StatusTypeLookupTest.php b/tests/Unit/Service/Transitions/StatusTypeLookupTest.php index cab1b6b9ba..f1de8f9823 100644 --- a/tests/Unit/Service/Transitions/StatusTypeLookupTest.php +++ b/tests/Unit/Service/Transitions/StatusTypeLookupTest.php @@ -32,6 +32,7 @@ use OCA\Dossiq\Service\CaseTypeStore; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Transitions\StatusTypeLookup; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use RuntimeException; @@ -76,7 +77,8 @@ public function searchObjects(array $query): array { ); } - public function find(string $id, string $register, string $schema): array { + public function find(string $id, ?ObjectFindOptions $options = null): array { + $schema = ($options?->schema ?? ''); if ($this->throws === true) { throw new RuntimeException('unreadable'); } diff --git a/tests/Unit/Service/WOODecisionServiceTest.php b/tests/Unit/Service/WOODecisionServiceTest.php index 16d2437e75..4d346866fb 100644 --- a/tests/Unit/Service/WOODecisionServiceTest.php +++ b/tests/Unit/Service/WOODecisionServiceTest.php @@ -28,6 +28,7 @@ use OCA\Dossiq\Service\WOODecisionService; use OCA\Dossiq\Service\WOODocumentAssessmentService; use OCA\Dossiq\Review\PagesSeen; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IUserSession; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -378,11 +379,11 @@ public function testTheRecordedDecisionIsListedOnItsCase(): void { $this->assertSame( expected: [$decisionOf['case-new']], - actual: $store->find(id: 'case-new', register: 'dossiq', schema: 'case')['decisions'] ?? null, + actual: $store->find(id: 'case-new', options: new ObjectFindOptions(register: 'dossiq', schema: 'case'))['decisions'] ?? null, ); $this->assertSame( expected: ['decision-before', $decisionOf['case-earlier']], - actual: $store->find(id: 'case-earlier', register: 'dossiq', schema: 'case')['decisions'] ?? null, + actual: $store->find(id: 'case-earlier', options: new ObjectFindOptions(register: 'dossiq', schema: 'case'))['decisions'] ?? null, ); }//end testTheRecordedDecisionIsListedOnItsCase() @@ -443,8 +444,10 @@ public function __construct(private readonly \OCA\Dossiq\Tests\Support\InMemoryR * * @return array|null */ - public function find(int|string $id, mixed $_extend = null, bool $files = false, int|string $register = '', int|string $schema = ''): ?array { - return $this->store->find(id: $id, register: $register, schema: $schema); + public function find(int|string $id, ?ObjectFindOptions $options = null): ?array { + $register = ($options?->register ?? ''); + $schema = ($options?->schema ?? ''); + return $this->store->find(id: $id, options: new ObjectFindOptions(register: $register, schema: $schema)); } /** diff --git a/tests/Unit/Service/WooPublicationServiceTest.php b/tests/Unit/Service/WooPublicationServiceTest.php index aa303960fc..f0788b9327 100644 --- a/tests/Unit/Service/WooPublicationServiceTest.php +++ b/tests/Unit/Service/WooPublicationServiceTest.php @@ -36,6 +36,7 @@ use OCA\Dossiq\Tests\Unit\Service\Publication\EnglishL10n; use OCA\Dossiq\Tests\Unit\Service\Publication\FakeWithheldDocuments; use OCA\Dossiq\Woo\WooCaseLedger; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Psr\Container\ContainerInterface; use OCP\App\IAppManager; use PHPUnit\Framework\TestCase; @@ -69,7 +70,7 @@ public function saveObject(array $object, array $extend = [], ?string $register * * @return mixed */ - public function find(string $id, ?array $extend = null, bool $files = false, ?string $register = null, ?string $schema = null); + public function find(string $id, ?ObjectFindOptions $options = null); /** * Slug-aware search bridge (real ObjectService::searchObjectsBySlug()). @@ -369,10 +370,12 @@ public function testPublishReportsNoPublishableDocuments(): void { $this->appManager->method('isEnabledForUser')->willReturn(true); $objectService = $this->createMock(WooPublicationObjectServiceStub::class); - $objectService->method('find')->willReturnMap([ - ['case-001', null, false, 'dossiq', 'case', ['id' => 'case-001', 'title' => 'Test case']], - ['decision-001', null, false, 'dossiq', 'decision', ['id' => 'decision-001', 'decisionType' => 'WOO-besluit']], - ]); + $objectService->method('find')->willReturnCallback( + static fn (string $id, ?ObjectFindOptions $options = null): ?array => [ + 'case-001' . '|' . 'case' => ['id' => 'case-001', 'title' => 'Test case'], + 'decision-001' . '|' . 'decision' => ['id' => 'decision-001', 'decisionType' => 'WOO-besluit'], + ][$id . '|' . (string)$options?->schema] ?? null + ); $objectService->method('searchObjectsBySlug')->willReturn([ ['documentRef' => 'doc-001', 'classification' => 'niet_openbaar'], ]); @@ -411,10 +414,12 @@ private function publishRecording(array $case, array $assessments, array $underR $this->appManager->method('isEnabledForUser')->willReturn(true); $objectService = $this->createMock(WooPublicationObjectServiceStub::class); - $objectService->method('find')->willReturnMap([ - ['case-001', null, false, 'dossiq', 'case', ['id' => 'case-001', 'title' => 'Fietspad Lindelaan'] + $case], - ['decision-001', null, false, 'dossiq', 'decision', ['id' => 'decision-001', 'decisionType' => 'WOO-besluit', 'description' => 'Niet openbaar gemaakt']], - ]); + $objectService->method('find')->willReturnCallback( + static fn (string $id, ?ObjectFindOptions $options = null): ?array => [ + 'case-001' . '|' . 'case' => ['id' => 'case-001', 'title' => 'Fietspad Lindelaan'] + $case, + 'decision-001' . '|' . 'decision' => ['id' => 'decision-001', 'decisionType' => 'WOO-besluit', 'description' => 'Niet openbaar gemaakt'], + ][$id . '|' . (string)$options?->schema] ?? null + ); $objectService->method('searchObjectsBySlug')->willReturn($assessments); $saves = []; $objectService->method('saveObject')->willReturnCallback( @@ -588,11 +593,13 @@ public function testPublishSucceedsWithSingleSaveWriteBack(): void { $this->appManager->method('isEnabledForUser')->willReturn(true); $objectService = $this->createMock(WooPublicationObjectServiceStub::class); - $objectService->method('find')->willReturnMap([ - ['case-001', null, false, 'dossiq', 'case', ['id' => 'case-001', 'title' => 'Test case']], - ['decision-001', null, false, 'dossiq', 'decision', ['id' => 'decision-001', 'decisionType' => 'WOO-besluit', 'decisionDate' => '2026-07-13']], - ['doc-001', null, false, 'dossiq', 'document', ['id' => 'doc-001', 'title' => 'Besluit document', 'fileName' => 'besluit.pdf', 'format' => 'application/pdf', 'content' => base64_encode('public content')]], - ]); + $objectService->method('find')->willReturnCallback( + static fn (string $id, ?ObjectFindOptions $options = null): ?array => [ + 'case-001' . '|' . 'case' => ['id' => 'case-001', 'title' => 'Test case'], + 'decision-001' . '|' . 'decision' => ['id' => 'decision-001', 'decisionType' => 'WOO-besluit', 'decisionDate' => '2026-07-13'], + 'doc-001' . '|' . 'document' => ['id' => 'doc-001', 'title' => 'Besluit document', 'fileName' => 'besluit.pdf', 'format' => 'application/pdf', 'content' => base64_encode('public content')], + ][$id . '|' . (string)$options?->schema] ?? null + ); $objectService->method('searchObjectsBySlug')->willReturn([ ['documentRef' => 'doc-001', 'classification' => 'openbaar'], ]); diff --git a/tests/Unit/Service/WorkQueueServiceTest.php b/tests/Unit/Service/WorkQueueServiceTest.php index 918f56efa9..ac34ee1bb8 100644 --- a/tests/Unit/Service/WorkQueueServiceTest.php +++ b/tests/Unit/Service/WorkQueueServiceTest.php @@ -40,6 +40,7 @@ use OCA\Dossiq\Service\WorkQueueService; use OCA\Dossiq\Tests\Support\MakesCaseDateNormaliser; use OCA\Dossiq\Tests\Support\MatchesGoldenFiles; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IUserSession; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -1174,7 +1175,8 @@ class FakeWorkQueueStore { * * @return array|null The object, or null. */ - public function find(string $id, int|string|null $register = null, int|string|null $schema = null): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { + $schema = ($options?->schema ?? null); return ($this->store[(string)$schema][$id] ?? null); }//end find() @@ -1258,13 +1260,15 @@ class FailingWorkQueueStore extends FakeWorkQueueStore { * * @return array|null The object, or null. */ - public function find(string $id, int|string|null $register = null, int|string|null $schema = null): ?array { + public function find(string $id, ?ObjectFindOptions $options = null): ?array { + $register = ($options?->register ?? null); + $schema = ($options?->schema ?? null); $this->finds[(string) $schema][] = $id; if (in_array((string) $schema, $this->failOn, true) === true) { throw new \RuntimeException('down'); } - return parent::find($id, $register, $schema); + return parent::find(id: $id, options: $options); }//end find() /** diff --git a/tests/Unit/Service/Workflow/WorkflowDefinitionRepositoryUpdateTest.php b/tests/Unit/Service/Workflow/WorkflowDefinitionRepositoryUpdateTest.php index 0c01c43283..f2dfd286f8 100644 --- a/tests/Unit/Service/Workflow/WorkflowDefinitionRepositoryUpdateTest.php +++ b/tests/Unit/Service/Workflow/WorkflowDefinitionRepositoryUpdateTest.php @@ -25,6 +25,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Workflow\WorkflowDefinitionRepository; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -84,7 +85,7 @@ public function __construct(private readonly ?array $stored) { * * @return array The stored row. */ - public function find(string $id, ?string $register = null, ?string $schema = null): array { + public function find(string $id, ?ObjectFindOptions $options = null): array { if ($this->stored === null) { throw new \RuntimeException('Object not found: ' . $id); } diff --git a/tests/Unit/Service/WorkflowStepAuthorizationResolverTest.php b/tests/Unit/Service/WorkflowStepAuthorizationResolverTest.php index 9b1e5c2dd7..5f8ccbc6c0 100644 --- a/tests/Unit/Service/WorkflowStepAuthorizationResolverTest.php +++ b/tests/Unit/Service/WorkflowStepAuthorizationResolverTest.php @@ -26,6 +26,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\WorkflowStepAuthorizationResolver; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -42,12 +43,11 @@ interface AuthResolverObjectServiceStub { * Load a single object by id within a register/schema. * * @param string $id Object UUID. - * @param string $register Register id. - * @param string $schema Schema id. + * @param ObjectFindOptions|null $options Register and schema. * * @return array|null */ - public function find(string $id, string $register, string $schema): ?array; + public function find(string $id, ?ObjectFindOptions $options = null): ?array; }//end interface /** @@ -87,7 +87,7 @@ protected function setUp(): void { $objectService = $this->createMock(AuthResolverObjectServiceStub::class); $objectService->method('find')->willReturnCallback( - fn (string $id, string $register, string $schema): ?array => ($this->roleTypes[$id] ?? null) + fn (string $id, ?ObjectFindOptions $options = null): ?array => ($this->roleTypes[$id] ?? null) ); $this->settingsService->method('getObjectService')->willReturn($objectService); diff --git a/tests/Unit/Service/Zaakdossier/DocumentCorrespondentsWriteTest.php b/tests/Unit/Service/Zaakdossier/DocumentCorrespondentsWriteTest.php index 0ee5852f0d..fc7309d913 100644 --- a/tests/Unit/Service/Zaakdossier/DocumentCorrespondentsWriteTest.php +++ b/tests/Unit/Service/Zaakdossier/DocumentCorrespondentsWriteTest.php @@ -28,6 +28,7 @@ use OCA\Dossiq\Service\Zaakdossier\InformatieobjectMetadataNormaliser; use OCA\Dossiq\Service\Zaakdossier\InformatieobjectStatusLifecycle; use OCA\Dossiq\Service\ZaakdossierService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\IGroupManager; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -83,7 +84,7 @@ protected function setUp(): void { * * @return array The row. */ - public function find(string $id, string|int|null $register = null, string|int|null $schema = null): array { + public function find(string $id, ?ObjectFindOptions $options = null): array { if (isset($this->rows[$id]) === false) { throw new \OCP\AppFramework\Db\DoesNotExistException('not found: ' . $id); } diff --git a/tests/Unit/Service/Zaakdossier/DocumentRecordStoreTest.php b/tests/Unit/Service/Zaakdossier/DocumentRecordStoreTest.php index 59cdffd208..75a0fa1568 100644 --- a/tests/Unit/Service/Zaakdossier/DocumentRecordStoreTest.php +++ b/tests/Unit/Service/Zaakdossier/DocumentRecordStoreTest.php @@ -16,6 +16,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\Zaakdossier\DocumentRecordStore; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use RuntimeException; @@ -63,7 +64,7 @@ protected function setUp(): void { * * @return array The row. */ - public function find(string $id, string|int|null $register = null, string|int|null $schema = null): array { + public function find(string $id, ?ObjectFindOptions $options = null): array { if (isset($this->rows[$id]) === false) { throw new RuntimeException('not found: ' . $id); } diff --git a/tests/Unit/Service/ZaakdossierServiceTest.php b/tests/Unit/Service/ZaakdossierServiceTest.php index cf016141ff..68aca8de0d 100644 --- a/tests/Unit/Service/ZaakdossierServiceTest.php +++ b/tests/Unit/Service/ZaakdossierServiceTest.php @@ -40,6 +40,7 @@ use OCA\Dossiq\Service\Zaakdossier\InformatieobjectStatusLifecycle; use OCA\Dossiq\Service\ZaakdossierService; use OCA\Dossiq\Service\ZgwDocumentService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -77,7 +78,7 @@ public function searchObjects(array $query): array; * * @return array */ - public function find(string $id, string $register, string $schema): array; + public function find(string $id, ?ObjectFindOptions $options = null): array; /** * Save an object. diff --git a/tests/Unit/Service/Zgw/MakesZrcRuleGroup.php b/tests/Unit/Service/Zgw/MakesZrcRuleGroup.php index dafc0f1ea0..90719281ed 100644 --- a/tests/Unit/Service/Zgw/MakesZrcRuleGroup.php +++ b/tests/Unit/Service/Zgw/MakesZrcRuleGroup.php @@ -24,6 +24,7 @@ use OCA\Dossiq\Service\FieldValidator; use OCA\Dossiq\Service\SettingsService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use Psr\Log\LoggerInterface; /** @@ -73,7 +74,8 @@ private function ruleGroup(string $class, ?array $objects, array $mapping = ['so public function __construct(private array $objects, private int &$finds) { } - public function find(string $id, string $register, string $schema): mixed { + public function find(string $id, ?ObjectFindOptions $options = null): mixed { + $schema = ($options?->schema ?? ''); $this->finds++; $found = $this->objects[$id . '@' . $schema] ?? ($this->objects[$id] ?? null); if ($found instanceof \Throwable) { diff --git a/tests/Unit/Service/Zgw/RecordsBrcStoreCalls.php b/tests/Unit/Service/Zgw/RecordsBrcStoreCalls.php index 273c198e8a..7c66a690d2 100644 --- a/tests/Unit/Service/Zgw/RecordsBrcStoreCalls.php +++ b/tests/Unit/Service/Zgw/RecordsBrcStoreCalls.php @@ -22,6 +22,8 @@ namespace OCA\Dossiq\Tests\Unit\Service\Zgw; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; + /** * Records every read, write and delete, and fails the methods it is told to. */ @@ -79,7 +81,9 @@ private function record(string $method, array $arguments): void { } }//end record() - public function find(string $id, mixed $register = null, mixed $schema = null): mixed { + public function find(string $id, ?ObjectFindOptions $options = null): mixed { + $register = ($options?->register ?? null); + $schema = ($options?->schema ?? null); $this->record('find', [$id, $register, $schema]); if (array_key_exists($id, $this->objects) === false) { throw new \OCP\AppFramework\Db\DoesNotExistException('not found'); diff --git a/tests/Unit/Service/Zgw/ZgwParentStateResolverTest.php b/tests/Unit/Service/Zgw/ZgwParentStateResolverTest.php index a723405f28..aa1b4f6ee3 100644 --- a/tests/Unit/Service/Zgw/ZgwParentStateResolverTest.php +++ b/tests/Unit/Service/Zgw/ZgwParentStateResolverTest.php @@ -24,6 +24,7 @@ use OCA\Dossiq\Service\Zgw\ZgwParentStateResolver; use OCA\Dossiq\Service\ZgwMappingService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -31,7 +32,7 @@ * The ObjectService shape the resolver calls. */ interface ParentStateObjectServiceStub { - public function find(mixed $id, string $register, string $schema): mixed; + public function find(mixed $id, ?ObjectFindOptions $options = null): mixed; }//end interface /** @@ -83,7 +84,7 @@ private function resolver(bool $mapped=true, ?LoggerInterface $logger=null): Zgw private function objects(array $objects, bool $throws=false): ParentStateObjectServiceStub { $service = $this->createMock(ParentStateObjectServiceStub::class); $service->method('find')->willReturnCallback( - function (mixed $id, string $register, string $schema) use ($objects, $throws): mixed { + function (mixed $id, ?ObjectFindOptions $options = null) use ($objects, $throws): mixed { $this->asked[] = $id; if ($throws === true) { throw new \RuntimeException('register down'); diff --git a/tests/Unit/Service/Zgw/ZgwRuleLookupsTest.php b/tests/Unit/Service/Zgw/ZgwRuleLookupsTest.php index ae17ef374f..0dd3683005 100644 --- a/tests/Unit/Service/Zgw/ZgwRuleLookupsTest.php +++ b/tests/Unit/Service/Zgw/ZgwRuleLookupsTest.php @@ -26,6 +26,7 @@ use OCA\Dossiq\Service\Zgw\LookupNotCompleted; use OCA\Dossiq\Service\Zgw\ZgwRuleLookups; use OCA\OpenRegister\Exception\NotAuthorizedException; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Db\DoesNotExistException; use PHPUnit\Framework\TestCase; @@ -70,7 +71,9 @@ public function searchObjectsPaginated(array $query, bool $_rbac = true, bool $_ return ($this->search)($query); }//end searchObjectsPaginated() - public function find(string $id, string $register, string $schema): mixed { + public function find(string $id, ?ObjectFindOptions $options = null): mixed { + $register = ($options?->register ?? ''); + $schema = ($options?->schema ?? ''); $this->calls[] = ['find', $id, $register, $schema]; return ($this->find)($id); }//end find() diff --git a/tests/Unit/Service/Zgw/ZrcStatusEffectsTest.php b/tests/Unit/Service/Zgw/ZrcStatusEffectsTest.php index f9a2683d1b..7310556c17 100644 --- a/tests/Unit/Service/Zgw/ZrcStatusEffectsTest.php +++ b/tests/Unit/Service/Zgw/ZrcStatusEffectsTest.php @@ -29,6 +29,7 @@ use OCA\Dossiq\Service\Zgw\ZrcUsageRights; use OCA\Dossiq\Service\ZgwMappingService; use OCA\Dossiq\Service\ZgwService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -48,7 +49,8 @@ class ZrcEffectsObjectStore { /** @var array schemas whose find() throws */ public array $findThrows = []; - public function find(mixed $id, mixed $register=null, mixed $schema=null): mixed { + public function find(mixed $id, ?ObjectFindOptions $options = null): mixed { + $schema = ($options?->schema ?? null); if (isset($this->findThrows[(string)$schema]) === true) { throw new \RuntimeException('find failed'); } diff --git a/tests/Unit/Service/Zgw/ZrcUsageRightsTest.php b/tests/Unit/Service/Zgw/ZrcUsageRightsTest.php index 2d44fbd694..a4333b7051 100644 --- a/tests/Unit/Service/Zgw/ZrcUsageRightsTest.php +++ b/tests/Unit/Service/Zgw/ZrcUsageRightsTest.php @@ -20,6 +20,7 @@ use OCA\Dossiq\Service\Zgw\ZrcUsageRights; use OCA\Dossiq\Service\ZgwMappingService; use OCA\Dossiq\Service\ZgwService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -56,7 +57,8 @@ private function rights(): ZrcUsageRights { public function __construct(private ZrcUsageRightsTest $test) { } - public function find(mixed $id, mixed $register=null, mixed $schema=null): mixed { + public function find(mixed $id, ?ObjectFindOptions $options = null): mixed { + $schema = ($options?->schema ?? null); return $this->test->rowsOf((string)$schema)[(string)$id] ?? null; } diff --git a/tests/Unit/Service/Zgw/ZtcCrossReferenceTest.php b/tests/Unit/Service/Zgw/ZtcCrossReferenceTest.php index 606e457bda..4b5fc836b8 100644 --- a/tests/Unit/Service/Zgw/ZtcCrossReferenceTest.php +++ b/tests/Unit/Service/Zgw/ZtcCrossReferenceTest.php @@ -28,13 +28,14 @@ use OCA\Dossiq\Service\Zgw\ZtcCrossReferenceEnricher; use OCA\Dossiq\Service\Zgw\ZtcUrlValidityFilter; use OCA\Dossiq\Service\ZgwService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; /** * The ObjectService shape the ZTC classes call. */ interface ZtcCrossRefObjectServiceStub { - public function find(mixed $id, string $register, string $schema): mixed; + public function find(mixed $id, ?ObjectFindOptions $options = null): mixed; public function buildSearchQuery(array $requestParams, string $register, string $schema): array; @@ -95,7 +96,8 @@ static function (string $api, string $resource) use ($unmapped): ?array { private function objects(array $finds, array $searches=[]): ZtcCrossRefObjectServiceStub { $service = $this->createMock(ZtcCrossRefObjectServiceStub::class); $service->method('find')->willReturnCallback( - static function (mixed $id, string $register, string $schema) use ($finds): mixed { + static function (mixed $id, ?ObjectFindOptions $options = null) use ($finds): mixed { + $schema = (string)$options?->schema; $found = $finds[$schema.':'.$id] ?? null; if ($found instanceof \Throwable) { throw $found; diff --git a/tests/Unit/Service/Zgw/ZtcPublishAndDeleteChecksTest.php b/tests/Unit/Service/Zgw/ZtcPublishAndDeleteChecksTest.php index d2ce6b8f86..459c6a591b 100644 --- a/tests/Unit/Service/Zgw/ZtcPublishAndDeleteChecksTest.php +++ b/tests/Unit/Service/Zgw/ZtcPublishAndDeleteChecksTest.php @@ -26,6 +26,7 @@ use OCA\Dossiq\Service\Zgw\ZgwRuleLookups; use OCA\Dossiq\Service\Zgw\ZgwRuleResults; use OCA\Dossiq\Service\Zgw\ZtcPublishAndDeleteChecks; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Db\DoesNotExistException; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -103,7 +104,7 @@ public function searchObjectsBySlug(string $register, string $schema, array $fil return $answer; }//end searchObjectsBySlug() - public function find(int|string $id, ?array $_extend = [], bool $files = false, string|int|null $register = null, string|int|null $schema = null): array { + public function find(int|string $id, ?ObjectFindOptions $options = null): array { if ($this->caseType === null) { throw new DoesNotExistException('gone'); } diff --git a/tests/Unit/Service/ZgwBrcRulesServiceTest.php b/tests/Unit/Service/ZgwBrcRulesServiceTest.php index ca3a3391cd..aced37d9ef 100644 --- a/tests/Unit/Service/ZgwBrcRulesServiceTest.php +++ b/tests/Unit/Service/ZgwBrcRulesServiceTest.php @@ -29,6 +29,7 @@ use OCA\Dossiq\Service\FieldValidator; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\ZgwBrcRulesService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -36,7 +37,7 @@ * The ObjectService shape the BRC rules call with named arguments. */ interface BrcObjectServiceStub { - public function find(string $id, string $register, string $schema): ?array; + public function find(string $id, ?ObjectFindOptions $options = null): ?array; public function buildSearchQuery(array $requestParams, string $register, string $schema): array; @@ -95,7 +96,7 @@ private function buildService(?array $objects): ZgwBrcRulesService { if ($objects !== null) { $objectService = $this->createMock(BrcObjectServiceStub::class); $objectService->method('find')->willReturnCallback( - static function (string $id, string $register, string $schema) use ($objects): ?array { + static function (string $id, ?ObjectFindOptions $options = null) use ($objects): ?array { return $objects[$id] ?? null; } ); diff --git a/tests/Unit/Service/ZgwDrcRulesServiceTest.php b/tests/Unit/Service/ZgwDrcRulesServiceTest.php index 5e62c15bd8..5bd3efbe5a 100644 --- a/tests/Unit/Service/ZgwDrcRulesServiceTest.php +++ b/tests/Unit/Service/ZgwDrcRulesServiceTest.php @@ -29,6 +29,7 @@ use OCA\Dossiq\Service\FieldValidator; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\ZgwDrcRulesService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -36,7 +37,7 @@ * The ObjectService shape the DRC rules call with named arguments. */ interface DrcObjectServiceStub { - public function find(string $id, string $register, string $schema): ?array; + public function find(string $id, ?ObjectFindOptions $options = null): ?array; public function buildSearchQuery(array $requestParams, string $register, string $schema): array; @@ -106,7 +107,7 @@ private function buildService(?array $objects, array $mappingConfig=['sourceRegi if ($objects !== null) { $objectService = $this->createMock(DrcObjectServiceStub::class); $objectService->method('find')->willReturnCallback( - static function (string $id, string $register, string $schema) use ($objects): ?array { + static function (string $id, ?ObjectFindOptions $options = null) use ($objects): ?array { return $objects[$id] ?? null; } ); diff --git a/tests/Unit/Service/ZgwServiceStoreFailureTest.php b/tests/Unit/Service/ZgwServiceStoreFailureTest.php index 06515e3688..215d611918 100644 --- a/tests/Unit/Service/ZgwServiceStoreFailureTest.php +++ b/tests/Unit/Service/ZgwServiceStoreFailureTest.php @@ -32,6 +32,7 @@ use OCA\Dossiq\Service\ZgwMappingService; use OCA\Dossiq\Service\ZgwService; use OCA\OpenRegister\Exception\NotAuthorizedException; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Db\DoesNotExistException; use OCP\IRequest; use PHPUnit\Framework\TestCase; @@ -95,7 +96,7 @@ public function __construct( ) { }//end __construct() - public function find(string $id, mixed $register = null, mixed $schema = null): mixed { + public function find(string $id, ?ObjectFindOptions $options = null): mixed { return ($this->find)($id); }//end find() diff --git a/tests/Unit/Service/ZgwServiceWriteGoldenTest.php b/tests/Unit/Service/ZgwServiceWriteGoldenTest.php index 6a626e1b50..3c467e8f35 100644 --- a/tests/Unit/Service/ZgwServiceWriteGoldenTest.php +++ b/tests/Unit/Service/ZgwServiceWriteGoldenTest.php @@ -28,6 +28,7 @@ use OCA\Dossiq\Service\ZgwMappingService; use OCA\Dossiq\Service\ZgwService; use OCA\Dossiq\Tests\Support\MatchesGoldenFiles; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Db\DoesNotExistException; use OCP\IRequest; use PHPUnit\Framework\TestCase; @@ -93,7 +94,9 @@ public function __construct(private array $world, private ArrayObject $trace) { * * @return mixed The object. */ - public function find(string $id, mixed $register = null, mixed $schema = null): mixed { + public function find(string $id, ?ObjectFindOptions $options = null): mixed { + $register = ($options?->register ?? null); + $schema = ($options?->schema ?? null); $this->trace->append(['find', $id, $register, $schema]); $existing = (array_key_exists('existing', $this->world) === true ? $this->world['existing'] : ['id' => $id, 'name' => 'Oud', 'kept' => 'ja']); if ($existing === 'missing') { diff --git a/tests/Unit/Service/ZgwZrcCaseEntryRulesTest.php b/tests/Unit/Service/ZgwZrcCaseEntryRulesTest.php index 68434ef68c..b76ca73222 100644 --- a/tests/Unit/Service/ZgwZrcCaseEntryRulesTest.php +++ b/tests/Unit/Service/ZgwZrcCaseEntryRulesTest.php @@ -25,6 +25,7 @@ use OCA\Dossiq\Service\FieldValidator; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\ZgwZrcRulesService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -32,7 +33,7 @@ * The ObjectService shape the entry rules call with named arguments. */ interface CaseEntryObjectServiceStub { - public function find(string $id, string $register, string $schema): mixed; + public function find(string $id, ?ObjectFindOptions $options = null): mixed; }//end interface /** diff --git a/tests/Unit/Service/ZgwZrcCaseFieldRulesTest.php b/tests/Unit/Service/ZgwZrcCaseFieldRulesTest.php index a758cf8ef4..cb42a2d194 100644 --- a/tests/Unit/Service/ZgwZrcCaseFieldRulesTest.php +++ b/tests/Unit/Service/ZgwZrcCaseFieldRulesTest.php @@ -30,6 +30,7 @@ use OCA\Dossiq\Service\FieldValidator; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\ZgwZrcRulesService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -37,7 +38,7 @@ * The ObjectService shape the rules base calls with named arguments. */ interface CaseFieldObjectServiceStub { - public function find(string $id, string $register, string $schema): ?array; + public function find(string $id, ?ObjectFindOptions $options = null): ?array; }//end interface /** @@ -101,7 +102,7 @@ private function buildService(?array $objects): ZgwZrcRulesService { if ($objects !== null) { $objectService = $this->createMock(CaseFieldObjectServiceStub::class); $objectService->method('find')->willReturnCallback( - static function (string $id, string $register, string $schema) use ($objects): ?array { + static function (string $id, ?ObjectFindOptions $options = null) use ($objects): ?array { return $objects[$id] ?? null; } ); diff --git a/tests/Unit/Service/ZgwZrcRulesServiceTest.php b/tests/Unit/Service/ZgwZrcRulesServiceTest.php index 5687f95a92..1b082a08fb 100644 --- a/tests/Unit/Service/ZgwZrcRulesServiceTest.php +++ b/tests/Unit/Service/ZgwZrcRulesServiceTest.php @@ -26,6 +26,7 @@ use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\ZgwZrcRulesService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -42,7 +43,7 @@ * calls resolve correctly. */ interface ObjectServiceStub { - public function find(string $id, string $register, string $schema): ?array; + public function find(string $id, ?ObjectFindOptions $options = null): ?array; public function buildSearchQuery(array $requestParams, string $register, string $schema): array; @@ -156,7 +157,7 @@ public function testHoofdzaakNotFoundReturnsDoesNotExist(): void { // Zaaktype lookup returns a valid (published) zaaktype; hoofdzaak lookup returns null. $objectService = $this->createMock(ObjectServiceStub::class); $objectService->method('find')->willReturnCallback( - static function (string $id, string $register, string $schema) use ($zaaktypeUuid): ?array { + static function (string $id, ?ObjectFindOptions $options = null) use ($zaaktypeUuid): ?array { if ($id === $zaaktypeUuid) { return [ 'id' => $zaaktypeUuid, diff --git a/tests/Unit/Service/ZgwZtcReferenceRulesTest.php b/tests/Unit/Service/ZgwZtcReferenceRulesTest.php index a705158e2d..628e2d6f97 100644 --- a/tests/Unit/Service/ZgwZtcReferenceRulesTest.php +++ b/tests/Unit/Service/ZgwZtcReferenceRulesTest.php @@ -29,6 +29,7 @@ use OCA\Dossiq\Service\FieldValidator; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\ZgwZtcRulesService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -36,7 +37,7 @@ * The ObjectService shape the ZTC rules call with named arguments. */ interface ZtcObjectServiceStub { - public function find(string $id, string $register, string $schema): ?array; + public function find(string $id, ?ObjectFindOptions $options = null): ?array; public function buildSearchQuery(array $requestParams, string $register, string $schema): array; @@ -84,7 +85,7 @@ private function buildService(?array $searches, array $objects=[]): ZgwZtcRulesS if ($searches !== null) { $objectService = $this->createMock(ZtcObjectServiceStub::class); $objectService->method('find')->willReturnCallback( - static fn (string $id, string $register, string $schema): ?array => $objects[$id] ?? null + static fn (string $id, ?ObjectFindOptions $options = null): ?array => $objects[$id] ?? null ); $objectService->method('buildSearchQuery')->willReturnCallback( static fn (array $requestParams, string $register, string $schema): array => $requestParams diff --git a/tests/Unit/Service/ZgwZtcRulesServiceTest.php b/tests/Unit/Service/ZgwZtcRulesServiceTest.php index 1b3faf2288..bc69e774fd 100644 --- a/tests/Unit/Service/ZgwZtcRulesServiceTest.php +++ b/tests/Unit/Service/ZgwZtcRulesServiceTest.php @@ -23,6 +23,7 @@ use OCA\Dossiq\Service\FieldValidator; use OCA\Dossiq\Service\SettingsService; use OCA\Dossiq\Service\ZgwZtcRulesService; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -103,10 +104,7 @@ public function searchObjects(array $query): array { */ public function find( int|string $id, - ?array $_extend = [], - bool $files = false, - string|int|null $register = null, - string|int|null $schema = null, + ?ObjectFindOptions $options = null, ): object { foreach ($this->map as $rows) { foreach ($rows as $row) { @@ -251,7 +249,7 @@ public function searchObjectsBySlug(string $register, string $schema, array $fil return ($this->search)($register, $schema, $filters); } - public function find(int|string $id, ?array $_extend = [], bool $files = false, string|int|null $register = null, string|int|null $schema = null): mixed { + public function find(int|string $id, ?ObjectFindOptions $options = null): mixed { if ($this->find === null) { throw new \OCP\AppFramework\Db\DoesNotExistException('gone'); } diff --git a/tests/Unit/Settings/WooPublicationFieldsShippedTest.php b/tests/Unit/Settings/WooPublicationFieldsShippedTest.php index 6281831898..7262583074 100644 --- a/tests/Unit/Settings/WooPublicationFieldsShippedTest.php +++ b/tests/Unit/Settings/WooPublicationFieldsShippedTest.php @@ -48,6 +48,7 @@ use OCA\Dossiq\Service\WooPublicationService; use OCA\OpenRegister\Contract\ObjectEntityInterface; use OCA\OpenRegister\Contract\ObjectServiceInterface; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\App\IAppManager; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -142,7 +143,8 @@ public function testAPublishedDecisionCanBeWithdrawn(): void { $store = $this->createMock(ObjectServiceInterface::class); $store->method('find')->willReturnCallback( - function (int|string $id, ?array $_extend = [], bool $files = false, string|int|null $register = null, string|int|null $schema = null): ?ObjectEntityInterface { + function (int|string $id, ?ObjectFindOptions $options = null): ?ObjectEntityInterface { + $schema = ($options?->schema ?? null); $row = ($this->rows[(string)$schema][(string)$id] ?? null); if ($row === null) { return null; diff --git a/tests/Unit/Woo/WooDossierReturnTest.php b/tests/Unit/Woo/WooDossierReturnTest.php index 3f9aaf862d..ae6836f5cb 100644 --- a/tests/Unit/Woo/WooDossierReturnTest.php +++ b/tests/Unit/Woo/WooDossierReturnTest.php @@ -24,6 +24,7 @@ use OCA\Dossiq\Tests\Support\InMemoryRegister; use OCA\Dossiq\Woo\WooDecisionNotice; use OCA\Dossiq\Woo\WooDossierReturn; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\Security\ISecureRandom; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -76,12 +77,14 @@ protected function setUp(): void { * * @return array|null */ - public function find(int|string $id, mixed $_extend = null, bool $files = false, int|string $register = '', int|string $schema = '', bool $_rbac = true, bool $_multitenancy = true): ?array { + public function find(int|string $id, ?ObjectFindOptions $options = null, bool $_rbac = true, bool $_multitenancy = true): ?array { + $register = ($options?->register ?? ''); + $schema = ($options?->schema ?? ''); if ((string)$schema === 'collection' && ($_rbac === true || $_multitenancy === true)) { return null; } - return parent::find(id: $id, register: $register, schema: $schema); + return parent::find(id: $id, options: $options); } /** diff --git a/tests/Unit/Woo/WooRequestIntakeTest.php b/tests/Unit/Woo/WooRequestIntakeTest.php index 250e8802e6..daa6f4547b 100644 --- a/tests/Unit/Woo/WooRequestIntakeTest.php +++ b/tests/Unit/Woo/WooRequestIntakeTest.php @@ -27,6 +27,7 @@ use OCA\Dossiq\BackgroundJob\LinkCollectionToCaseJob; use OCA\Dossiq\Service\Intake\CollectionLinkQueue; use OCA\Dossiq\Service\ServiceAccount\BackgroundServiceAccount; +use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions; use OCP\AppFramework\Utility\ITimeFactory; use OCP\BackgroundJob\IJobList; use OCP\IURLGenerator; @@ -213,18 +214,17 @@ private function anonymousStore(InMemoryRegister $seeded): InMemoryRegister { */ public function find( int|string $id, - mixed $_extend = null, - bool $files = false, - int|string $register = '', - int|string $schema = '', + ?ObjectFindOptions $options = null, bool $_rbac = true, bool $_multitenancy = true, ): ?array { + $register = ($options?->register ?? ''); + $schema = ($options?->schema ?? ''); if ($_rbac === true || $_multitenancy === true) { return null; } - return parent::find(id: $id, register: $register, schema: $schema); + return parent::find(id: $id, options: $options); } /** diff --git a/tests/Unit/golden/case-sharing-service.json b/tests/Unit/golden/case-sharing-service.json index e4a0fa79de..f8008d2cb4 100644 --- a/tests/Unit/golden/case-sharing-service.json +++ b/tests/Unit/golden/case-sharing-service.json @@ -1265,8 +1265,14 @@ { "objects.find": { "id": "share-7", - "register": 5, - "schema": 9 + "options": { + "register": 5, + "schema": 9, + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { @@ -1295,8 +1301,14 @@ { "objects.find": { "id": "share-7", - "register": 5, - "schema": 9 + "options": { + "register": 5, + "schema": 9, + "extend": [], + "files": false, + "render": true, + "audit": true + } } } ] @@ -1322,8 +1334,14 @@ { "objects.find": { "id": "share-7", - "register": 5, - "schema": 9 + "options": { + "register": 5, + "schema": 9, + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { @@ -1352,8 +1370,14 @@ { "objects.find": { "id": "share-7", - "register": 5, - "schema": 9 + "options": { + "register": 5, + "schema": 9, + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { @@ -1382,8 +1406,14 @@ { "objects.find": { "id": "share-7", - "register": 5, - "schema": 9 + "options": { + "register": 5, + "schema": 9, + "extend": [], + "files": false, + "render": true, + "audit": true + } } } ] @@ -1409,8 +1439,14 @@ { "objects.find": { "id": "share-7", - "register": 5, - "schema": 9 + "options": { + "register": 5, + "schema": 9, + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { @@ -1513,8 +1549,14 @@ { "objects.find": { "id": "share-7", - "register": 0, - "schema": 9 + "options": { + "register": 0, + "schema": 9, + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { @@ -1550,8 +1592,14 @@ { "objects.find": { "id": "share-7", - "register": 5, - "schema": 9 + "options": { + "register": 5, + "schema": 9, + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { @@ -1629,8 +1677,14 @@ { "objects.find": { "id": "share-7", - "register": 5, - "schema": 9 + "options": { + "register": 5, + "schema": 9, + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { @@ -1709,8 +1763,14 @@ { "objects.find": { "id": "share-7", - "register": 5, - "schema": 9 + "options": { + "register": 5, + "schema": 9, + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { @@ -1783,8 +1843,14 @@ { "objects.find": { "id": "share-7", - "register": 5, - "schema": 9 + "options": { + "register": 5, + "schema": 9, + "extend": [], + "files": false, + "render": true, + "audit": true + } } } ] @@ -1813,8 +1879,14 @@ { "objects.find": { "id": "share-7", - "register": 5, - "schema": 9 + "options": { + "register": 5, + "schema": 9, + "extend": [], + "files": false, + "render": true, + "audit": true + } } } ] diff --git a/tests/Unit/golden/case-transfer-service.json b/tests/Unit/golden/case-transfer-service.json index d49e473ce3..a7d37fa8a1 100644 --- a/tests/Unit/golden/case-transfer-service.json +++ b/tests/Unit/golden/case-transfer-service.json @@ -1128,8 +1128,14 @@ { "objects.find": { "id": "t-1", - "register": 5, - "schema": 7 + "options": { + "register": 5, + "schema": 7, + "extend": [], + "files": false, + "render": true, + "audit": true + } } } ] @@ -1162,8 +1168,14 @@ { "objects.find": { "id": "t-1", - "register": 5, - "schema": 7 + "options": { + "register": 5, + "schema": 7, + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { @@ -1185,8 +1197,14 @@ { "objects.find": { "id": "t-1", - "register": 5, - "schema": 7 + "options": { + "register": 5, + "schema": 7, + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { @@ -1208,8 +1226,14 @@ { "objects.find": { "id": "t-1", - "register": 5, - "schema": 7 + "options": { + "register": 5, + "schema": 7, + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { @@ -1253,8 +1277,14 @@ { "objects.find": { "id": "t-1", - "register": 5, - "schema": 7 + "options": { + "register": 5, + "schema": 7, + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { @@ -1363,8 +1393,14 @@ { "objects.find": { "id": "t-1", - "register": 5, - "schema": 7 + "options": { + "register": 5, + "schema": 7, + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { @@ -1473,8 +1509,14 @@ { "objects.find": { "id": "t-1", - "register": 5, - "schema": 7 + "options": { + "register": 5, + "schema": 7, + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { @@ -1583,8 +1625,14 @@ { "objects.find": { "id": "t-1", - "register": 5, - "schema": 7 + "options": { + "register": 5, + "schema": 7, + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { @@ -1672,8 +1720,14 @@ { "objects.find": { "id": "t-1", - "register": 5, - "schema": 7 + "options": { + "register": 5, + "schema": 7, + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { @@ -1706,8 +1760,14 @@ { "objects.find": { "id": "t-1", - "register": 5, - "schema": 7 + "options": { + "register": 5, + "schema": 7, + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { @@ -1761,8 +1821,14 @@ { "objects.find": { "id": "t-1", - "register": 5, - "schema": 7 + "options": { + "register": 5, + "schema": 7, + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { @@ -1868,8 +1934,14 @@ { "objects.find": { "id": "t-1", - "register": 5, - "schema": 7 + "options": { + "register": 5, + "schema": 7, + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { @@ -1964,8 +2036,14 @@ { "objects.find": { "id": "t-1", - "register": 5, - "schema": 7 + "options": { + "register": 5, + "schema": 7, + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { @@ -2062,8 +2140,14 @@ { "objects.find": { "id": "t-1", - "register": 11, - "schema": 13 + "options": { + "register": 11, + "schema": 13, + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { @@ -2173,8 +2257,14 @@ { "objects.find": { "id": "t-1", - "register": 5, - "schema": 7 + "options": { + "register": 5, + "schema": 7, + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { @@ -2275,8 +2365,14 @@ { "objects.find": { "id": "t-1", - "register": 5, - "schema": 7 + "options": { + "register": 5, + "schema": 7, + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { @@ -2377,8 +2473,14 @@ { "objects.find": { "id": "t-1", - "register": 5, - "schema": 7 + "options": { + "register": 5, + "schema": 7, + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { @@ -2479,8 +2581,14 @@ { "objects.find": { "id": "t-1", - "register": 5, - "schema": 7 + "options": { + "register": 5, + "schema": 7, + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { @@ -2572,8 +2680,14 @@ { "objects.find": { "id": "t-1", - "register": 5, - "schema": 7 + "options": { + "register": 5, + "schema": 7, + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { @@ -2595,8 +2709,14 @@ { "objects.find": { "id": "t-1", - "register": 5, - "schema": 7 + "options": { + "register": 5, + "schema": 7, + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { @@ -2618,8 +2738,14 @@ { "objects.find": { "id": "t-1", - "register": 5, - "schema": 7 + "options": { + "register": 5, + "schema": 7, + "extend": [], + "files": false, + "render": true, + "audit": true + } } } ] @@ -2646,8 +2772,14 @@ { "objects.find": { "id": "t-1", - "register": 5, - "schema": 7 + "options": { + "register": 5, + "schema": 7, + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { @@ -2667,8 +2799,14 @@ { "objects.find": { "id": "t-1", - "register": 5, - "schema": 7 + "options": { + "register": 5, + "schema": 7, + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { @@ -2688,8 +2826,14 @@ { "objects.find": { "id": "t-1", - "register": 5, - "schema": 7 + "options": { + "register": 5, + "schema": 7, + "extend": [], + "files": false, + "render": true, + "audit": true + } } } ] @@ -2706,8 +2850,14 @@ { "objects.find": { "id": "t-1", - "register": 5, - "schema": 7 + "options": { + "register": 5, + "schema": 7, + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { @@ -2727,8 +2877,14 @@ { "objects.find": { "id": "t-1", - "register": 5, - "schema": 7 + "options": { + "register": 5, + "schema": 7, + "extend": [], + "files": false, + "render": true, + "audit": true + } } } ] @@ -2745,8 +2901,14 @@ { "objects.find": { "id": "t-1", - "register": 5, - "schema": 7 + "options": { + "register": 5, + "schema": 7, + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { diff --git a/tests/Unit/golden/dso-case-service.json b/tests/Unit/golden/dso-case-service.json index 09c3489b73..800f761552 100644 --- a/tests/Unit/golden/dso-case-service.json +++ b/tests/Unit/golden/dso-case-service.json @@ -26,8 +26,14 @@ "ObjectServiceInterface::find", { "id": "case-1", - "register": "dossiq", - "schema": "case" + "options": { + "register": "dossiq", + "schema": "case", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -55,8 +61,14 @@ "ObjectServiceInterface::find", { "id": "va-1", - "register": "dso", - "schema": "aanvraag" + "options": { + "register": "dso", + "schema": "aanvraag", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -111,8 +123,14 @@ "ObjectServiceInterface::find", { "id": "case-1", - "register": "dossiq", - "schema": "case" + "options": { + "register": "dossiq", + "schema": "case", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -138,8 +156,14 @@ "ObjectServiceInterface::find", { "id": "va-1", - "register": "dso", - "schema": "aanvraag" + "options": { + "register": "dso", + "schema": "aanvraag", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -194,8 +218,14 @@ "ObjectServiceInterface::find", { "id": "case-1", - "register": "dossiq", - "schema": "case" + "options": { + "register": "dossiq", + "schema": "case", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -222,8 +252,14 @@ "ObjectServiceInterface::find", { "id": "va-1", - "register": "dso", - "schema": "aanvraag" + "options": { + "register": "dso", + "schema": "aanvraag", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -278,8 +314,14 @@ "ObjectServiceInterface::find", { "id": "case-1", - "register": "dossiq", - "schema": "case" + "options": { + "register": "dossiq", + "schema": "case", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -306,8 +348,14 @@ "ObjectServiceInterface::find", { "id": "va-1", - "register": "dso", - "schema": "aanvraag" + "options": { + "register": "dso", + "schema": "aanvraag", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -364,8 +412,14 @@ "ObjectServiceInterface::find", { "id": "case-1", - "register": "dossiq", - "schema": "case" + "options": { + "register": "dossiq", + "schema": "case", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -393,8 +447,14 @@ "ObjectServiceInterface::find", { "id": "va-1", - "register": "dso", - "schema": "aanvraag" + "options": { + "register": "dso", + "schema": "aanvraag", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -451,8 +511,14 @@ "ObjectServiceInterface::find", { "id": "case-1", - "register": "dossiq", - "schema": "case" + "options": { + "register": "dossiq", + "schema": "case", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -480,8 +546,14 @@ "ObjectServiceInterface::find", { "id": "va-1", - "register": "dso", - "schema": "aanvraag" + "options": { + "register": "dso", + "schema": "aanvraag", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -538,8 +610,14 @@ "ObjectServiceInterface::find", { "id": "case-1", - "register": "dossiq", - "schema": "case" + "options": { + "register": "dossiq", + "schema": "case", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -567,8 +645,14 @@ "ObjectServiceInterface::find", { "id": "va-1", - "register": "dso", - "schema": "aanvraag" + "options": { + "register": "dso", + "schema": "aanvraag", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -625,8 +709,14 @@ "ObjectServiceInterface::find", { "id": "case-1", - "register": "dossiq", - "schema": "case" + "options": { + "register": "dossiq", + "schema": "case", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -684,8 +774,14 @@ "ObjectServiceInterface::find", { "id": "case-1", - "register": "dossiq", - "schema": "case" + "options": { + "register": "dossiq", + "schema": "case", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -713,8 +809,14 @@ "ObjectServiceInterface::find", { "id": "va-1", - "register": "dso", - "schema": "aanvraag" + "options": { + "register": "dso", + "schema": "aanvraag", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -758,8 +860,14 @@ "ObjectServiceInterface::find", { "id": "case-1", - "register": "dossiq", - "schema": "case" + "options": { + "register": "dossiq", + "schema": "case", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -824,8 +932,14 @@ "ObjectServiceInterface::find", { "id": "case-1", - "register": "dossiq", - "schema": "case" + "options": { + "register": "dossiq", + "schema": "case", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -853,8 +967,14 @@ "ObjectServiceInterface::find", { "id": "va-1", - "register": "dso", - "schema": "aanvraag" + "options": { + "register": "dso", + "schema": "aanvraag", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -917,8 +1037,14 @@ "ObjectServiceInterface::find", { "id": "case-1", - "register": "dossiq", - "schema": "case" + "options": { + "register": "dossiq", + "schema": "case", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ] ], @@ -948,8 +1074,14 @@ "ObjectServiceInterface::find", { "id": "case-1", - "register": "dossiq", - "schema": "case" + "options": { + "register": "dossiq", + "schema": "case", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ] ], @@ -979,8 +1111,14 @@ "ObjectServiceInterface::find", { "id": "case-1", - "register": "dossiq", - "schema": "case" + "options": { + "register": "dossiq", + "schema": "case", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ] ], @@ -1010,8 +1148,14 @@ "ObjectServiceInterface::find", { "id": "case-1", - "register": "dossiq", - "schema": "case" + "options": { + "register": "dossiq", + "schema": "case", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -1052,8 +1196,14 @@ "ObjectServiceInterface::find", { "id": "case-1", - "register": "dossiq", - "schema": "case" + "options": { + "register": "dossiq", + "schema": "case", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -1081,8 +1231,14 @@ "ObjectServiceInterface::find", { "id": "va-1", - "register": "dso", - "schema": "aanvraag" + "options": { + "register": "dso", + "schema": "aanvraag", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -1139,8 +1295,14 @@ "ObjectServiceInterface::find", { "id": "case-1", - "register": "", - "schema": "" + "options": { + "register": "", + "schema": "", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -1168,8 +1330,14 @@ "ObjectServiceInterface::find", { "id": "va-1", - "register": "dso", - "schema": "aanvraag" + "options": { + "register": "dso", + "schema": "aanvraag", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -1295,8 +1463,14 @@ "ObjectServiceInterface::find", { "id": "va-1", - "register": "dso", - "schema": "aanvraag" + "options": { + "register": "dso", + "schema": "aanvraag", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -1381,8 +1555,14 @@ "ObjectServiceInterface::find", { "id": "va-1", - "register": "dso", - "schema": "aanvraag" + "options": { + "register": "dso", + "schema": "aanvraag", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ] ], @@ -1405,8 +1585,14 @@ "ObjectServiceInterface::find", { "id": "va-1", - "register": "dso", - "schema": "aanvraag" + "options": { + "register": "dso", + "schema": "aanvraag", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ] ], diff --git a/tests/Unit/golden/objection-decision-service.json b/tests/Unit/golden/objection-decision-service.json index 26737a841e..272afc3c42 100644 --- a/tests/Unit/golden/objection-decision-service.json +++ b/tests/Unit/golden/objection-decision-service.json @@ -349,8 +349,14 @@ "ObjectServiceInterface::find", { "id": "dec-1", - "register": "reg", - "schema": "dec" + "options": { + "register": "reg", + "schema": "dec", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -467,8 +473,14 @@ "ObjectServiceInterface::find", { "id": "dec-1", - "register": "reg", - "schema": "dec" + "options": { + "register": "reg", + "schema": "dec", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -596,8 +608,14 @@ "ObjectServiceInterface::find", { "id": "dec-1", - "register": "reg", - "schema": "dec" + "options": { + "register": "reg", + "schema": "dec", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -716,8 +734,14 @@ "ObjectServiceInterface::find", { "id": "dec-1", - "register": "reg", - "schema": "dec" + "options": { + "register": "reg", + "schema": "dec", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -835,8 +859,14 @@ "ObjectServiceInterface::find", { "id": "dec-1", - "register": "reg", - "schema": "dec" + "options": { + "register": "reg", + "schema": "dec", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -942,8 +972,14 @@ "ObjectServiceInterface::find", { "id": "dec-1", - "register": "reg", - "schema": "dec" + "options": { + "register": "reg", + "schema": "dec", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -1027,8 +1063,14 @@ "ObjectServiceInterface::find", { "id": "dec-1", - "register": "reg", - "schema": "dec" + "options": { + "register": "reg", + "schema": "dec", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -1112,8 +1154,14 @@ "ObjectServiceInterface::find", { "id": "dec-1", - "register": "reg", - "schema": "dec" + "options": { + "register": "reg", + "schema": "dec", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -1202,8 +1250,14 @@ "ObjectServiceInterface::find", { "id": "dec-1", - "register": "reg", - "schema": "dec" + "options": { + "register": "reg", + "schema": "dec", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ] ], @@ -1237,8 +1291,14 @@ "ObjectServiceInterface::find", { "id": "dec-1", - "register": "reg", - "schema": "dec" + "options": { + "register": "reg", + "schema": "dec", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ] ], @@ -1272,8 +1332,14 @@ "ObjectServiceInterface::find", { "id": "dec-1", - "register": "reg", - "schema": "dec" + "options": { + "register": "reg", + "schema": "dec", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ] ], @@ -1307,8 +1373,14 @@ "ObjectServiceInterface::find", { "id": "dec-1", - "register": "reg", - "schema": "dec" + "options": { + "register": "reg", + "schema": "dec", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -1360,8 +1432,14 @@ "ObjectServiceInterface::find", { "id": "dec-1", - "register": "reg", - "schema": "dec" + "options": { + "register": "reg", + "schema": "dec", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -1435,8 +1513,14 @@ "ObjectServiceInterface::find", { "id": "dec-1", - "register": "reg", - "schema": "dec" + "options": { + "register": "reg", + "schema": "dec", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -1504,8 +1588,14 @@ "ObjectServiceInterface::find", { "id": "dec-1", - "register": "reg", - "schema": "dec" + "options": { + "register": "reg", + "schema": "dec", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -1635,8 +1725,14 @@ "ObjectServiceInterface::find", { "id": "dec-1", - "register": "reg", - "schema": "dec" + "options": { + "register": "reg", + "schema": "dec", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -1808,8 +1904,14 @@ "ObjectServiceInterface::find", { "id": "obj-1", - "register": "reg", - "schema": "obj" + "options": { + "register": "reg", + "schema": "obj", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -1846,8 +1948,14 @@ "ObjectServiceInterface::find", { "id": "obj-1", - "register": "reg", - "schema": "obj" + "options": { + "register": "reg", + "schema": "obj", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ] ], @@ -1876,8 +1984,14 @@ "ObjectServiceInterface::find", { "id": "obj-1", - "register": "reg", - "schema": "obj" + "options": { + "register": "reg", + "schema": "obj", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ] ], @@ -1906,8 +2020,14 @@ "ObjectServiceInterface::find", { "id": "obj-1", - "register": "reg", - "schema": "obj" + "options": { + "register": "reg", + "schema": "obj", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -2004,8 +2124,14 @@ "ObjectServiceInterface::find", { "id": "obj-1", - "register": "reg", - "schema": "obj" + "options": { + "register": "reg", + "schema": "obj", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ] ], @@ -2039,8 +2165,14 @@ "ObjectServiceInterface::find", { "id": "obj-1", - "register": "reg", - "schema": "obj" + "options": { + "register": "reg", + "schema": "obj", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ] ], @@ -2069,8 +2201,14 @@ "ObjectServiceInterface::find", { "id": "obj-1", - "register": "reg", - "schema": "obj" + "options": { + "register": "reg", + "schema": "obj", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ] ], @@ -2143,8 +2281,14 @@ "ObjectServiceInterface::find", { "id": "dec-1", - "register": "reg", - "schema": "dec" + "options": { + "register": "reg", + "schema": "dec", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ], [ @@ -2167,8 +2311,14 @@ "ObjectServiceInterface::find", { "id": "obj-1", - "register": "reg", - "schema": "obj" + "options": { + "register": "reg", + "schema": "obj", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ] ], @@ -2202,8 +2352,14 @@ "ObjectServiceInterface::find", { "id": "dec-1", - "register": "reg", - "schema": "dec" + "options": { + "register": "reg", + "schema": "dec", + "extend": [], + "files": false, + "render": true, + "audit": true + } } ] ], diff --git a/tests/Unit/golden/objection-guard-listeners/appeal-on-create.json b/tests/Unit/golden/objection-guard-listeners/appeal-on-create.json index 002c110c43..733cb6238b 100644 --- a/tests/Unit/golden/objection-guard-listeners/appeal-on-create.json +++ b/tests/Unit/golden/objection-guard-listeners/appeal-on-create.json @@ -11,8 +11,14 @@ { "find": { "id": "b-1", - "register": "reg", - "schema": "objection" + "options": { + "register": "reg", + "schema": "objection", + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { diff --git a/tests/Unit/golden/objection-guard-listeners/appeal-on-update.json b/tests/Unit/golden/objection-guard-listeners/appeal-on-update.json index 002c110c43..733cb6238b 100644 --- a/tests/Unit/golden/objection-guard-listeners/appeal-on-update.json +++ b/tests/Unit/golden/objection-guard-listeners/appeal-on-update.json @@ -11,8 +11,14 @@ { "find": { "id": "b-1", - "register": "reg", - "schema": "objection" + "options": { + "register": "reg", + "schema": "objection", + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { diff --git a/tests/Unit/golden/objection-guard-listeners/appeal-schema-by-url.json b/tests/Unit/golden/objection-guard-listeners/appeal-schema-by-url.json index 002c110c43..733cb6238b 100644 --- a/tests/Unit/golden/objection-guard-listeners/appeal-schema-by-url.json +++ b/tests/Unit/golden/objection-guard-listeners/appeal-schema-by-url.json @@ -11,8 +11,14 @@ { "find": { "id": "b-1", - "register": "reg", - "schema": "objection" + "options": { + "register": "reg", + "schema": "objection", + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, { diff --git a/tests/Unit/golden/objection-guard-listeners/appeal-schema-slug-at-the-top.json b/tests/Unit/golden/objection-guard-listeners/appeal-schema-slug-at-the-top.json index 002c110c43..733cb6238b 100644 --- a/tests/Unit/golden/objection-guard-listeners/appeal-schema-slug-at-the-top.json +++ b/tests/Unit/golden/objection-guard-listeners/appeal-schema-slug-at-the-top.json @@ -11,8 +11,14 @@ { "find": { "id": "b-1", - "register": "reg", - "schema": "objection" + "options": { + "register": "reg", + "schema": "objection", + "extend": [], + "files": false, + "render": true, + "audit": true + } } }, {