<?php

namespace Modules\Project\Http\Requests;

use Modules\Base\Http\Requests\BaseRequest;

class OrderRequest extends BaseRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        switch ($this->method()) {
            case 'POST':
                return [
                    'goods' => ['required','array'],
                    'goods.*.id' => ['required','integer','min:1'],
                    //'goods.*.spec' => ['required','array'],
                    //'goods.*.spec.*.group' => ['required','string'],
                    //'goods.*.spec.*.spec_name' => ['required','string'],
                    //'goods.*.qty' => ['required','integer','min:1'],
                    'address_id' => ['required','integer'],
                    'remarks' => ['nullable','string'],
                    'coupon_id' => ['nullable','integer'],
                ];
                break;
        }
    }

    public function attributes()
    {
        return [

        ];
    }

    public function messages()
    {
        return [

        ];
    }

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