<?php

namespace App\Filament\Resources\Manage\FeedPurchases;

use App\Filament\Resources\Manage\FeedPurchases\Pages\CreateFeedPurchase;
use App\Filament\Resources\Manage\FeedPurchases\Pages\EditFeedPurchase;
use App\Filament\Resources\Manage\FeedPurchases\Pages\ListFeedPurchases;
use App\Filament\Resources\Manage\FeedPurchases\Schemas\FeedPurchaseForm;
use App\Filament\Resources\Manage\FeedPurchases\Tables\FeedPurchasesTable;
use App\Models\FeedPurchase;
use BackedEnum;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use Filament\Tables\Table;
use UnitEnum;

class FeedPurchaseResource extends Resource
{
    protected static ?string $model = FeedPurchase::class;

    protected static string|UnitEnum|null $navigationGroup = 'Kelola';

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

    protected static ?string $navigationLabel = 'Belanja Pakan';

    protected static ?int $navigationSort = 1;

    protected static ?string $recordTitleAttribute = 'purchase_date';

    protected static ?string $slug = 'manage/feed-purchases';

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

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

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