<?php

namespace Ignite\Core\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class CreateTransactionRequest extends FormRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'user_id'          => 'required',
            'type'             => 'required',
            'transaction_date' => 'required|date',
            'tax_date'         => 'required|date',
            'value'            => 'required|numeric',
            'description'      => 'required',
        ];
    }

    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        // TODO: Add auth()->user()->can('core.transaction.create')
        return true;
    }
}
