Onboarding — lifting a venue's supplier products into the group catalogue
When a single-venue restaurant becomes the first member of a new multi-venue group, the group catalogue starts empty. The venue’s recipes, menu, suppliers, and inventory all live per-venue. The first lift moves the structural masters in one pass. The supplier-products catalogue, though — the long tail of every wine, every flour bag, every box of San Marzano tomatoes the venue has ever sourced — is too large for a single transaction. That’s where this page comes in.
What it does
A single click in the super-admin venue-group detail page paginates through the source venue’s entire supplier-products catalogue, copying each row into the group catalogue, deduplicating by SKU + supplier, and back-linking the per-venue row so the chain can see what’s where. The work runs in the background — the operator doesn’t have to keep the tab open — and a live progress card shows batches processed plus rolling totals for “lifted”, “already linked”, “approved at group”, and “skipped (no supplier)”.
The lift is idempotent. Already-lifted rows are detected via the back-link and counted under “already linked”; new group rows dedupe on the (supplier, SKU) pair. A re-run after a partial failure picks up forward — nothing is duplicated, nothing is overwritten. Approvals propagate when the per-venue inventory item they feed is already group-lifted (so the chain catalogue arrives partially approved, not as a giant Product Hunt of unknowns).
A second lift cannot start for the same group while one is already running — a concurrency gate keeps the cursor + totals deterministic. Cancellation flips the run to “failed” with the message “cancelled by operator” and the background scheduler bails on its next tick; the in-flight batch finishes, then nothing further is scheduled.
How to use it
Open the super-admin venue-group detail page at /admin/super/venue-groups/<id>. Between Member venues and Members there’s a new card, Lift supplier products. When the group has exactly one member venue, the source is auto-selected; with more than one, pick from the dropdown. Click Lift supplier products and the progress card replaces the button. The card shows a spinner, the number of batches processed so far, and the four running totals. Click Cancel to abort; the count stops at the next batch boundary.
When the lift finishes, the card turns green with the final totals and a Re-run button. Re-running is safe — already-lifted rows are skipped.
Worked example
io osteria has 4,800 supplier-products rows on its Rome venue, accumulated over years of menu evolution. The operator opens io osteria’s group detail page, picks Rome in the source-venue dropdown (the group has two members at this point), and clicks Lift supplier products. The card flips to “Lifting in progress” with Batches: 0. Over the next two minutes, the totals tick up: Batches: 1, Lifted: 248, Already linked: 0, Approved at group: 12, Skipped: 0 … Batches: 19, Lifted: 4763, Already linked: 0, Approved at group: 187, Skipped: 37. The skipped rows are products whose supplier was never lifted to the group (a venue-local supplier the operator never wanted shared); they stay venue-local. When done, the card turns green: “Lift completed · Batches: 20 · Lifted: 4,800 · Approved: 187”.