<?php

namespace App\Http\Requests\Inventory;

use App\Http\Requests\ApiFormRequest;

class InventoryMovementStoreRequest extends ApiFormRequest
{
    public function authorize(): bool
    {
        return auth()->check();
    }

    public function rules(): array
    {
        return [
            'item_id' => ['required', 'integer', 'min:1'],
            'qty_change' => ['required', 'integer'],
            'movement_type' => ['required', 'in:initial,in,out,adjust,distribution'],
            'reason' => ['nullable', 'string', 'max:120'],
            'note' => ['nullable', 'string'],
            'semester' => ['nullable', 'string', 'max:20'],
            'school_year' => ['nullable', 'string', 'max:20'],
            'teacher_id' => ['nullable', 'integer', 'min:1'],
            'student_id' => ['nullable', 'integer', 'min:1'],
            'class_section_id' => ['nullable', 'integer', 'min:1'],
        ];
    }
}
