<?php

namespace Modules\Booking\Filament\Resources\Bookings;

use BackedEnum;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use Filament\Tables\Table;
use Modules\Booking\Filament\Resources\Bookings\Pages\ListBookings;
use Modules\Booking\Filament\Resources\Bookings\Pages\ViewBooking;
use Modules\Booking\Filament\Resources\Bookings\Schemas\BookingInfolist;
use Modules\Booking\Filament\Resources\Bookings\Tables\BookingsTable;
use Modules\Booking\Models\Booking;
use UnitEnum;

/**
 * Read-mostly by design: bookings are created through the API (T4.4), not
 * hand-entered in the admin — so this resource has no create/edit form, just
 * a list with filters and a status-gated Cancel action (T4.6).
 */
class BookingResource extends Resource
{
    protected static ?string $model = Booking::class;

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

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

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

    public static function infolist(Schema $schema): Schema
    {
        return BookingInfolist::configure($schema);
    }

    public static function getPages(): array
    {
        return [
            'index' => ListBookings::route('/'),
            'view' => ViewBooking::route('/{record}'),
        ];
    }
}
