Files
minicrm/app/Enums/ContractCategory.php
2026-05-12 09:23:05 +00:00

40 lines
1.0 KiB
PHP

<?php
namespace App\Enums;
/**
* Contract Category Enum — Phân loại hợp đồng cấp cao
*
* Mỗi căn hộ chỉ có tối đa 1 HĐ active mỗi category tại cùng thời điểm.
* - ownership: Sở hữu (đặt cọc, mua bán, chuyển nhượng...)
* - business: Kinh doanh (cho thuê, tự doanh, hợp tác KD...)
*/
enum ContractCategory: string
{
case OWNERSHIP = 'ownership';
case BUSINESS = 'business';
public function label(): string
{
return match ($this) {
self::OWNERSHIP => __('enums.contract_category.ownership'),
self::BUSINESS => __('enums.contract_category.business'),
};
}
public function color(): string
{
return match ($this) {
self::OWNERSHIP => 'success',
self::BUSINESS => 'info',
};
}
public static function options(): array
{
return collect(self::cases())->mapWithKeys(fn ($case) => [
$case->value => $case->label(),
])->toArray();
}
}