Version 2.0

This commit is contained in:
2026-05-12 09:23:05 +00:00
parent f2bc048219
commit f1b68e5e78
34 changed files with 564 additions and 283 deletions

View File

@@ -0,0 +1,39 @@
<?php
namespace App\Enums;
/**
* Contract Category Enum Phân loại hợp đồng cấp cao
*
* Mỗi căn hộ chỉ tối đa 1 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();
}
}