<?php

namespace App\Http\Requests;

use App\Models\Product;
use Gate;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Http\Response;

class UpdateProductRequest extends FormRequest
{
    public function authorize()
    {
        return Gate::allows('product_edit');
    }

    public function rules()
    {
        return [
            'machine_type_id' => [
                'required',
                'integer',
            ],
            'name' => [
                'string',
                'required',
            ],
            'model' => [
                'string',
                'required',
            ],
            'product_version' => [
                'string',
                'nullable',
            ],
            'part_no' => [
                'string',
                'nullable',
            ],
            'mfg_year' => [
                'string',
                'nullable',
            ],
            'manufacturer' => [
                'string',
                'nullable',
            ],
            'product_catalog' => [
                'array',
            ],
        ];
    }
}
