<?php

namespace App\Enums;

use App\Traits\WithCommentEnum;
use App\Traits\WithValueEnum;

enum PaymentMethod: int
{
    use WithCommentEnum, WithValueEnum;

    case CASH = 1;
    case TRANSFER = 2;
    case QRIS = 3;
    case OTHER = 4;

    public function label(): string
    {
        return match ($this) {
            self::CASH => 'Tunai',
            self::TRANSFER => 'Transfer Bank',
            self::QRIS => 'QRIS',
            self::OTHER => 'Lainnya',
        };
    }

    public function color(): string
    {
        return match ($this) {
            self::CASH => 'emerald',
            self::TRANSFER => 'blue',
            self::QRIS => 'purple',
            self::OTHER => 'gray',
        };
    }
}
