<?php

namespace App\Filament\Resources\Backtests;

use App\Filament\NavigationGroup;
use App\Filament\Resources\Backtests\Pages\ListBacktests;
use App\Filament\Resources\Backtests\Pages\ViewBacktest;
use App\Filament\Resources\Backtests\Schemas\BacktestInfolist;
use App\Filament\Resources\Backtests\Tables\BacktestsTable;
use App\Models\Backtest;
use BackedEnum;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Model;

class BacktestResource extends Resource
{
    protected static ?string $model = Backtest::class;

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

    protected static string|\UnitEnum|null $navigationGroup = NavigationGroup::Forecasting;

    protected static ?string $navigationLabel = 'Backtests';

    protected static ?int $navigationSort = 3;

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

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

    public static function canCreate(): bool
    {
        return false;
    }

    public static function canEdit(Model $record): bool
    {
        return false;
    }

    public static function canDelete(Model $record): bool
    {
        return false;
    }

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