Class: ListingIssues::BaseAdapter
- Inherits:
-
Object
- Object
- ListingIssues::BaseAdapter
- Defined in:
- app/services/listing_issues/base_adapter.rb
Overview
Interface every provider adapter implements. An adapter knows (a) which
catalog items to reconcile this run and (b) the current set of listing
issues for a given item — both derived from that provider's own data, with
no external API calls (the marketplace pulls already persist the signals).
Direct Known Subclasses
AmazonAdapter, GoogleAdapter, RetailerProbeAdapter, WalmartAdapter, WayfairAdapter, WebsiteAdapter
Instance Method Summary collapse
-
#candidate_item_ids ⇒ Array<Integer>
catalog_item ids to reconcile: every item that currently shows a signal, plus every item with an open issue already recorded for this provider (so cleared issues get auto-resolved on the next run).
-
#eager_load ⇒ Array
Associations the bulk Sync should eager-load on each candidate before calling #issues_for, to avoid N+1s.
-
#issues_for(_catalog_item) ⇒ Array<ListingIssues::Issue>
Current issues for the item.
-
#provider ⇒ String
Provider key stored on ListingIssue#provider.
Instance Method Details
#candidate_item_ids ⇒ Array<Integer>
catalog_item ids to reconcile: every item that currently shows a signal,
plus every item with an open issue already recorded for this provider (so
cleared issues get auto-resolved on the next run).
18 19 20 |
# File 'app/services/listing_issues/base_adapter.rb', line 18 def candidate_item_ids raise NotImplementedError end |
#eager_load ⇒ Array
Associations the bulk Sync should eager-load on each
candidate before calling #issues_for, to avoid N+1s. Default none;
providers override with whatever their checks touch.
32 33 34 |
# File 'app/services/listing_issues/base_adapter.rb', line 32 def eager_load [] end |
#issues_for(_catalog_item) ⇒ Array<ListingIssues::Issue>
Returns current issues for the item.
24 25 26 |
# File 'app/services/listing_issues/base_adapter.rb', line 24 def issues_for(_catalog_item) raise NotImplementedError end |
#provider ⇒ String
Returns provider key stored on ListingIssue#provider.
10 11 12 |
# File 'app/services/listing_issues/base_adapter.rb', line 10 def provider raise NotImplementedError end |