Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
15 / 15
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
SignatureRequestStatus
100.00% covered (success)
100.00%
15 / 15
100.00% covered (success)
100.00%
2 / 2
9
100.00% covered (success)
100.00%
1 / 1
 label
100.00% covered (success)
100.00%
9 / 9
100.00% covered (success)
100.00%
1 / 1
8
 isOpen
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace ImovelZapAi\Signatures\Domain\Enums;
6
7enum SignatureRequestStatus: string
8{
9    case Draft = 'draft';
10    case InReview = 'in_review';
11    case AwaitingSignatures = 'awaiting_signatures';
12    case PartiallySigned = 'partially_signed';
13    case Signed = 'signed';
14    case Cancelled = 'cancelled';
15    case Expired = 'expired';
16
17    public function label(): string
18    {
19        return match ($this) {
20            self::Draft => 'Rascunho',
21            self::InReview => 'Em revisão',
22            self::AwaitingSignatures => 'Aguardando assinaturas',
23            self::PartiallySigned => 'Parcialmente assinado',
24            self::Signed => 'Assinado',
25            self::Cancelled => 'Cancelado',
26            self::Expired => 'Expirado',
27        };
28    }
29
30    public function isOpen(): bool
31    {
32        return in_array($this, [
33            self::Draft,
34            self::InReview,
35            self::AwaitingSignatures,
36            self::PartiallySigned,
37        ], true);
38    }
39}