<?php

namespace App\Http\Requests;

use App\Models\MafOrder;
use Illuminate\Foundation\Http\FormRequest;

class StoreMafOrderRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     */
    public function authorize(): bool
    {
        return auth()->check();
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules(): array
    {
        return [
            'order_number'  => 'nullable|string',
            'product_id'    => 'required|exists:products,id',
            'quantity'      => 'required|integer|min:1',
            'in_stock'      => 'nullable|integer|min:0',
            'status'        => 'nullable',
        ];
    }
}
