<?php

namespace App\Enums;

use App\Enums\Concerns\HasOptions;

/**
 * Payment state of a subscription invoice.
 */
enum InvoiceStatus: string
{
    use HasOptions;

    case Unpaid = 'unpaid';
    case AwaitingVerification = 'awaiting_verification';
    case Paid = 'paid';
    case Cancelled = 'cancelled';
    case Refunded = 'refunded';


    /** @return array<string,string> */
    public static function labels(): array
    {
        return [
            self::Unpaid->value => 'Unpaid',
            self::AwaitingVerification->value => 'Awaiting verification',
            self::Paid->value => 'Paid',
            self::Cancelled->value => 'Cancelled',
            self::Refunded->value => 'Refunded',
        ];
    }

    /** @return array<string,string> */
    public static function colors(): array
    {
        return [
            self::Unpaid->value => 'red',
            self::AwaitingVerification->value => 'amber',
            self::Paid->value => 'green',
            self::Cancelled->value => 'gray',
            self::Refunded->value => 'purple',
        ];
    }
}
