Skip to main content

/restock — Restock Product

Type: Admin slash command
Scope: Admin role only

Description

Adds quantity to a product's inventory snapshot and creates a RESTOCK transaction record. Also resets the lowStockAlertSent flag so future threshold crossings will re-fire an alert.

Usage

/restock product:<product-name> quantity:<positive-integer>

Both options have autocomplete / integer validation.

Behavior

  • Admin-only: requires the user to have at least one role in botConfig.adminRoleIds.
  • Validates quantity is a positive integer (Zod schema).
  • Calls InventoryService.restock() which:
    • Increments quantityAvailable by the given amount.
    • Sets lowStockAlertSent = false (resets alert gate).
    • Creates an InventoryTransaction of type RESTOCK.
  • Returns an ephemeral confirmation: Restocked Widget: 5 → 12 units.

Permissions

Requires admin role (botConfig.adminRoleIds).