Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 7 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| SubscriptionStatus | |
0.00% |
0 / 7 |
|
0.00% |
0 / 2 |
42 | |
0.00% |
0 / 1 |
| label | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
30 | |||
| allowsUsage | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace ImovelZapAi\Organizations\Domain\Enums; |
| 6 | |
| 7 | enum SubscriptionStatus: string |
| 8 | { |
| 9 | case Trialing = 'trialing'; |
| 10 | case Active = 'active'; |
| 11 | case PastDue = 'past_due'; |
| 12 | case Canceled = 'canceled'; |
| 13 | |
| 14 | public function label(): string |
| 15 | { |
| 16 | return match ($this) { |
| 17 | self::Trialing => 'PerĂodo de teste', |
| 18 | self::Active => 'Ativo', |
| 19 | self::PastDue => 'Pagamento pendente', |
| 20 | self::Canceled => 'Cancelado', |
| 21 | }; |
| 22 | } |
| 23 | |
| 24 | public function allowsUsage(): bool |
| 25 | { |
| 26 | return in_array($this, [self::Trialing, self::Active], true); |
| 27 | } |
| 28 | } |