<?php

namespace App\Http\Requests\Messaging;

use App\Http\Requests\ApiFormRequest;

class MessageIndexRequest extends ApiFormRequest
{
    public function rules(): array
    {
        return [
            'page' => ['nullable', 'integer', 'min:1'],
            'per_page' => ['nullable', 'integer', 'min:1', 'max:100'],
            'priority' => ['nullable', 'in:low,normal,high'],
            'read_status' => ['nullable', 'in:0,1'],
            'search' => ['nullable', 'string', 'max:255'],
            'sort_by' => ['nullable', 'in:sent_datetime,subject,priority'],
            'sort_dir' => ['nullable', 'in:asc,desc'],
        ];
    }
}
