▼ DOC 10

Oil Engine

Cross-vendor duplicate detection + discontinued-oil swap workflow

The Oil Engine is a single dialog that handles two related catalog problems: cross-vendor duplicates (the same oil sold by two vendors under the same name) and discontinued-oil swaps(vendor pulled the SKU; here's a replacement).

Where it surfaces

  • Auto-fired when the dupe detector runs after a library add.
  • SWAP button on any discontinued row in Inventory or Library.
  • Manual RUN ENGINE button on Inventory.

Cross-vendor duplicates

Detects when you have the same oil from two different houses. Pick the keep, merge the other in. Detector is Jaccard scoring on tokenized names (≥ 0.6) plus matching family. Same-vendor duplicates aren't flagged — those are usually the same SKU listed twice and the upsert layer dedupes them.

Discontinued-oil swap states

  • DISCONTINUED · 10 oz leftInitial state — vendor pulled the SKU, you still have stock.
  • swapped → Mahogany CoconutAfter swap — recipes routed to the new oil; old row stays so you use up remaining stock.
  • 0 oz · REMOVEStock is exhausted — REMOVE button surfaces. Click to remove the library link (catalog row stays untouched).

Replacement matching

  • Same name across vendors always wins — Gingerbread → Gingerbread surfaces first regardless of note overlap.
  • Falls back to note-similarity when no exact name match exists.
  • Manual search — “Find replacement manually” opens a debounced catalog search if the auto-picks miss.
  • $/lb shown on every candidate (computed at your preferred buy size from Settings).
  • “Stop flagging this” dismisses without swapping — use when you're using up the bottle and don't want a replacement.