<?php

namespace App\Enums;

enum SubscriptionStatus: string
{
    case Active     = 'active';
    case Canceled   = 'canceled';
    case Expired    = 'expired';
    case PastDue    = 'past_due';
    case Gifted     = 'gifted';
    case Superseded = 'superseded';

    public function label(): string
    {
        return match($this) {
            self::Active     => 'Aktiv',
            self::Canceled   => 'Gekündigt',
            self::Expired    => 'Abgelaufen',
            self::PastDue    => 'Zahlung offen',
            self::Gifted     => 'Geschenkt',
            self::Superseded => 'Ersetzt',
        };
    }

    public function badgeBg(): string
    {
        return match($this) {
            self::Active     => 'bg-green-50',
            self::Canceled   => 'bg-amber-50',
            self::Expired    => 'bg-red-50',
            self::PastDue    => 'bg-red-50',
            self::Gifted     => 'bg-purple-50',
            self::Superseded => 'bg-gray-50',
        };
    }

    public function badgeText(): string
    {
        return match($this) {
            self::Active     => 'text-green-700',
            self::Canceled   => 'text-amber-700',
            self::Expired    => 'text-red-700',
            self::PastDue    => 'text-red-700',
            self::Gifted     => 'text-purple-700',
            self::Superseded => 'text-gray-500',
        };
    }
}
