<?php

namespace App\Filament\Resources\ProfitCenterSupplierSchedules;

use App\Filament\Resources\ProfitCenterSupplierSchedules\Pages\CreateProfitCenterSupplierSchedule;
use App\Filament\Resources\ProfitCenterSupplierSchedules\Pages\EditProfitCenterSupplierSchedule;
use App\Filament\Resources\ProfitCenterSupplierSchedules\Pages\ListProfitCenterSupplierSchedules;
use App\Filament\Resources\ProfitCenterSupplierSchedules\Schemas\ProfitCenterSupplierScheduleForm;
use App\Filament\Resources\ProfitCenterSupplierSchedules\Tables\ProfitCenterSupplierSchedulesTable;
use App\Models\ProfitCenterSupplierSchedule;
use BackedEnum;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;

class ProfitCenterSupplierScheduleResource extends Resource
{
    protected static ?string $model = ProfitCenterSupplierSchedule::class;

    protected static string|BackedEnum|null $navigationIcon = 'heroicon-o-link';

    protected static string|\UnitEnum|null $navigationGroup = 'Szállítás';

    protected static ?string $navigationLabel = 'Profitcenter ütemezés';

    protected static ?string $modelLabel = 'Profitcenter ütemezés';

    protected static ?string $pluralLabel = 'Profitcenter ütemezések';

    protected static ?string $breadcrumb = 'Profitcenter ütemezés';

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

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

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

    public static function getPages(): array
    {
        return [
            'index' => ListProfitCenterSupplierSchedules::route('/'),
            'create' => CreateProfitCenterSupplierSchedule::route('/create'),
            'edit' => EditProfitCenterSupplierSchedule::route('/{record}/edit'),
        ];
    }

    public static function getWidgets(): array
    {
        return [
            \App\Filament\Widgets\DeliveryCalendarWidget::class,
        ];
    }

    public static function getRecordRouteBindingEloquentQuery(): Builder
    {
        return parent::getRecordRouteBindingEloquentQuery()
            ->withoutGlobalScopes([
                SoftDeletingScope::class,
            ]);
    }
}
