<?php

namespace App\Http\Requests\Member\Transaction;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules()
    {
        return [
            'address_id' => 'required|integer|exists:address,id',
            'location_id' => 'required|integer',
            'courier_company' => 'required|string',
            'courier_type' => 'required|string',
            'vouchers' => 'nullable|array',
            'vouchers.*' => 'required|integer',
            'items' => 'nullable|array',
            'items.*.item_reference_id' => 'required|integer',
            'items.*.qty' => 'required|integer',
            'use_customer_points' => 'nullable|integer',
        ];
    }
}
