<?php

namespace App\Filament\Resources\Settlements;

use App\Filament\Resources\Settlements\Pages;
use App\Models\Settlement;
use App\Enums\NavigationGroup;
use Filament\Schemas\Schema;
use Filament\Resources\Resource;
use Filament\Tables\Table;
use App\Filament\Resources\Settlements\Schemas\SettlementForm;
use App\Filament\Resources\Settlements\Tables\SettlementsTable;

class SettlementResource extends Resource
{
    protected static array $permissionActions = ["view", "create", "update", "delete", "restore", "forceDelete"];
    protected static ?string $model = Settlement::class;
    protected static string | \BackedEnum | null $navigationIcon = 'heroicon-o-clipboard-document-check';
    protected static string | \UnitEnum | null $navigationGroup = NavigationGroup::TRANSACTION->value;
    protected static ?int $navigationSort = 5;

    protected static ?string $modelLabel = 'Quyết toán';
    protected static ?string $pluralModelLabel = 'Quyết toán & Sổ đỏ';

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

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

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