New Arrival Alerts
New Arrival Alerts surfaces every wishlist entry whose product has come back into stock, so you can notify the waiting customer by WhatsApp in one tap — individually or in bulk.
Overview
The page loads a single derived list from GET /garment/analytics/restocked-wishlist: every Wishlist entry still in PENDING status where the linked product's current stock is now greater than zero.
This is not a separate alerts table — it is computed live on each load by cross-referencing the same GarmentWishlist records used by the Wishlist page against the product catalogue's current stock level, so an item only appears here if someone previously saved it to the Wishlist page while it was out of stock and it has since been restocked.
Each row shows the customer, the product (and size/colour if recorded on the wishlist entry), the phone number if saved, and the current stock quantity now available.
Clicking Notify (or Notify N Selected for a bulk batch) opens WhatsApp Web/App with a pre-filled "back in stock" message per customer, then immediately marks that wishlist entry NOTIFIED via PUT /garment/wishlist/:id and removes it from this list.
Before You Start
- The route requires the "customers" plan feature — unlike most other garment pages in this batch, it is gated on Customers rather than Billing or Inventory, since it is fundamentally a customer-communication tool.
- An item only appears here if a customer's want was first recorded on the Wishlist page (garm-wishlist) while the product was out of stock, and the product's stock has since risen above zero.
- The Notify button needs a saved customer phone number to work — rows without one show an error toast instead of opening WhatsApp.
Step-by-Step Guide
1 Notify one customer
- Find the row for the customer/product you want to act on.
- Click Notify on that row — a WhatsApp Web/App tab opens with a pre-filled message naming the product (and size, if recorded) and inviting the customer to visit.
- Send the message in WhatsApp as normal — back on this page, the entry is automatically marked NOTIFIED and disappears from the list.
2 Notify several customers in bulk
- Tick the checkbox on each row you want to include, or use Select all to tick every row currently listed.
- Click Notify N Selected — this opens a separate WhatsApp tab for each selected customer, one after another.
3 Refresh the list
- Click Refresh at any time to reload the restocked list — useful right after a delivery/restock has just been entered into inventory.
Every Field & Button, Explained
| Field / Button | What it does |
|---|---|
Refresh | Re-fetches GET /garment/analytics/restocked-wishlist and clears any current row selection. |
Select all | Ticks (or clears) every row currently in the list. |
Notify N Selected | Only shown once at least one row is ticked; opens a WhatsApp tab per selected customer and marks each one NOTIFIED as its tab opens. |
Row checkbox | Includes/excludes that entry from a bulk Notify N Selected action. |
Customer name / phone | From the original Wishlist entry; phone is required for the Notify action to work on that row. |
Wants: product / size / colour | The product (and size/colour, if recorded) the customer originally asked to be told about. |
In Stock (N) badge | The product's current stock quantity, confirming why this entry now qualifies as "restocked". |
Notify (row button) | Opens a WhatsApp message pre-filled for that single customer, then marks the wishlist entry NOTIFIED and removes it from the list. |
Empty state | "No pending alerts" — shown when there are no PENDING wishlist entries whose product is currently in stock (either everyone has been notified, or nothing on the wishlist has restocked yet). |
Tips & Best Practices
- Check this page right after receiving new stock, especially for styles you know had wishlist interest — restocked items only surface here, they are not pushed to you elsewhere.
- Use Select all + Notify N Selected right after a big restock delivery rather than notifying customers one at a time.
- Remember the underlying want is recorded on the Wishlist page (garm-wishlist) — if a customer's want is never saved there while the item is out of stock, it will never appear on this Alerts page even after restocking.
Troubleshooting & FAQ
A customer I know is waiting for a restocked item isn't showing up here.
The Notify button did nothing / showed an error.
I sent the WhatsApp message but the row is still showing here.
Is this the same feature as the Wishlist page?
🧑💻 Developer Notes
Source component(s):
frontend-app/pos-app-garment/src/pages/garment/NewArrivalAlertPage.jsx
Backend endpoints used:
GET /garment/analytics/restocked-wishlistPUT /garment/wishlist/:id
Related tables (db-core repositories):
GarmentWishlistProduct (stock column, read-only for this feature)
Redux slices:
None — local component state only
Feature flag key: customers
The backend function getRestockedWishlistItems (packages/pos-core/src/garment.js) is explicitly commented "for #19 new arrival alert" — confirming this page, not the Wishlist page, is its intended and sole consumer; the Wishlist page (garm-wishlist) instead drives full CRUD against GET/POST/PUT/DELETE /garment/wishlist and does not call the restocked-wishlist analytics endpoint. getRestockedWishlistItems loads up to 500 PENDING wishlist rows, batch-fetches current stock for every referenced product, computes isRestocked = stock > 0 per row, and filters down to only the restocked ones — this recomputation happens on every page load/Refresh rather than being pushed or cached, so it scales linearly with wishlist size. The WhatsApp phone number is hard-coded to prefix "91" (India) when the stored number does not already start with 91, matching the same pattern used by the electronics variant's warranty/EMI reminders; there is no phone-format validation beyond stripping non-digit characters.