<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class CreateAnggotaRequest 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 [
            'nik' => 'required|string|max:16|unique:data_anggota_master,nik',
            'nama_lengkap' => 'required',
            'tempat_lahir' => 'required|string',
            'tgl_lahir' => 'required|string',
            'jenis_kelamin' => 'string|nullable',
            'alamat' => 'required|string',
            'rt' => 'string',
            'rw' => 'string',
            'agama' => 'integer|nullable',
            'status_marital' => 'integer|nullable',
            'kelurahan' => 'string|nullable',
            'kecamatan' => 'string|nullable',
            'kabupaten' => 'string|nullable',
            'kode_pos' => 'string|nullable',
            'ibu_kandung' => 'required|string',
            'pekerjaan' => 'string|nullable',
            'lokasi_kerja' => 'string|nullable',
            'penghasilan' => 'string|nullable',
            'nomor_telp' => 'string|nullable',
            'foto' => 'string|nullable',
        ];
    }
}
