Skip to content

Feature: Inventory for add-ons (stock, low-stock, transactional deduct/restore) #358

Closed

Description

@khaira777

Feature: Inventory for add-ons (stock, low-stock, transactional deduct/restore)

Summary

Today only products (products.stock_quantity, track_inventory, low_stock_threshold) track inventory. Add-ons (e.g. "extra cheese") have no stock, so a customer can order unlimited out-of-stock items.

What already exists

  • addon_groups already have is_required, min_selection, max_selection, allow_multiple_quantities (main/db.ts:4131-4139) and the server validates submitted add-ons against the catalog (main/routes/orders.ts resolveItemAddons).
  • Order items snapshot addons as JSON; order lifecycle already manages product stock deduction/restore on cancel/void (fix(orders): enforce lifecycle transitions and one-time inventory restoration #252).

Proposed MVP

addons:
  track_inventory
  stock_quantity
  low_stock_threshold

and in the order snapshot:

order_item_addons:
  inventory_deducted_quantity   # 2 burgers × 3 extra cheese → deduct 6
  • Validate + decrement on order creation, restore the exact deducted quantity on cancel/void/refund — transactionally (same pattern as products in main/routes/index.ts/orders.ts).
  • Low-stock warnings surfaced in the add-on picker.

Notes

Deliberately not building ingredient/recipe inventory (an ERP) — just enough so "extra avocado is sold out" works. Reuse the append-only inventory movement ledger direction of #280 when available.

Acceptance criteria

  • Add-ons can have stock fields; order creation validates availability and deducts.
  • Cancel/void restores exactly what was deducted.
  • POS/UI surfaces out-of-stock add-ons.

Activity

  1. added
    enhancement
    area:frontend
    area:backend
    on Aug 17, 2026
  2. self-assigned this
    on Oct 5, 2026
  3. khaira777 commented on Oct 5, 2026

    @khaira777
    ContributorAuthor

    Kickoff for the add-on inventory delivery. Branch: feat/addon-inventory-358. Pull request: #967

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:backendarea:frontendenhancement

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions