<?php

namespace App\Http\Requests\Destination;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rules\File;

class StoreDestinationRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     */
    public function authorize(): bool
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
     */
    public function rules(): array
    {
        return [
            "title" => ["required", "string", "max:255"],
            "description" => ["required", "string", "max:2048"],
            "start_location" => ["required", "string", "max:255"],
            "minimum_age" => ["integer", "max:200"],
            "image" => ["required", File::image()
                ->min('1kb')
                ->max('20mb')
            ],
            "country_id" => ["required", "integer", "exists:countries,id"]
        ];
    }
}
