<?php

namespace App\Domain\Financial\Enums;

enum TransactionType: string
{
    case PaymentReceived = 'payment_received';
    case PaymentMade = 'payment_made';
    case Refund = 'refund';
    case Transfer = 'transfer';
    case Adjustment = 'adjustment';
    case Fee = 'fee';
    case Discount = 'discount';
    case WriteOff = 'write_off';
    case OpeningBalance = 'opening_balance';

    public function label(): string
    {
        return match ($this) {
            self::PaymentReceived => 'تحصيل',
            self::PaymentMade => 'صرف',
            self::Refund => 'استرداد',
            self::Transfer => 'تحويل',
            self::Adjustment => 'تسوية',
            self::Fee => 'رسوم',
            self::Discount => 'خصم',
            self::WriteOff => 'إعدام دين',
            self::OpeningBalance => 'رصيد افتتاحي',
        };
    }
}
