<?php

namespace App\Http\Requests\Pricing;

use App\Http\Requests\Traits\HasPagination;
use Illuminate\Foundation\Http\FormRequest;

class PriceIndexRequest extends FormRequest
{
    use HasPagination;

    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'size' => 'nullable|integer|min:1',
            'page' => 'nullable|integer|min:1',
            'q' => 'nullable|string|max:100',
            'item_type_code' => 'nullable|string|in:PRODUCT,MATERIAL',
            'item_id' => 'nullable|integer',
            'client_group_id' => 'nullable',
            'status' => 'nullable|string|in:draft,active,inactive,finalized',
            'valid_at' => 'nullable|date',
        ];
    }
}
