<?php

namespace App\Modules\Pilkades\Http\Requests\SuperAdmin;

use Illuminate\Foundation\Http\FormRequest;

class StoreDesaRequest extends FormRequest
{
    public function authorize(): bool
    {
        return $this->user()->isSuperAdmin();
    }

    public function rules(): array
    {
        return [
            'kecamatan_id' => ['required', 'uuid', 'exists:kecamatan,id'],
            'nama' => ['required', 'string', 'max:255'],
            'logo' => ['nullable', 'image', 'max:2048'],
            'tanggal_pilkades' => ['nullable', 'date'],
            'is_active' => ['sometimes', 'boolean'],
        ];
    }
}
