Class: AmazonPricingAutomationWorker
- Inherits:
-
Object
- Object
- AmazonPricingAutomationWorker
- Includes:
- Sidekiq::Job, Workers::StatusBroadcastable
- Defined in:
- app/workers/amazon_pricing_automation_worker.rb
Overview
Sidekiq worker: amazon pricing automation.
Instance Attribute Summary
Attributes included from Workers::StatusBroadcastable
Instance Method Summary collapse
-
#perform(options = {}) ⇒ Object
Runs pricing automation for Amazon Seller Central US (76) and Canada (77).
Methods included from Workers::StatusBroadcastable::Overrides
Instance Method Details
#perform(options = {}) ⇒ Object
Runs pricing automation for Amazon Seller Central US (76) and Canada (77).
EU is deliberately NOT here yet, though AmazonCatalogItemListingsDataWorker
now collects its offer data. Every one of the ~259 EU listings carries
auto_buy_box because that is the column default, not because anyone chose
it, and their is_amz_buy_box_winner / is_amz_featured_merchant flags are
still the stale false they were created with. Enabling repricing in the
same change that starts populating those flags would put 259 prices under
automation the moment real data landed, on rules nobody set. Extend
CatalogConstants::AMAZON_SELLER_IDS here once the pulled data has been
reviewed and per-item rules are deliberate.
24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/workers/amazon_pricing_automation_worker.rb', line 24 def perform( = {}) [:catalog_ids] = [CatalogConstants::AMAZON_SC_US_CATALOG_ID, CatalogConstants::AMAZON_SC_CA_CATALOG_ID] if [:catalog_ids].blank? result = Catalog::AmazonPricingAutomationService.new.process() do |status| at 0, "Processing catalog item #{status[:catalog_item].id} (#{status[:catalog_item].sku})" if status[:catalog_item] end logger.info "Amazon Pricing Automation completed: #{result.processed_count} processed, #{result.price_increased_count} prices increased, #{result.price_lowered_count} prices lowered, #{result.flagged_count} flagged" store redirect_to: [:redirect_to] end |