Skip to content

Commit 158a9d5

Browse files
refactor: move SignatureFlow enum to dedicated Enum directory
Move SignatureFlow from lib/Service/ to lib/Enum/ to centralize all enum definitions in the same location following project structure conventions. Updated namespace from OCA\Libresign\Service to OCA\Libresign\Enum and adjusted all imports and references across: - AdminController (updated FQN references for from() and comparison) - PageController (updated FQN reference) - TemplateLoader (updated FQN reference) - Settings/Admin (updated import statement) - SequentialSigningService (added explicit import) This completes the consolidation of enum types, making the codebase more organized and easier to maintain. Signed-off-by: Vitor Mattos <[email protected]>
1 parent 6556009 commit 158a9d5

5 files changed

Lines changed: 7 additions & 6 deletions

File tree

lib/Controller/AdminController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -908,15 +908,15 @@ public function footerTemplatePreviewPdf(string $template = '', int $width = 595
908908
#[ApiRoute(verb: 'POST', url: '/api/{apiVersion}/admin/signature-flow/config', requirements: ['apiVersion' => '(v1)'])]
909909
public function setSignatureFlowConfig(string $mode): DataResponse {
910910
try {
911-
$signatureFlow = \OCA\Libresign\Service\SignatureFlow::from($mode);
911+
$signatureFlow = \OCA\Libresign\Enum\SignatureFlow::from($mode);
912912
} catch (\ValueError) {
913913
return new DataResponse([
914914
'error' => $this->l10n->t('Invalid signature flow mode. Use "parallel" or "ordered_numeric".'),
915915
], Http::STATUS_BAD_REQUEST);
916916
}
917917

918918
try {
919-
if ($signatureFlow === \OCA\Libresign\Service\SignatureFlow::PARALLEL) {
919+
if ($signatureFlow === \OCA\Libresign\Enum\SignatureFlow::PARALLEL) {
920920
$this->appConfig->deleteKey(Application::APP_ID, 'signature_flow');
921921
} else {
922922
$this->appConfig->setValueString(

lib/Controller/PageController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function index(): TemplateResponse {
9595

9696
$this->provideSignerSignatues();
9797
$this->initialState->provideInitialState('identify_methods', $this->identifyMethodService->getIdentifyMethodsSettings());
98-
$this->initialState->provideInitialState('signature_flow', $this->appConfig->getValueString(Application::APP_ID, 'signature_flow', \OCA\Libresign\Service\SignatureFlow::PARALLEL->value));
98+
$this->initialState->provideInitialState('signature_flow', $this->appConfig->getValueString(Application::APP_ID, 'signature_flow', \OCA\Libresign\Enum\SignatureFlow::PARALLEL->value));
9999
$this->initialState->provideInitialState('legal_information', $this->appConfig->getValueString(Application::APP_ID, 'legal_information'));
100100

101101
Util::addScript(Application::APP_ID, 'libresign-main');
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<?php
22

33
declare(strict_types=1);
4+
45
/**
56
* SPDX-FileCopyrightText: 2025 LibreCode coop and contributors
67
* SPDX-License-Identifier: AGPL-3.0-or-later
78
*/
89

9-
namespace OCA\Libresign\Service;
10+
namespace OCA\Libresign\Enum;
1011

1112
/**
1213
* Signature flow modes

lib/Files/TemplateLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function handle(Event $event): void {
5959

6060
$this->initialState->provideInitialState(
6161
'signature_flow',
62-
$this->appConfig->getValueString(Application::APP_ID, 'signature_flow', \OCA\Libresign\Service\SignatureFlow::PARALLEL->value)
62+
$this->appConfig->getValueString(Application::APP_ID, 'signature_flow', \OCA\Libresign\Enum\SignatureFlow::PARALLEL->value)
6363
);
6464

6565
try {

lib/Settings/Admin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
namespace OCA\Libresign\Settings;
1010

1111
use OCA\Libresign\AppInfo\Application;
12+
use OCA\Libresign\Enum\SignatureFlow;
1213
use OCA\Libresign\Exception\LibresignException;
1314
use OCA\Libresign\Handler\CertificateEngine\CertificateEngineFactory;
1415
use OCA\Libresign\Service\CertificatePolicyService;
1516
use OCA\Libresign\Service\DocMdpConfigService;
1617
use OCA\Libresign\Service\FooterService;
1718
use OCA\Libresign\Service\IdentifyMethodService;
1819
use OCA\Libresign\Service\SignatureBackgroundService;
19-
use OCA\Libresign\Service\SignatureFlow;
2020
use OCA\Libresign\Service\SignatureTextService;
2121
use OCP\AppFramework\Http\TemplateResponse;
2222
use OCP\AppFramework\Services\IInitialState;

0 commit comments

Comments
 (0)