From c9b7ec5016689c8436091c22c2c6f8630e96388a Mon Sep 17 00:00:00 2001 From: Robert Zondervan Date: Wed, 7 Feb 2024 13:05:52 +0100 Subject: [PATCH] Sync cases on trigger --- src/Command/ZaakCommand.php | 2 +- src/Service/ZaakService.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Command/ZaakCommand.php b/src/Command/ZaakCommand.php index 0b05810..0363dfd 100644 --- a/src/Command/ZaakCommand.php +++ b/src/Command/ZaakCommand.php @@ -92,7 +92,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->zaakService->setStyle($style); $zaakId = $input->getArgument('id'); - $action = $this->entityManager->getRepository('App:Action')->findOneBy(['reference' => 'https://development.zaaksysteem.nl/action/xxllnc.Zaak.action.json']); + $action = $this->entityManager->getRepository(Action::class)->findOneBy(['reference' => 'https://development.zaaksysteem.nl/action/xxllnc.Zaak.action.json']); if ($action instanceof Action === null) { $style->error('Action with reference https://development.zaaksysteem.nl/action/xxllnc.Zaak.action.json not found'); diff --git a/src/Service/ZaakService.php b/src/Service/ZaakService.php index ddda107..c678a7f 100644 --- a/src/Service/ZaakService.php +++ b/src/Service/ZaakService.php @@ -329,7 +329,7 @@ private function createFileEndpoints(ObjectEntity $zaak): void * * @return ObjectEntity The resulting zaak object. */ - public function syncCase(array $case, bool $flush = true): ObjectEntity + public function syncCase(array $case, bool $flush = true): ?ObjectEntity { // 0. Get required config objects. $zaakSchema = $this->resourceService->getSchema( @@ -473,6 +473,10 @@ public function zaakHandler(?array $data = [], ?array $configuration = []) return null; } + if (isset($data['caseId']) === true) { + $this->getZaak($configuration, $data['caseId']); + } + isset($this->style) === true && $this->zaakTypeService->setStyle($this->style); // Fetch the xxllnc cases.