<?php

namespace App\Filament\Resources\Infrastructures\Schemas;

use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Schemas\Schema;

class InfrastructureForm
{
    public static function configure(Schema $schema): Schema
    {
        return $schema
            ->components([
                Select::make('type_infrastructure_id')
                    ->relationship('typeInfrastructure', 'libelle')
                    ->required(),
                TextInput::make('nombre_movais')
                    ->required()
                    ->numeric(),
                TextInput::make('nombre_moyens')
                    ->required()
                    ->numeric(),
                TextInput::make('nombre_bons')
                    ->required()
                    ->numeric(),
                Select::make('annee_id')
                    ->relationship('annee', 'libelle')
                    ->required(),
                Select::make('etablissement_id')
                    ->relationship('etablissement', 'libelle')
                    ->required(),
            ]);
    }
}
