Skip to main content

Overview

Saved shops connect purchase history, spending totals, visit tracking, Gmail receipt discovery, and the Shopping Agent. In the app and code these records are called dispensaries; user-facing screens may call them Shops.
Order Activation is the source of truth for how shops interact with Gmail, text order review, and durable order saving.

Add a shop

Open Shops & Dispensaries and choose Add. The current full form supports: Name is the only required field. Gmail can open this setup inline so a user can save where they shopped and confirm a receipt sender domain without abandoning the import flow.

Email fields and Gmail readiness

The backend stores two different concepts:
  • email: a contact address or domain-like value.
  • emailDomains: one or more normalized sender domains used by Quick Sync.
The main Add/Edit form manages both. Contact email or website may suggest a domain, but that domain is not Gmail search scope until the user confirms it. Confirmed domains normalize, validate, deduplicate, and can be removed. The Gmail wizard provides the same lightweight setup inline. It saves or enriches the shop, then rescans only the newly confirmed domain. When a text or Gmail order is committed with a dispensary name, the server:
  1. uses a requested owned dispensary ID when one is supplied;
  2. otherwise searches the user’s shops by exact name;
  3. creates a name-only shop if no exact match exists;
  4. stores the shop ID and display name on the order; and
  5. reserves a durable visit effect that increments visit count and last visit.
The shared text/Gmail Review & Confirm screen provides friendly shop selection and correction before save. Editing a saved order to a genuinely different historical shop label detaches a stale dispensaryId instead of attributing the purchase to the wrong managed shop.

Gmail-created shops

Gmail order confirmation can create a shop from the reviewed dispensary name, record a visit, and attach the validated sender domain. The shop is then ready for targeted future Quick Sync.

Edit, favorite, view history, and delete

From the shop list or detail screen, users can:
  • edit the fields supported by the full form;
  • favorite or unfavorite a shop;
  • open its website, location, or menu links when present;
  • view orders linked by dispensaryId and spending totals; and
  • delete the saved shop after confirmation.
Deleting a shop removes its Convex dispensary record. Existing orders retain their stored dispensary name and are atomically detached from the deleted shop ID. The current delete path does not merge the shop into another record.

Onboarding status

The onboarding question Where do you usually shop? currently searches a small mock list and saves only the onboarding answer. It does not create a Convex dispensary and does not provide Gmail with a usable domain. Gmail’s activation path already uses a real saved-shop flow and asks for a confirmed receipt sender domain before its default targeted scan. The standalone onboarding picker remains preview-only.

Current limitations

  • Domains are user-confirmed but do not yet carry a separate ownership or confidence score.
  • Exact-name backend upsert can produce variants instead of a merged record.
  • No merge-duplicate-shops action.
  • Deleting a shop does not offer to reassign historical orders first.

Order Activation

See the complete shop, Gmail, text, strain, and save contract.

Gmail Sync

Connect Gmail and review candidate receipts.

Dispensary Flow Map

A concise lifecycle diagram that points back to the canonical flow.

Shopping Agent

Use saved menu URLs for shopping workflows.