• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

LibreSign / libresign / 22047397566

16 Feb 2026 01:47AM UTC coverage: 51.605%. First build
22047397566

Pull #6891

github

web-flow
Merge cc204601c into bdac9dc51
Pull Request #6891: feat: add id doc approver workflow

171 of 424 new or added lines in 24 files covered. (40.33%)

9145 of 17721 relevant lines covered (51.61%)

6.15 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

25.0
/lib/Service/IdDocsPolicyService.php
1
<?php
2

3
declare(strict_types=1);
4
/**
5
 * SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
6
 * SPDX-License-Identifier: AGPL-3.0-or-later
7
 */
8

9
namespace OCA\Libresign\Service;
10

11
use OCA\Libresign\AppInfo\Application;
12
use OCA\Libresign\Db\IdDocsMapper;
13
use OCA\Libresign\Enum\FileStatus;
14
use OCA\Libresign\Helper\ValidateHelper;
15
use OCP\AppFramework\Db\DoesNotExistException;
16
use OCP\IAppConfig;
17
use OCP\IUser;
18

19
class IdDocsPolicyService {
20
        public function __construct(
21
                private IAppConfig $appConfig,
22
                private ValidateHelper $validateHelper,
23
                private IdDocsMapper $idDocsMapper,
24
        ) {
25
        }
56✔
26

27
        public function canApproverSignIdDoc(IUser $user, int $fileId, int $status): bool {
28
                if (!$this->appConfig->getValueBool(Application::APP_ID, 'identification_documents', false)) {
1✔
29
                        return false;
1✔
30
                }
NEW
31
                if (!$this->validateHelper->userCanApproveValidationDocuments($user, false)) {
×
NEW
32
                        return false;
×
33
                }
NEW
34
                $readyStatuses = [FileStatus::ABLE_TO_SIGN->value, FileStatus::PARTIAL_SIGNED->value];
×
NEW
35
                if (!in_array($status, $readyStatuses, true)) {
×
NEW
36
                        return false;
×
37
                }
38
                try {
NEW
39
                        $this->idDocsMapper->getByFileId($fileId);
×
NEW
40
                        return true;
×
NEW
41
                } catch (DoesNotExistException) {
×
NEW
42
                        return false;
×
43
                }
44
        }
45
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc