From 123168a5eeaea4d93fec977a8532c247ba7603db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 22 Jul 2024 23:40:38 +0200 Subject: [PATCH] Effectively process signature request The processSignature method in SignatureRequestController has been cleaned up and unneeded comments were removed. The process now involves retrieving the EntityWorkflow and StoredObject from the Signature, and reading the content from the StoredObjectManager. Debugging dump functions and commented code were also removed for a cleaner look. --- .../Controller/SignatureRequestController.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/Bundle/ChillDocStoreBundle/Controller/SignatureRequestController.php b/src/Bundle/ChillDocStoreBundle/Controller/SignatureRequestController.php index 3dd99a814..363ecafd4 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/SignatureRequestController.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/SignatureRequestController.php @@ -33,21 +33,18 @@ class SignatureRequestController #[Route('/api/1.0/document/workflow/{id}/signature-request', name: 'chill_docstore_signature_request')] public function processSignature(EntityWorkflowStepSignature $signature, Request $request): JsonResponse { - dump($signature); - // $signature = $this->signatureRepository($signature); //not useful? - // $entityWorkflow = $signature->getStep()->getEntityWorkflow(); - // $storedObject = $this->entityWorkflowManager->getAssociatedStoredObject($entityWorkflow); - $content = 'blop'; // $this->storedObjectManager->read($storedObject); + $entityWorkflow = $signature->getStep()->getEntityWorkflow(); + $storedObject = $this->entityWorkflowManager->getAssociatedStoredObject($entityWorkflow); + $content = $this->storedObjectManager->read($storedObject); $data = \json_decode((string) $request->getContent(), true, 512, JSON_THROW_ON_ERROR); // TODO parse payload: json_decode ou, mieux, dataTransfertObject - dump($data); $zone = new PDFSignatureZone( $data['zone']['index'], $data['zone']['x'], $data['zone']['y'], $data['zone']['height'], $data['zone']['width'], - $page = new PDFPage($data['zone']['PDFPage']['index'], $data['zone']['PDFPage']['width'], $data['zone']['PDFPage']['height']) + new PDFPage($data['zone']['PDFPage']['index'], $data['zone']['PDFPage']['width'], $data['zone']['PDFPage']['height']) ); $this->messageBus->dispatch(new RequestPdfSignMessage(