Class: OpportunityBriefing::OutletPurchaseSnapshot

Inherits:
Object
  • Object
show all
Includes:
SnapshotFormatting, Service
Defined in:
app/services/opportunity_briefing/outlet_purchase_snapshot.rb

Overview

Retailer purchases attributed to this opportunity — the customer buying the
quoted product through Amazon, Home Depot, a distributor, instead of ordering
direct.

This is the single most decision-changing fact a briefing can carry: without
it the model reads an opportunity as live and recommends chasing a sale that
already closed. On the 2026-08-08 backfill, 15 matched opportunities were
still in follow_up an average of 210 days after the customer had bought.

Coverage matters as much as the purchase itself. 28% of matches are under a
quarter of the opportunity's value, which is an upsell to chase rather than a
lost deal — a marketplace order routinely misses the thermostat, sensor and
rough-in kit.

See Also:

  • CustomerOutletPurchase
  • doc/tasks/202608081330_OUTLET_PURCHASE_ATTRIBUTIONdoc/tasks/202608081330_OUTLET_PURCHASE_ATTRIBUTION.md

Defined Under Namespace

Classes: Result

Constant Summary collapse

LIMIT =
10

Instance Method Summary collapse

Methods included from Service

#attributes_used, #build_result, call, #logger

Methods included from Service::Initializer

#initialize

Instance Method Details

#callObject



31
32
33
34
35
36
# File 'app/services/opportunity_briefing/outlet_purchase_snapshot.rb', line 31

def call
  Result.new(
    items: outlet_purchases,
    count: count_data(outlet_purchases.size, scope.count, LIMIT)
  )
end