Sha256: 90532b427e30cd2c357b427546fc345ff3882af25952ed07971a71521139be3b

Contents?: true

Size: 746 Bytes

Versions: 11

Compression:

Stored size: 746 Bytes

Contents

require "shopify_cli"

module Node
  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("node.populate.draft_order.added", ShopifyCli::Project.current.env.shop, admin_url, id)
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
shopify-cli-1.14.0 lib/project_types/node/commands/populate/draft_order.rb
shopify-cli-1.13.1 lib/project_types/node/commands/populate/draft_order.rb
shopify-cli-1.13.0 lib/project_types/node/commands/populate/draft_order.rb
shopify-cli-1.12.0 lib/project_types/node/commands/populate/draft_order.rb
shopify-cli-1.11.0 lib/project_types/node/commands/populate/draft_order.rb
shopify-cli-1.10.0 lib/project_types/node/commands/populate/draft_order.rb
shopify-cli-1.9.1 lib/project_types/node/commands/populate/draft_order.rb
shopify-cli-1.9.0 lib/project_types/node/commands/populate/draft_order.rb
shopify-cli-1.8.0 lib/project_types/node/commands/populate/draft_order.rb
shopify-cli-1.7.1 lib/project_types/node/commands/populate/draft_order.rb
shopify-cli-1.7.0 lib/project_types/node/commands/populate/draft_order.rb