rami_levy_reorder_from_history
Scans recent orders to find items bought repeatedly, adds each to the cart at its median past quantity, preserving existing cart contents. Returns estimated and server totals; alerts if items are rejected.
Instructions
Look at the last numOrders (default 10, max 50) real orders, find items that appear in at least minOccurrences (default 3) of them, and add each at its median past quantity. ADDS onto whatever is already in the cart — it does not replace it. Returns cartTotal (local estimate) and serverTotal (Rami Levy's own total — authoritative). ok:false with a transport reason means nothing changed. reason items_rejected means the server refused the listed products; they have been removed from the cart too, so tell the user and pick alternatives.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| numOrders | No | ||
| minOccurrences | No |