Sha256: 71fb3ffe2f59488595c67bce4aca0ef8b0aa40bb20c23a6f9a4985c87f77026b

Contents?: true

Size: 748 Bytes

Versions: 20

Compression:

Stored size: 748 Bytes

Contents

require 'shopify_cli'

module Rails
  module Commands
    class Populate
      class DraftOrder < ShopifyCli::AdminAPI::PopulateResourceCommand
        @input_type = :DraftOrderInput

        def defaults
          {
            lineItems: [{
              originalUnitPrice: price,
              quantity: 1,
              weight: { value: 10, unit: 'GRAMS' },
              title: ShopifyCli::Helpers::Haikunator.title,
            }],
          }
        end

        def message(data)
          ret = data['draftOrderCreate']['draftOrder']
          id = ShopifyCli::API.gid_to_id(ret['id'])
          @ctx.message('rails.populate.draft_order.added', ShopifyCli::Project.current.env.shop, admin_url, id)
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
shopify-cli-1.6.0 lib/project_types/rails/commands/populate/draft_order.rb
shopify-cli-1.5.0 lib/project_types/rails/commands/populate/draft_order.rb
shopify-cli-1.4.1 lib/project_types/rails/commands/populate/draft_order.rb
shopify-cli-1.4.0 lib/project_types/rails/commands/populate/draft_order.rb
shopify-cli-1.3.1 lib/project_types/rails/commands/populate/draft_order.rb
shopify-cli-1.3.0 lib/project_types/rails/commands/populate/draft_order.rb
shopify-cli-1.2.0 lib/project_types/rails/commands/populate/draft_order.rb
shopify-cli-1.1.2 lib/project_types/rails/commands/populate/draft_order.rb
shopify-cli-1.1.1 lib/project_types/rails/commands/populate/draft_order.rb
shopify-cli-1.1.0 lib/project_types/rails/commands/populate/draft_order.rb
shopify-cli-1.0.5 lib/project_types/rails/commands/populate/draft_order.rb
shopify-cli-1.0.4 lib/project_types/rails/commands/populate/draft_order.rb
shopify-cli-1.0.3 lib/project_types/rails/commands/populate/draft_order.rb
shopify-cli-1.0.2 lib/project_types/rails/commands/populate/draft_order.rb
shopify-cli-1.0.1 lib/project_types/rails/commands/populate/draft_order.rb
shopify-cli-1.0.0 lib/project_types/rails/commands/populate/draft_order.rb
shopify-cli-0.9.3 lib/project_types/rails/commands/populate/draft_order.rb
shopify-cli-0.9.2 lib/project_types/rails/commands/populate/draft_order.rb
shopify-cli-0.9.1 lib/project_types/rails/commands/populate/draft_order.rb
shopify-cli-0.9.0 lib/project_types/rails/commands/populate/draft_order.rb