Skip to content

feat(shopping): show where AI sends shoppers, and flag resellers cheaper than the brand #1277

Closed

Description

@gkhngyk

Summary

Every product card we capture links to a merchant. classifyMerchant (#1186, shipped in #1242) already tells whether that link goes to the brand's own store, a marketplace (Amazon, eBay, Walmart, Etsy, AliExpress, Temu, Trendyol, Hepsiburada) or another reseller. Nothing stores or shows the result yet.

This issue stores the destination on each card. It then shows a split of the brand's own products by destination, and flags a reseller selling the brand's product for less.

Scope

  1. Store the destination on each card.
    • Add merchant_kind (own / marketplace / reseller), marketplace and listing_id to prompt_result_shopping_cards.
    • Set them where cards are inserted (cloro-result-handler.js), with classifyMerchant(card.merchant_url, { brandDomains }) and the brand's brand_domains.
    • A card with no merchant URL stays unclassified (null).
    • Classify existing rows from their stored merchant_url, either in backfill-shopping-cards.js or in a one-off pass.
  2. "Where AI sends shoppers" split.
    • Covers the brand's own products: cards with matched_brand_role = 'own'.
    • Segments: your store, Amazon, Walmart, eBay, other marketplaces, other resellers.
    • Same window and filters as the Overview tab: add it to shopping_overview or a sibling read.
    • Unclassified cards are counted and shown apart, not spread over the segments.
  3. Shopping page.
    • A card with a split bar on the Overview tab of the Shopping page, read through shopping.ts.
    • When the Shelf view and the Products table exist, the same split goes on Shelf and under the revenue column in Products.
  4. "Reseller cheaper than you" alert.
    • For one of the brand's products in the window, compare the lowest price seen on the brand's own store with the price on a reseller or marketplace card.
    • Match the two cards by listing id, or by normalized title plus brand until catalog matching exists.
    • Flag when the reseller is lower by at least 5% in the same currency.
    • Show the flagged products as a list on the Shopping page, with both prices and both links. It becomes a Readiness row once Readiness exists.

Acceptance criteria

  • New cards get merchant_kind, marketplace and listing_id on insert. Existing cards are classified by the backfill.
  • For any window, the split's segments add up to 100% of the classified own cards, and each segment equals the count of those cards.
  • Unclassified cards show as a separate count.
  • A fixture with an own-store card at 120 USD and an Amazon card for the same product at 99 USD raises the alert. Equal prices or different currencies don't.
  • Server tests cover the classification on insert and the alert rule.

Activity

  1. added
    enhancement
    e-commerce
    on Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    e-commerceenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions