<?php

namespace App\Domain\Financial\Enums;

enum InvoiceStatus: string
{
    case Draft = 'draft';
    case Pending = 'pending';
    case AwaitingApproval = 'awaiting_approval';
    case Sent = 'sent';
    case Paid = 'paid';
    case PartiallyPaid = 'partially_paid';
    case Overpaid = 'overpaid';
    case Overdue = 'overdue';
    case Cancelled = 'cancelled';
    case Refunded = 'refunded';
    case PartiallyRefunded = 'partially_refunded';
    case WrittenOff = 'written_off';
    case Disputed = 'disputed';

    public function label(): string
    {
        return match ($this) {
            self::Draft => 'مسودة',
            self::Pending => 'معلق',
            self::AwaitingApproval => 'في انتظار الموافقة',
            self::Sent => 'مرسلة',
            self::Paid => 'مدفوعة',
            self::PartiallyPaid => 'مدفوعة جزئياً',
            self::Overpaid => 'مدفوعة بالزيادة',
            self::Overdue => 'متأخرة',
            self::Cancelled => 'ملغاة',
            self::Refunded => 'مستردة',
            self::PartiallyRefunded => 'مستردة جزئياً',
            self::WrittenOff => 'شُطبت',
            self::Disputed => 'متنازع عليها',
        };
    }
}
