Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
10 / 10 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| DealLostReason | |
100.00% |
10 / 10 |
|
100.00% |
2 / 2 |
9 | |
100.00% |
1 / 1 |
| label | |
100.00% |
9 / 9 |
|
100.00% |
1 / 1 |
8 | |||
| values | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace ImovelZapAi\Sales\Domain\Enums; |
| 6 | |
| 7 | enum DealLostReason: string |
| 8 | { |
| 9 | case Price = 'price'; |
| 10 | case Location = 'location'; |
| 11 | case Competition = 'competition'; |
| 12 | case Financing = 'financing'; |
| 13 | case NoResponse = 'no_response'; |
| 14 | case ChangedMind = 'changed_mind'; |
| 15 | case Other = 'other'; |
| 16 | |
| 17 | public function label(): string |
| 18 | { |
| 19 | return match ($this) { |
| 20 | self::Price => 'Preço', |
| 21 | self::Location => 'Localização', |
| 22 | self::Competition => 'Concorrência', |
| 23 | self::Financing => 'Financiamento', |
| 24 | self::NoResponse => 'Sem resposta', |
| 25 | self::ChangedMind => 'Desistiu', |
| 26 | self::Other => 'Outro', |
| 27 | }; |
| 28 | } |
| 29 | |
| 30 | /** @return list<string> */ |
| 31 | public static function values(): array |
| 32 | { |
| 33 | return array_map(static fn (self $c) => $c->value, self::cases()); |
| 34 | } |
| 35 | } |