Track stock levels, link products to inventory items, and manage availability
The inventory system tracks stock across every Hayya vertical — eats, hotels, care, and tools. It is shared at the API level (/api/inventory/) and tenant-scoped by store_id, so each store manages its own items independently.
Inventory items are general-purpose records with a type, quantity, unit, and pricing. In the eats vertical they back menu products; in hotels they back amenities and room-service items. Items are categorized using inventory_categories, and each item type is restricted to product, amenity, or service.
| Column | Purpose |
|---|---|
name_ar / name_en | Bilingual item name |
item_type | product, amenity, or service |
quantity | Current stock on hand |
unit | Unit of measure (e.g. kg, liter, piece) |
low_stock_threshold | Low-stock alert trigger |
show_on_menu | Always show on storefront even when unavailable |
is_available | Per-item availability flag |
Each inventory item carries a numeric quantity and a low_stock_threshold. When quantity drops below the threshold, the item is flagged as low stock and surfaces in the admin. At zero, the item is out of stock.
Stock is never modified silently — every change is recorded as an inventory transaction (see below), giving you a full audit trail of who changed what and why.
In the eats vertical, menu items and inventory items are separate records. Linking connects them so that placing an order for a menu product automatically deducts from the linked inventory item.
| Action | Endpoint |
|---|---|
| Link a product | POST /api/inventory/link-product |
| Unlink a product | POST /api/inventory/unlink-product/:productId |
| List linked products with stock | GET /api/inventory/products-with-stock |
Once linked, the storefront menu shows the product's stock badge (low, in stock, out of stock) using the inventory item's quantity. Unlinking leaves the menu product in place but stops tracking stock for it.
show_on_menu FlagInventory items with show_on_menu = true always appear on the storefront menu, even when is_available = false.
show_on_menu | is_available | Storefront Behavior |
|---|---|---|
| true | true | Shown normally with stock badges |
| true | false | Shown with "Currently Unavailable" badge; add-to-cart disabled |
| false | any | Not shown on storefront |
This lets you keep an item visible (so customers know it exists) while temporarily disabling purchase — useful during supply shortages or prep pauses.
is_available FlagWhen is_available is set to false, the storefront shows a "Currently Unavailable" badge on the item and disables the add-to-cart button. This takes priority over the stock badge regardless of the stock_display setting.
The gateway query (handleGetMenu) intentionally omits the is_available = true filter so that unavailable-but-shown items still reach the storefront.
Each store has a stock_display column that controls how stock information renders on the customer storefront. Set it in Admin → Settings.
| Value | Badge | Description |
|---|---|---|
count (default) | "Only 3 left" / "Out of Stock" | Shows exact count for low stock, "Out of Stock" for zero |
status | "In Stock" / "Out of Stock" | Binary status only, no count |
hidden | No badge | Stock badges hidden entirely |
"Out of Stock" always shows unless stock_display = 'hidden' — even at status, a zero-quantity item labels itself out of stock.
Every stock change is logged in inventory_transactions with a reason:
| Reason | When used |
|---|---|
restock | New shipment received, quantity added |
adjustment | Correction after physical count |
damage | Spoilage, breakage, write-off |
Each row records the item, the delta, the reason, the staff member, and the timestamp. This gives you a defensible audit trail for shrinkage reports and end-of-month reconciliation.
verticals/eats/views/Inventory.vue; hotels: verticals/hotels/views/Inventory.vue)quantity updatesOn the eats inventory page each product row shows link/unlink and enable/disable controls:
Hotels inventory uses type tabs (amenity / product / service) instead of the product-linking grid. The combined create/edit modal includes a show_on_menu toggle column so you can control which items appear on the room-service menu.
An item shows in stock on admin but "Out of Stock" on the storefront.
Check the stock_display setting and whether the product is linked. Unlinked products don't read inventory at all.
Stock didn't drop after an order. Confirm the menu product is linked to the inventory item. Linking is per-product — a missing link means no deduction.
An item isn't appearing on the storefront.
Verify show_on_menu = true. Items with show_on_menu = false are hidden from the storefront regardless of availability.