<?php

namespace App\Http\Requests\Pricing;

use Illuminate\Foundation\Http\FormRequest;

class PriceByItemsRequest extends FormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'items' => 'required|array|min:1|max:100',
            'items.*.item_type_code' => 'required|string|in:PRODUCT,MATERIAL',
            'items.*.item_id' => 'required|integer',
            'client_group_id' => 'nullable|integer',
            'date' => 'nullable|date',
        ];
    }
}
