<?php

namespace App\Enums;

enum PaymentStatus: string
{
    case Pending  = 'pending';
    case Paid     = 'paid';
    case Failed   = 'failed';
    case Refunded = 'refunded';

    public function label(): string
    {
        return match($this) {
            self::Pending  => 'Ausstehend',
            self::Paid     => 'Bezahlt',
            self::Failed   => 'Fehlgeschlagen',
            self::Refunded => 'Erstattet',
        };
    }

    public function badgeBg(): string
    {
        return match($this) {
            self::Pending  => 'bg-amber-50',
            self::Paid     => 'bg-green-50',
            self::Failed   => 'bg-red-50',
            self::Refunded => 'bg-blue-50',
        };
    }

    public function badgeText(): string
    {
        return match($this) {
            self::Pending  => 'text-amber-700',
            self::Paid     => 'text-green-700',
            self::Failed   => 'text-red-700',
            self::Refunded => 'text-blue-700',
        };
    }

    public function icon(): string
    {
        return match($this) {
            self::Pending  => 'clock',
            self::Paid     => 'check',
            self::Failed   => 'x-mark',
            self::Refunded => 'arrow-uturn-left',
        };
    }
}
