<?php

namespace App\Filament\Clusters\VisaMasterPayments\Resources\VisaMasterPaymentOrders;

use App\Filament\Clusters\VisaMasterPayments\Resources\VisaMasterPaymentOrders\Pages\CreateVisaMasterPaymentOrder;
use App\Filament\Clusters\VisaMasterPayments\Resources\VisaMasterPaymentOrders\Pages\EditVisaMasterPaymentOrder;
use App\Filament\Clusters\VisaMasterPayments\Resources\VisaMasterPaymentOrders\Pages\ListVisaMasterPaymentOrders;
use App\Filament\Clusters\VisaMasterPayments\Resources\VisaMasterPaymentOrders\Pages\ViewVisaMasterPaymentOrder;
use App\Filament\Clusters\VisaMasterPayments\Resources\VisaMasterPaymentOrders\Schemas\VisaMasterPaymentOrderForm;
use App\Filament\Clusters\VisaMasterPayments\Resources\VisaMasterPaymentOrders\Tables\VisaMasterPaymentOrdersTable;
use App\Filament\Clusters\VisaMasterPayments\VisaMasterPaymentsCluster;
use App\Modules\VisaMasterPaymentOrder\Models\VisaMasterPaymentOrder;
use BackedEnum;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;

class VisaMasterPaymentOrderResource extends Resource
{
    protected static ?int $navigationSort = 1;

    protected static ?string $model = VisaMasterPaymentOrder::class;

    protected static ?string $cluster = VisaMasterPaymentsCluster::class;

    protected static ?string $recordTitleAttribute = 'id';

    protected static string|BackedEnum|null $navigationIcon = 'icon-visa-plain';

    public static function getNavigationGroup(): ?string
    {
        return __('Visa/Master payments');
    }

    public static function getModelLabel(): string
    {
        return __('Visa/Master payment');
    }

    public static function getPluralModelLabel(): string
    {
        return __('Visa/Master payments');
    }

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

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

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

    public static function getPages(): array
    {
        return [
            'index' => ListVisaMasterPaymentOrders::route('/'),
            'create' => CreateVisaMasterPaymentOrder::route('/create'),
            'view' => ViewVisaMasterPaymentOrder::route('/{record}'),
            'edit' => EditVisaMasterPaymentOrder::route('/{record}/edit'),
        ];
    }

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