<?php

    namespace Modules\Lpj\Http\Requests;

    use Illuminate\Foundation\Http\FormRequest;

    class LaporanExternalRequest extends FormRequest
    {
        /**
         * Get the validation rules that apply to the request.
         */
        public function rules()
        : array
        {
            return [
                'permohonan_id'                             => 'required|exists:permohonan,id',
                'nomor_laporan'                             => 'nullable|string|max:255',
                'tgl_final_laporan'                         => 'nullable|date',
                'nilai_pasar'                               => 'nullable|numeric',
                'indikasi_nilai_likuidasi'                  => 'nullable|numeric',
                'indikasi_nilai_pasar_tanah'                => 'nullable|numeric',
                'estimasi_harga_tanah'                      => 'nullable|numeric',
                'estimasi_harga_bangunan'                   => 'nullable|numeric',
                'indikasi_nilai_pasar_bangunan'             => 'nullable|numeric',
                'indikasi_nilai_pasar_sarana_pelengkap'     => 'nullable|numeric',
                'indikasi_nilai_pasar_mesin'                => 'nullable|numeric',
                'indikasi_nilai_pasar_kendaraan_alat_berat' => 'nullable|numeric',
                'file_resume'                               => 'nullable|file|mimes:pdf|max:10240', // 10MB max
                'file_laporan'                              => 'nullable|file|mimes:pdf|max:10240',
            ];
        }

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