<?php

namespace App\Policies;

use App\Models\InventoryTransferLine;
use App\Models\User;

/**
 * Líneas de documento de transferencia: misma convención que cabecera; el servicio validará status draft.
 */
class InventoryTransferLinePolicy
{
    public function viewAny(User $user): bool
    {
        return $user->can('inventory.view') || $user->can('inventory.manage');
    }

    public function view(User $user, InventoryTransferLine $line): bool
    {
        return $this->viewAny($user);
    }

    public function create(User $user): bool
    {
        return $user->can('inventory.manage');
    }

    public function update(User $user, InventoryTransferLine $line): bool
    {
        return $user->can('inventory.manage');
    }

    public function delete(User $user, InventoryTransferLine $line): bool
    {
        return $user->can('inventory.manage');
    }
}
