You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
679 B
27 lines
679 B
<?php
|
|
|
|
namespace App\Domains\Admission\Enums;
|
|
|
|
use App\Domains\System\Traits\Enum\HasPredicateMethod;
|
|
use App\UI\Enums\Concerns\InteractsWithLabels;
|
|
use App\UI\Enums\Contracts\HasLabel;
|
|
|
|
enum BillingCycle: string implements HasLabel
|
|
{
|
|
use HasPredicateMethod;
|
|
use InteractsWithLabels;
|
|
|
|
case ONCE = 'once';
|
|
case MONTHLY = 'monthly';
|
|
case SEMESTER = 'semester';
|
|
case ANNUAL = 'annual';
|
|
|
|
public static function tryFromPMB(string $label): ?self
|
|
{
|
|
return match ($label) {
|
|
'Awal Masuk', 'Tagihan Insidentil' => self::ONCE,
|
|
'Tagihan per Semester' => self::SEMESTER,
|
|
default => self::MONTHLY,
|
|
};
|
|
}
|
|
}
|
|
|