<?php

namespace App\Rules;

use Illuminate\Validation\Rule;

class RegistroStockRules
{
    public static function rules(bool $isUpdate = false, $id = null): array
    {
        return [
            'numOperacion' => ['nullable', 'integer', 'min:1'],
            'codigo' => ['required', 'string', 'max:50'],
            'cantidad' => ['required', 'integer', Rule::notIn([0])],
            'objetivo' => ['required', 'integer', Rule::in([1, 2])],
            'fechaOperacion' => ['nullable', 'date'],
            'observacion' => ['nullable', 'string'],
            'cedulaResponsable' => ['nullable', 'string', 'max:20', 'exists:users,cedula'],
        ];
    }
}
