<?php

namespace App\Http\Requests\Package;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

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

    public function rules(): array
    {
        return [
            'name' => 'sometimes|string|max:255',
            'job_type' => ['sometimes', Rule::in(['konstruksi', 'konsultasi'])],
            'sub_classification' => 'sometimes|string|max:50',
            'budget' => 'sometimes|numeric|min:0',
            'province' => 'sometimes|string|max:100',
            'regency' => 'sometimes|string|max:100',
            'district' => 'sometimes|string|max:100',
            'village' => 'sometimes|string|max:100',
            'duration_days' => 'sometimes|integer|min:1|max:365',
            'description' => 'nullable|string|max:5000',
        ];
    }
}