<?php

namespace App\Http\Requests\Discounts;

use App\Http\Requests\ApiFormRequest;

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

    public function rules(): array
    {
        return [
            'voucher_id' => ['required', 'integer', 'min:1', 'exists:discount_vouchers,id'],
            'parent_ids' => ['required', 'array', 'min:1'],
            'parent_ids.*' => ['integer', 'min:1'],
            'allow_additional' => ['nullable', 'boolean'],
        ];
    }
}
