<?php

namespace App\Filament\Resources\Feed\FeedPurchases;

use App\Filament\Resources\Feed\FeedPurchases\Pages\CreateFeedPurchase;
use App\Filament\Resources\Feed\FeedPurchases\Pages\EditFeedPurchase;
use App\Filament\Resources\Feed\FeedPurchases\Pages\ListFeedPurchases;
use App\Filament\Resources\Feed\FeedPurchases\Schemas\FeedPurchaseForm;
use App\Filament\Resources\Feed\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 = 'Pakan';

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

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

    protected static ?int $navigationSort = 2;

    protected static ?string $recordTitleAttribute = 'purchase_date';

    protected static ?string $slug = 'feed/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'),
        ];
    }
}
