first commit
This commit is contained in:
28
app/Enums/ExpenseCategory.php
Normal file
28
app/Enums/ExpenseCategory.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum ExpenseCategory: string
|
||||
{
|
||||
case Alcohol = 'alcohol';
|
||||
case Narcotic = 'narcotic';
|
||||
case Solutions = 'solutions';
|
||||
case Medicines = 'medicines';
|
||||
case Dressing = 'dressing';
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::Alcohol => 'Спирт',
|
||||
self::Narcotic => 'Наркотики',
|
||||
self::Solutions => 'Растворы',
|
||||
self::Medicines => 'Медикаменты',
|
||||
self::Dressing => 'Перевязка / ИМН',
|
||||
};
|
||||
}
|
||||
|
||||
public function countsTowardsWithoutDressing(): bool
|
||||
{
|
||||
return $this !== self::Dressing;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user