Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
SignRequestStatus
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 getLabel
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5/**
6 * SPDX-FileCopyrightText: 2025 LibreCode coop and contributors
7 * SPDX-License-Identifier: AGPL-3.0-or-later
8 */
9
10namespace OCA\Libresign\Enum;
11
12use OCP\IL10N;
13
14enum SignRequestStatus: int {
15    case DRAFT = 0;
16    case ABLE_TO_SIGN = 1;
17    case SIGNED = 2;
18    case REJECTED = 3;
19    case OBSERVING = 4;
20
21    public function getLabel(IL10N $l10n): string {
22        return match($this) {
23            // TRANSLATORS Signer workflow status shown before the request is ready to be signed.
24            self::DRAFT => $l10n->t('Draft'),
25            // TRANSLATORS Signer workflow status shown when the signer is currently allowed to apply their digital signature.
26            self::ABLE_TO_SIGN => $l10n->t('Ready to sign'),
27            // TRANSLATORS Signer workflow status shown after this signer has successfully signed the document.
28            self::SIGNED => $l10n->t('Signed'),
29            // TRANSLATORS Signer workflow status shown after this signer refused to sign the document.
30            self::REJECTED => $l10n->t('Rejected'),
31            // TRANSLATORS Workflow status shown when an observer can view the document but cannot sign it.
32            self::OBSERVING => $l10n->t('Observing'),
33        };
34    }
35}