<?php

namespace App\Filament\Resources\Shipments\Schemas;

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

class ShipmentForm
{
    public static function configure(Schema $schema): Schema
    {
        return $schema
            ->components([
                TextInput::make('reference')
                    ->required(),
                Select::make('type')
                    ->options(['air' => 'Air', 'sea' => 'Sea'])
                    ->required(),
                TextInput::make('origin')
                    ->required(),
                TextInput::make('destination')
                    ->required(),
                TextInput::make('vessel_or_flight')
                    ->default(null),
                DatePicker::make('departure_date'),
                DatePicker::make('eta'),
                DatePicker::make('ata'),
                Select::make('status')
                    ->options([
            'received' => 'Received',
            'departed' => 'Departed',
            'in_transit' => 'In transit',
            'arrived' => 'Arrived',
            'customs_clearance' => 'Customs clearance',
            'ready_for_pickup' => 'Ready for pickup',
            'delivered' => 'Delivered',
        ])
                    ->default('received')
                    ->required(),
                Textarea::make('notes')
                    ->default(null)
                    ->columnSpanFull(),
                TextInput::make('created_by')
                    ->numeric()
                    ->default(null),
            ]);
    }
}
