<?php

namespace App\Enums;

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

enum PaymentStatus: int
{
    use WithCommentEnum, WithValueEnum;

    case PENDING = 1;
    case PAID = 2;
    case FAILED = 3;
    case REFUNDED = 4;

    public function label(): string
    {
        return match ($this) {
            self::PENDING => 'Menunggu',
            self::PAID => 'Dibayar',
            self::FAILED => 'Gagal',
            self::REFUNDED => 'Dikembalikan',
        };
    }

    public function color(): string
    {
        return match ($this) {
            self::PENDING => 'amber',
            self::PAID => 'emerald',
            self::FAILED => 'red',
            self::REFUNDED => 'gray',
        };
    }
}
