them log, chinh upload
This commit is contained in:
@@ -2,6 +2,14 @@
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
/**
|
||||
* Contract Status Enum
|
||||
*
|
||||
* Để thêm trạng thái mới:
|
||||
* 1. Thêm case mới vào enum
|
||||
* 2. Thêm label trong lang/vi/enums.php và lang/en/enums.php
|
||||
* 3. Reload browser
|
||||
*/
|
||||
enum ContractStatus: string
|
||||
{
|
||||
case ACTIVE = 'active';
|
||||
@@ -17,12 +25,19 @@ enum ContractStatus: string
|
||||
};
|
||||
}
|
||||
|
||||
public function options(): array
|
||||
public function color(): string
|
||||
{
|
||||
return [
|
||||
self::ACTIVE->value => self::ACTIVE->label(),
|
||||
self::EXPIRED->value => self::EXPIRED->label(),
|
||||
self::LIQUIDATED->value => self::LIQUIDATED->label(),
|
||||
];
|
||||
return match ($this) {
|
||||
self::ACTIVE => 'success',
|
||||
self::EXPIRED => 'warning',
|
||||
self::LIQUIDATED => 'danger',
|
||||
};
|
||||
}
|
||||
|
||||
public static function options(): array
|
||||
{
|
||||
return collect(self::cases())->mapWithKeys(fn ($case) => [
|
||||
$case->value => $case->label(),
|
||||
])->toArray();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,14 @@
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
/**
|
||||
* Contract Type Enum
|
||||
*
|
||||
* Để thêm loại hợp đồng mới:
|
||||
* 1. Thêm case mới vào enum
|
||||
* 2. Thêm label trong lang/vi/enums.php và lang/en/enums.php
|
||||
* 3. Reload browser
|
||||
*/
|
||||
enum ContractType: string
|
||||
{
|
||||
case SALE = 'sale';
|
||||
@@ -17,12 +25,19 @@ enum ContractType: string
|
||||
};
|
||||
}
|
||||
|
||||
public function color(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::SALE => 'success',
|
||||
self::LEASE => 'info',
|
||||
self::BCC => 'warning',
|
||||
};
|
||||
}
|
||||
|
||||
public static function options(): array
|
||||
{
|
||||
return [
|
||||
self::SALE->value => self::SALE->label(),
|
||||
self::LEASE->value => self::LEASE->label(),
|
||||
self::BCC->value => self::BCC->label(),
|
||||
];
|
||||
return collect(self::cases())->mapWithKeys(fn ($case) => [
|
||||
$case->value => $case->label(),
|
||||
])->toArray();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,14 @@
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
/**
|
||||
* Handover Status Enum
|
||||
*
|
||||
* Để thêm trạng thái mới:
|
||||
* 1. Thêm case mới vào enum
|
||||
* 2. Thêm label trong lang/vi/enums.php và lang/en/enums.php
|
||||
* 3. Reload browser
|
||||
*/
|
||||
enum HandoverStatus: string
|
||||
{
|
||||
case NOT_READY = 'chua_du_dieu_kien';
|
||||
@@ -19,13 +27,20 @@ enum HandoverStatus: string
|
||||
};
|
||||
}
|
||||
|
||||
public function options(): array
|
||||
public function color(): string
|
||||
{
|
||||
return [
|
||||
self::NOT_READY->value => self::NOT_READY->label(),
|
||||
self::READY->value => self::READY->label(),
|
||||
self::SCHEDULED->value => self::SCHEDULED->label(),
|
||||
self::HANDED_OVER->value => self::HANDED_OVER->label(),
|
||||
];
|
||||
return match ($this) {
|
||||
self::NOT_READY => 'danger',
|
||||
self::READY => 'warning',
|
||||
self::HANDED_OVER => 'success',
|
||||
self::SCHEDULED => 'info',
|
||||
};
|
||||
}
|
||||
|
||||
public static function options(): array
|
||||
{
|
||||
return collect(self::cases())->mapWithKeys(fn ($case) => [
|
||||
$case->value => $case->label(),
|
||||
])->toArray();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,14 @@
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
/**
|
||||
* Service Type Enum
|
||||
*
|
||||
* Để thêm loại dịch vụ mới:
|
||||
* 1. Thêm case mới vào enum
|
||||
* 2. Thêm label trong lang/vi/enums.php và lang/en/enums.php
|
||||
* 3. Reload browser
|
||||
*/
|
||||
enum ServiceType: string
|
||||
{
|
||||
case MANAGEMENT_FEE = 'management_fee';
|
||||
@@ -17,12 +25,19 @@ enum ServiceType: string
|
||||
};
|
||||
}
|
||||
|
||||
public function options(): array
|
||||
public function color(): string
|
||||
{
|
||||
return [
|
||||
self::MANAGEMENT_FEE->value => self::MANAGEMENT_FEE->label(),
|
||||
self::GRATITUDE->value => self::GRATITUDE->label(),
|
||||
self::SELF_BUSINESS->value => self::SELF_BUSINESS->label(),
|
||||
];
|
||||
return match ($this) {
|
||||
self::MANAGEMENT_FEE => 'info',
|
||||
self::GRATITUDE => 'success',
|
||||
self::SELF_BUSINESS => 'warning',
|
||||
};
|
||||
}
|
||||
|
||||
public static function options(): array
|
||||
{
|
||||
return collect(self::cases())->mapWithKeys(fn ($case) => [
|
||||
$case->value => $case->label(),
|
||||
])->toArray();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user