<?php

namespace App\Filament\Resources\SalesPhases;

use App\Filament\Resources\SalesPhases\Pages;
use App\Models\SalesPhase;
use App\Enums\NavigationGroup;
use Filament\Schemas\Schema;
use Filament\Resources\Resource;
use Filament\Tables\Table;
use App\Filament\Resources\SalesPhases\Schemas\SalesPhaseForm;
use App\Filament\Resources\SalesPhases\Tables\SalesPhasesTable;

class SalesPhaseResource extends Resource
{
    protected static array $permissionActions = ["view", "create", "update", "delete", "restore", "forceDelete"];
    protected static ?string $model = SalesPhase::class;
    protected static string | \BackedEnum | null $navigationIcon = 'heroicon-o-rocket-launch';
    protected static string | \UnitEnum | null $navigationGroup = NavigationGroup::WAREHOUSE->value;
    protected static ?int $navigationSort = 2;

    protected static ?string $modelLabel = 'Đợt mở bán';
    protected static ?string $pluralModelLabel = 'Đợt mở bán';

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

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

    public static function getPages(): array
    {
        return [
            'index' => Pages\ListSalesPhases::route('/'),
            'create' => Pages\CreateSalesPhase::route('/create'),
            'edit' => Pages\EditSalesPhase::route('/{record}/edit'),
        ];
    }
}
