<?php

namespace App\Http\Requests;

use App\Models\InventoryMovement;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

class StoreInventoryMovementRequest extends FormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'type' => ['required', Rule::in([
                InventoryMovement::TYPE_IN,
                InventoryMovement::TYPE_OUT,
                InventoryMovement::TYPE_ADJUSTMENT,
            ])],
            'quantity' => ['required', 'numeric'],
            'reference' => ['nullable', 'string', 'max:500'],
        ];
    }
}
