Co-authored-by: manoel freitas <manoel.josefneto@gmail.com> Co-committed-by: manoel freitas <manoel.josefneto@gmail.com>
46 lines
1.1 KiB
PHP
46 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Domain\Marketing;
|
|
|
|
/**
|
|
* Public portfolio verticals used to separate Casamentos and Corporate proof.
|
|
*
|
|
* Matching is intentionally tolerant of free-text `event_type` values already
|
|
* stored in the CMS (e.g. "Casamento", "Mini wedding", "Corporativo").
|
|
*/
|
|
enum PortfolioVertical: string
|
|
{
|
|
case Casamentos = 'casamentos';
|
|
case Corporate = 'corporate';
|
|
|
|
public function label(): string
|
|
{
|
|
return match ($this) {
|
|
self::Casamentos => 'Casamentos',
|
|
self::Corporate => 'Corporate',
|
|
};
|
|
}
|
|
|
|
/**
|
|
* @return list<string>
|
|
*/
|
|
public function eventTypePatterns(): array
|
|
{
|
|
return match ($this) {
|
|
self::Casamentos => ['%casamento%', '%wedding%', '%social%'],
|
|
self::Corporate => ['%corporat%', '%empresa%', '%business%'],
|
|
};
|
|
}
|
|
|
|
public static function tryFromQuery(?string $value): ?self
|
|
{
|
|
if ($value === null || $value === '') {
|
|
return null;
|
|
}
|
|
|
|
return self::tryFrom($value);
|
|
}
|
|
}
|