<?php

namespace App\Enums;

enum CashTransactionType: string
{
    case Sale = 'sale';
    case Payment = 'payment';
    case Expense = 'expense';
    case Refund = 'refund';
    case CashIn = 'cash_in';
    case CashOut = 'cash_out';

    public function label(): string
    {
        return __('status.txn_'.$this->value);
    }

    public function direction(): string
    {
        return in_array($this, [self::Expense, self::Refund, self::CashOut], true) ? 'out' : 'in';
    }
}
