Sha256: f924e3bf97c1d41d40739c42bb82b24732e14044b843f3267febc819502c8b51

Contents?: true

Size: 1.72 KB

Versions: 2

Compression:

Stored size: 1.72 KB

Contents

# frozen_string_literal: true

module MuffinMan
  module RequestHelpers
    module OutboundFulfillment
      class V20200701
        def self.address_request(name, address_line1, state_or_region, country_code, optional_params = {})
          Address.new({
            "name" => name,
            "address_line1" => address_line1,
            "state_or_region" => state_or_region,
            "country_code" => country_code
          }.merge(optional_params))
        end

        def self.item_request(seller_sku, seller_fulfillment_order_item_id, quantity, optional_params = {})
          Item.new({
            "seller_sku" => seller_sku,
            "seller_fulfillment_order_item_id" => seller_fulfillment_order_item_id,
            "quantity" => quantity
          }.merge(optional_params))
        end

        # rubocop:disable Metrics/ParameterLists
        def self.fulfillment_order_request(seller_fulfillment_order_id, displayable_order_id,
                                           displayable_order_date_time,
                                           displayable_order_comment, shipping_speed_category,
                                           destination_address, items, optional_params = {})
          FulfillmentOrderRequest.new(seller_fulfillment_order_id, displayable_order_id, displayable_order_date_time,
                                      displayable_order_comment, shipping_speed_category, destination_address,
                                      items, optional_params)
        end
        # rubocop:enable Metrics/ParameterLists

        def self.fulfillment_preview_request(address, items, optional_params = {})
          FulfillmentPreviewRequest.new(address, items, optional_params)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
muffin_man-1.5.4 lib/muffin_man/request_helpers/outbound_fulfillment/v20200701.rb
muffin_man-1.5.3 lib/muffin_man/request_helpers/outbound_fulfillment/v20200701.rb