<?php

namespace App\Http\Requests\Api\Currency;

use Illuminate\Foundation\Http\FormRequest;

class StoreRequest 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()
    {

        $rules = [
            'name'    => 'required',
            'symbol'    => 'required',
            'position'    => 'required|in:front,behind',
            'code'    => 'required',
            'thousand_separator' => 'nullable|string|max:5',
            'decimal_separator' => 'nullable|string|max:5',
            'decimal_digits' => 'nullable|integer|min:0|max:10',
            'flag_code' => 'nullable|string|max:5',
        ];

        return $rules;

    }

}
