<?php

namespace App\Http\Requests\VehicleDispatch;

use Illuminate\Foundation\Http\FormRequest;

class VehicleDispatchUpdateRequest extends FormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'freight_cost_type' => 'nullable|in:prepaid,collect',
            'logistics_company' => 'nullable|string|max:100',
            'arrival_datetime' => 'nullable|date',
            'tonnage' => 'nullable|string|max:20',
            'vehicle_no' => 'nullable|string|max:20',
            'driver_contact' => 'nullable|string|max:50',
            'remarks' => 'nullable|string',
            'supply_amount' => 'nullable|numeric|min:0',
            'vat' => 'nullable|numeric|min:0',
            'total_amount' => 'nullable|numeric|min:0',
            'status' => 'nullable|in:draft,completed',
        ];
    }
}
