<?php

namespace App\Filament\Admin\Resources\WalletTransactions;

use App\Filament\Admin\Resources\WalletTransactions\Pages\CreateWalletTransaction;
use App\Filament\Admin\Resources\WalletTransactions\Pages\EditWalletTransaction;
use App\Filament\Admin\Resources\WalletTransactions\Pages\ListWalletTransactions;
use App\Filament\Admin\Resources\WalletTransactions\Pages\StripeSuccess;
use App\Filament\Admin\Resources\WalletTransactions\Pages\ViewWalletTransaction;
use App\Filament\Admin\Resources\WalletTransactions\Schemas\WalletTransactionForm;
use App\Filament\Admin\Resources\WalletTransactions\Schemas\WalletTransactionInfolist;
use App\Filament\Admin\Resources\WalletTransactions\Tables\WalletTransactionsTable;
use App\Models\WalletTransaction;

use BackedEnum;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use Filament\Tables\Table;
use UnitEnum;

class WalletTransactionResource extends Resource
{
    protected static ?string $model = WalletTransaction::class;
    protected static string|BackedEnum|null $navigationIcon = Heroicon::UserGroup;
    protected static string|UnitEnum|null $navigationGroup = "Manage Transactions";

    protected static ?string $recordTitleAttribute = 'Transaction';


    protected static ?int $navigationSort = 1;
    // protected static ?string $recordTitleAttribute = 'User';

    public static function form(Schema $schema): Schema
    {
        return WalletTransactionForm::configure($schema);
    }

    public static function infolist(Schema $schema): Schema
    {
        return WalletTransactionInfolist::configure($schema);
    }

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

    public static function getRelations(): array
    {
        return [
            //
        ];
    }

    public static function getPages(): array
    {
        return [
            'index' => ListWalletTransactions::route('/'),
            'create' => CreateWalletTransaction::route('/create'),
            'view' => ViewWalletTransaction::route('/{record}'),
            'edit' => EditWalletTransaction::route('/{record}/edit'),
            'success' => StripeSuccess::route('/{record}/success'),
        ];
    }
}
