Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions lib/BulkAction/LifecycleCasesAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

use InvalidArgumentException;
use OCA\Dossiq\Kernel\Contracts\CaseLifecycleServiceInterface;
use OCA\OpenRegister\BulkAction\BulkActionInterface;
use OCA\OpenRegister\BulkAction\StepBulkActionInterface;
use OCA\OpenRegister\BulkAction\BulkActionResult;
use OCA\OpenRegister\BulkAction\BulkStep;
use OCP\IL10N;
Expand All @@ -51,7 +51,7 @@
* design so the four outcomes read as four named things rather than as four
* flags. There is no instance to call, so the rule cannot be satisfied here.
*/
class LifecycleCasesAction implements BulkActionInterface {
class LifecycleCasesAction implements StepBulkActionInterface {

use ReadsCaseObject;

Expand Down
6 changes: 3 additions & 3 deletions lib/BulkAction/MoveCaseTypeVersionAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
use InvalidArgumentException;
use OCA\Dossiq\Exception\RefusedException;
use OCA\Dossiq\Kernel\Contracts\CaseVersionMoveInterface;
use OCA\OpenRegister\BulkAction\BulkActionInterface;
use OCA\OpenRegister\BulkAction\StepBulkActionInterface;
use OCA\OpenRegister\BulkAction\BulkActionResult;
use OCA\OpenRegister\BulkAction\BulkStep;
use OCP\IL10N;
Expand Down Expand Up @@ -63,7 +63,7 @@
* design so the four outcomes read as four named things rather than as four
* flags. There is no instance to call, so the rule cannot be satisfied here.
*/
class MoveCaseTypeVersionAction implements BulkActionInterface {
class MoveCaseTypeVersionAction implements StepBulkActionInterface {

use ReadsCaseObject;

Expand Down Expand Up @@ -150,7 +150,7 @@ public function requiresJustification(): bool {
* @spec openspec/specs/zaaktype-versioning/spec.md
*/
public function getGuards(): array {
return [BulkActionInterface::GUARD_HOMOGENEITY];
return [StepBulkActionInterface::GUARD_HOMOGENEITY];
}//end getGuards()

/**
Expand Down
4 changes: 2 additions & 2 deletions lib/BulkAction/ReassignCasesAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

use InvalidArgumentException;
use OCA\Dossiq\Kernel\Contracts\CaseAssigneeWriterInterface;
use OCA\OpenRegister\BulkAction\BulkActionInterface;
use OCA\OpenRegister\BulkAction\StepBulkActionInterface;
use OCA\OpenRegister\BulkAction\BulkActionResult;
use OCA\OpenRegister\BulkAction\BulkStep;
use OCP\IL10N;
Expand Down Expand Up @@ -52,7 +52,7 @@
* design so the four outcomes read as four named things rather than as four
* flags. There is no instance to call, so the rule cannot be satisfied here.
*/
class ReassignCasesAction implements BulkActionInterface {
class ReassignCasesAction implements StepBulkActionInterface {

use ReadsCaseObject;

Expand Down
6 changes: 3 additions & 3 deletions lib/BulkAction/SetCaseAttributeAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

use InvalidArgumentException;
use OCA\Dossiq\Kernel\Contracts\SettingsServiceInterface;
use OCA\OpenRegister\BulkAction\BulkActionInterface;
use OCA\OpenRegister\BulkAction\StepBulkActionInterface;
use OCA\OpenRegister\BulkAction\BulkActionResult;
use OCA\OpenRegister\BulkAction\BulkStep;
use OCP\IL10N;
Expand Down Expand Up @@ -56,7 +56,7 @@
* design so the four outcomes read as four named things rather than as four
* flags. There is no instance to call, so the rule cannot be satisfied here.
*/
class SetCaseAttributeAction implements BulkActionInterface {
class SetCaseAttributeAction implements StepBulkActionInterface {

use ReadsCaseObject;

Expand Down Expand Up @@ -159,7 +159,7 @@ public function requiresJustification(): bool {
* @spec openspec/specs/case-management/spec.md
*/
public function getGuards(): array {
return [BulkActionInterface::GUARD_HOMOGENEITY];
return [StepBulkActionInterface::GUARD_HOMOGENEITY];
}//end getGuards()

/**
Expand Down
4 changes: 2 additions & 2 deletions lib/BulkAction/TransitionCasesAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
use InvalidArgumentException;
use OCA\Dossiq\Kernel\Contracts\StatusTransitionServiceInterface;
use OCA\Dossiq\Service\Transitions\GuardFailedException;
use OCA\OpenRegister\BulkAction\BulkActionInterface;
use OCA\OpenRegister\BulkAction\StepBulkActionInterface;
use OCA\OpenRegister\BulkAction\BulkActionResult;
use OCA\OpenRegister\BulkAction\BulkStep;
use OCP\IL10N;
Expand All @@ -52,7 +52,7 @@
* design so the four outcomes read as four named things rather than as four
* flags. There is no instance to call, so the rule cannot be satisfied here.
*/
class TransitionCasesAction implements BulkActionInterface {
class TransitionCasesAction implements StepBulkActionInterface {

use ReadsCaseObject;

Expand Down
7 changes: 6 additions & 1 deletion lib/Command/DrainIntakeObjectsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
use OCA\Dossiq\Kernel\Contracts\IntakeObjectDrainInterface;
use OCA\Dossiq\Kernel\Contracts\SettingsServiceInterface;
use OCA\Dossiq\Service\Support\SearchesObjects;
use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindTarget;
use OCA\OpenRegister\Kernel\Contracts\Value\ObjectSaveOptions;
use OCP\IGroupManager;
use OCP\IUser;
use OCP\IUserSession;
Expand Down Expand Up @@ -374,7 +376,10 @@ private function markSource(PortalDrainSetup $setup, array $source, string $case
$payload = array_merge($source, [(string)self::PLAN['deliveredField'] => $caseId]);
unset($payload['@self'], $payload['id'], $payload['uuid']);

$setup->objectService->saveObject(object: $payload, register: $setup->register, schema: $setup->sourceSchema, uuid: $sourceId);
$setup->objectService->saveObject(
object: $payload,
options: new ObjectSaveOptions(target: new ObjectFindTarget(register: $setup->register, schema: $setup->sourceSchema), uuid: $sourceId)
);
}//end markSource()

/**
Expand Down
3 changes: 2 additions & 1 deletion lib/Controller/AccruingAmountController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
use OCA\Dossiq\Kernel\Contracts\CaseAccessGuardInterface;
use OCA\Dossiq\Kernel\Contracts\OwningCaseResolverInterface;
use OCA\Dossiq\Kernel\Contracts\SettingsServiceInterface;
use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\JSONResponse;
Expand Down Expand Up @@ -177,7 +178,7 @@ public function show(string $id): JSONResponse {
}

try {
$row = $objectService->find($id, register: $register, schema: $schema);
$row = $objectService->find($id, new ObjectFindOptions(register: $register, schema: $schema));
} catch (Throwable $e) {
return new JSONResponse(['message' => 'Not found'], Http::STATUS_NOT_FOUND);
}
Expand Down
7 changes: 6 additions & 1 deletion lib/Controller/BelplanController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
use OCA\Dossiq\Settings\AdminSettings;
use OCA\OpenRegister\Exception\CustomValidationException as OpenRegisterCustomValidationException;
use OCA\OpenRegister\Exception\ValidationException as OpenRegisterValidationException;
use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindTarget;
use OCA\OpenRegister\Kernel\Contracts\Value\ObjectSaveOptions;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Attribute\AuthorizedAdminSetting;
Expand Down Expand Up @@ -179,7 +181,10 @@ private function saveBelplan(array $store, array $record): JSONResponse {
[$objectService, $register, $schema] = $store;

try {
$created = $objectService->saveObject(object: $record, register: $register, schema: $schema);
$created = $objectService->saveObject(
object: $record,
options: new ObjectSaveOptions(target: new ObjectFindTarget(register: $register, schema: $schema))
);
} catch (OpenRegisterValidationException | OpenRegisterCustomValidationException $e) {
// The same shape TaskChecklistController carries: a payload
// OpenRegister's schema refuses came back as a 500, so an admin who
Expand Down
10 changes: 7 additions & 3 deletions lib/Controller/BrcController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
use OCA\Dossiq\Kernel\Contracts\SettingsServiceInterface;
use OCA\Dossiq\Kernel\Contracts\ZgwServiceInterface;
use OCA\Dossiq\Service\Zgw\BrcHelperFactory;
use OCA\OpenRegister\Kernel\Contracts\Value\ObjectDeletion;
use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindOptions;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Attribute\AnonRateLimit;
use OCP\AppFramework\Http\JSONResponse;
Expand Down Expand Up @@ -448,8 +450,10 @@ private function deleteDecision(object $objectService, array $mappingConfig, str
try {
$existingObj = $objectService->find(
$uuid,
register: $mappingConfig['sourceRegister'],
schema: $mappingConfig['sourceSchema']
new ObjectFindOptions(
register: $mappingConfig['sourceRegister'],
schema: $mappingConfig['sourceSchema']
)
);
} catch (\Throwable $e) {
return $this->zgwService->storeFailureResponse(error: $e, operation: 'BRC delete besluit', object: $object);
Expand Down Expand Up @@ -508,7 +512,7 @@ private function validateAndDeleteDecision(object $objectService, mixed $existin
$this->sync->deleteOiosForDecision(decisionUrl: $decisionUrl);

// Delete the besluit itself.
$objectService->deleteObject(uuid: $uuid);
$objectService->deleteObject(new ObjectDeletion(uuid: $uuid));

return null;
}//end validateAndDeleteDecision()
Expand Down
4 changes: 3 additions & 1 deletion lib/Controller/CaseLifecycleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
use OCA\Dossiq\Kernel\Contracts\CaseLifecycleServiceInterface;
use OCA\Dossiq\Kernel\Contracts\SettingsServiceInterface;
use OCA\Dossiq\Kernel\Contracts\StatusTransitionServiceInterface;
use OCA\OpenRegister\Kernel\Contracts\Value\ObjectDeletion;
use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindTarget;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
Expand Down Expand Up @@ -262,7 +264,7 @@ private function recycle(string $caseId): array {
}

try {
$objectService->deleteObject(uuid: $caseId, register: $register, schema: $schema);
$objectService->deleteObject(new ObjectDeletion(uuid: $caseId, target: new ObjectFindTarget(register: $register, schema: $schema)));
} catch (\Throwable $e) {
$this->rethrowDeleteFailure(e: $e, caseId: $caseId);
}
Expand Down
12 changes: 10 additions & 2 deletions lib/Controller/ComplaintCategoryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
use OCA\Dossiq\Kernel\Contracts\ComplaintAccessGuardInterface;
use OCA\Dossiq\Kernel\Contracts\SettingsServiceInterface;
use OCA\Dossiq\Service\Support\SearchesObjects;
use OCA\OpenRegister\Kernel\Contracts\Value\ObjectFindTarget;
use OCA\OpenRegister\Kernel\Contracts\Value\ObjectSaveOptions;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\JSONResponse;
Expand Down Expand Up @@ -125,7 +127,10 @@ public function createCategory(): JSONResponse {
$data = array_diff_key($data, ['id' => true, 'uuid' => true, '@self' => true]);
$register = $this->settingsService->getConfigValue('register');
$schema = $this->settingsService->getConfigValue('complaint_category_schema');
$category = $objectService->saveObject(object: $data, register: $register, schema: $schema);
$category = $objectService->saveObject(
object: $data,
options: new ObjectSaveOptions(target: new ObjectFindTarget(register: $register, schema: $schema))
);

if (is_array($category) === true) {
return new JSONResponse($category, Http::STATUS_CREATED);
Expand Down Expand Up @@ -158,7 +163,10 @@ public function updateCategory(string $id): JSONResponse {
$data = $this->accessGuard->parseBody();
$register = $this->settingsService->getConfigValue('register');
$schema = $this->settingsService->getConfigValue('complaint_category_schema');
$result = $objectService->saveObject(object: $data, register: $register, schema: $schema, uuid: (string)$id);
$result = $objectService->saveObject(
object: $data,
options: new ObjectSaveOptions(target: new ObjectFindTarget(register: $register, schema: $schema), uuid: (string)$id)
);

if (is_array($result) === true) {
return new JSONResponse($result);
Expand Down
Loading
Loading