<?php

namespace App\Http\Requests\Api;

use App\District;
use Illuminate\Foundation\Http\FormRequest;

class PromotionIndexRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'code' => 'required|in:'
                . District::LVIV_DISTRICT_ALL .
                "," . District::REGION .
                "," . District::SYKHIV .
                "," . District::FRANKIVSKYJ .
                "," . District::ZALIZNYCHNYI .
                "," . District::SHEVCHENKIVSKYI .
                "," . District::LYCHAKIV .
                "," . District::HALYTSKYI .
                "," . District::ALL,
            'page'=> 'numeric|min:0|max:9999|required',
        ];
    }
}
