<?php

namespace App\Http\Requests\Fees;

use App\Http\Requests\ApiFormRequest;

class FeeRefundRequest extends ApiFormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'parent_id' => ['required', 'integer', 'min:1'],
            'students' => ['required', 'array'],
            'students.*.student_id' => ['nullable', 'integer'],
            'students.*.class_section_id' => ['required', 'integer', 'min:1'],
            'students.*.enrollment_status' => ['required', 'string', 'max:50'],
            'students.*.admission_status' => ['required', 'string', 'max:50'],
            'students.*.withdrawal_date' => ['nullable', 'date'],
        ];
    }
}
