Class: ItemBuilderMwh::Modes::Simple::LazadaService

Inherits:
Base
  • Object
show all
Defined in:
lib/item_builder_mwh/modes/simple/lazada_service.rb

Instance Attribute Summary

Attributes inherited from Base

#available_quantity, #listing

Instance Method Summary collapse

Methods inherited from Base

#api_data, #apigateway_get, #apigateway_post, #credential, #data, #headers, #initialize, #order_host, #reserved_params, #reserved_stock, #sale_price_policy

Constructor Details

This class inherits a constructor from ItemBuilderMwh::Modes::Simple::Base

Instance Method Details

#performObject



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/item_builder_mwh/modes/simple/lazada_service.rb', line 10

def perform
  {
    price: listing.price,
    sale_price: listing.sale_price,
    sale_start_at: listing.sale_start_at,
    sale_end_at: listing.sale_end_at,
    quantity: available_quantity + reserved_stock.to_i,
    warehouse_id: wh_mapping(
      warehouse_space.warehouse_id
    )
  }
end