<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

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

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
     */
    public function rules(): array
    {
        return [
            'category_id'   => 'required',
            'name'          => 'required|string|max:70',
            'unit_type'     => 'required',
            'unit_size'     => 'required',
            'unit_per_case' => 'required|numeric',
            'quantity'      => 'required|numeric',
            'type'          => 'required',
            'stock_location'=> 'required',
            'currency'      => 'required',
            'price'         => 'required|numeric',
            'description'   => 'required|string',
        ];
    }
}
