<?php

namespace Modules\Core\Enums;

enum PaymentMethodEnum: string
{
    case CASH = 'cash';
    case BANK = 'bank';
    case CHECK = 'check';
    case MOBILE_BANKING = 'mobile_banking';
    case OTHER = 'other';

    public static function casesAsArray(): array
    {
        return array_map(fn(self $case) => $case->value, self::cases());
    }

    public function getLabel(): ?string
    {
        return match ($this) {
            self::CASH => 'Cash',
            self::BANK => 'Bank',
            self::CHECK => 'Check',
            self::MOBILE_BANKING => 'Mobile Banking',
            self::OTHER => 'Other',
        };
    }
}
