<?php

namespace Modules\Payment\Filament\Resources\Refunds;

use BackedEnum;
use Filament\Resources\Resource;
use Filament\Support\Icons\Heroicon;
use Filament\Tables\Table;
use Modules\Payment\Filament\Resources\Refunds\Pages\ListRefunds;
use Modules\Payment\Filament\Resources\Refunds\Tables\RefundsTable;
use Modules\Payment\Models\Refund;
use UnitEnum;

/**
 * List of past refunds, plus a "Process" header action (staff-only) that
 * initiates a new one against a successful Payment via RefundBookingAction
 * (T5.11). No create/edit form — a Refund only ever comes from that action,
 * never hand-entered.
 */
class RefundResource extends Resource
{
    protected static ?string $model = Refund::class;

    protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedReceiptRefund;

    protected static string|UnitEnum|null $navigationGroup = 'Operations';

    public static function table(Table $table): Table
    {
        return RefundsTable::configure($table);
    }

    public static function getPages(): array
    {
        return [
            'index' => ListRefunds::route('/'),
        ];
    }
}
