Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
VisitOutcome
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
2 / 2
7
100.00% covered (success)
100.00%
1 / 1
 label
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
1 / 1
6
 values
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace ImovelZapAi\Visits\Domain\Enums;
6
7enum VisitOutcome: string
8{
9    case Interested = 'interested';
10    case WantsProposal = 'wants_proposal';
11    case WantsAnotherProperty = 'wants_another_property';
12    case NotInterested = 'not_interested';
13    case NegotiationStarted = 'negotiation_started';
14
15    public function label(): string
16    {
17        return match ($this) {
18            self::Interested => 'Cliente interessado',
19            self::WantsProposal => 'Deseja proposta',
20            self::WantsAnotherProperty => 'Quer visitar outro imóvel',
21            self::NotInterested => 'Sem interesse',
22            self::NegotiationStarted => 'Negociação iniciada',
23        };
24    }
25
26    /** @return list<string> */
27    public static function values(): array
28    {
29        return array_map(static fn (self $case) => $case->value, self::cases());
30    }
31}