From b769115a3f31457dbdc40dacaf5a4b4515ef9065 Mon Sep 17 00:00:00 2001 From: Rutaba Date: Tue, 4 Feb 2020 18:16:07 +0500 Subject: [PATCH 01/16] Added :collects attribute to %CustomCollection{} According to the shopify documentation (https://help.shopify.com/en/api/reference/products/customcollection), the Collect resource is used to connect a product to a custom collection using the :collects attribute which was missing here. --- lib/shopify/resources/custom_collection.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/shopify/resources/custom_collection.ex b/lib/shopify/resources/custom_collection.ex index 19a4e0c..95d4dcf 100644 --- a/lib/shopify/resources/custom_collection.ex +++ b/lib/shopify/resources/custom_collection.ex @@ -29,7 +29,8 @@ defmodule Shopify.CustomCollection do :sort_order, :template_suffix, :title, - :updated_at + :updated_at, + :collects ] @doc false From 0a477c649163746b77af577935fc7673aae87455 Mon Sep 17 00:00:00 2001 From: Rutaba Date: Wed, 5 Feb 2020 11:55:14 +0500 Subject: [PATCH 02/16] Update smart_collection.ex --- lib/shopify/resources/smart_collection.ex | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/shopify/resources/smart_collection.ex b/lib/shopify/resources/smart_collection.ex index 92216bf..ac74b70 100644 --- a/lib/shopify/resources/smart_collection.ex +++ b/lib/shopify/resources/smart_collection.ex @@ -14,7 +14,7 @@ defmodule Shopify.SmartCollection do ] alias Shopify.{ - CustomCollection + SmartCollection } defstruct [ @@ -30,12 +30,13 @@ defmodule Shopify.SmartCollection do :sort_order, :template_suffix, :title, - :updated_at + :updated_at, + :products_manually_sorted_count ] @doc false def empty_resource do - %CustomCollection{} + %SmartCollection{} end @doc false From 4f402545d6e2ff51943d20def826774b538a7092 Mon Sep 17 00:00:00 2001 From: rutabaniazi Date: Wed, 26 Feb 2020 15:40:59 +0500 Subject: [PATCH 03/16] Updated to :width and :height to image struct as per Shopify API version 2020-01 added the updated to include additional image details --- lib/shopify/resources/image.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/shopify/resources/image.ex b/lib/shopify/resources/image.ex index 643e51d..741a868 100644 --- a/lib/shopify/resources/image.ex +++ b/lib/shopify/resources/image.ex @@ -25,7 +25,9 @@ defmodule Shopify.Image do :product_id, :src, :updated_at, - :variant_ids + :variant_ids, + :width, + :height ] @doc false From dfb991d1c9e41a731af8faee3eb9b4f9a10e9aae Mon Sep 17 00:00:00 2001 From: rutabaniazi Date: Wed, 26 Feb 2020 16:05:57 +0500 Subject: [PATCH 04/16] Added tax_code, presentment_prices, image_id Added the new fields and deleted the deprecated field :requires_shipping as per Shopify API 2020-01 --- lib/shopify/resources/variant.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/shopify/resources/variant.ex b/lib/shopify/resources/variant.ex index 0a1fe96..da067c1 100644 --- a/lib/shopify/resources/variant.ex +++ b/lib/shopify/resources/variant.ex @@ -28,6 +28,7 @@ defmodule Shopify.Variant do :weight, :weight_unit, :id, + :image_id, :inventory_item_id, :inventory_management, :inventory_policy, @@ -36,11 +37,12 @@ defmodule Shopify.Variant do :option2, :option3, :position, + :presentment_prices, :price, :product_id, - :requires_shipping, :sku, :taxable, + :tax_code, :title, :updated_at ] From 3856daa278119001cabcf5e7111e755a3fc26295 Mon Sep 17 00:00:00 2001 From: rutabaniazi Date: Wed, 26 Feb 2020 16:18:59 +0500 Subject: [PATCH 05/16] removed deprecated properties removed :metafields, :metafields_global_title_tag, :metafields_global_description_tag to keep it updated with shopify API version 2020-01 --- lib/shopify/resources/product.ex | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/shopify/resources/product.ex b/lib/shopify/resources/product.ex index 6aa7d3d..fde6dff 100644 --- a/lib/shopify/resources/product.ex +++ b/lib/shopify/resources/product.ex @@ -33,9 +33,6 @@ defmodule Shopify.Product do :tags, :template_suffix, :title, - :metafields, - :metafields_global_title_tag, - :metafields_global_description_tag, :updated_at, :variants, :vendor From 1f2e677ec4c6cf659cbae1fdfb260566a3e28970 Mon Sep 17 00:00:00 2001 From: rutabaniazi Date: Wed, 26 Feb 2020 16:21:41 +0500 Subject: [PATCH 06/16] removed :featured deprecated --- lib/shopify/resources/collect.ex | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/shopify/resources/collect.ex b/lib/shopify/resources/collect.ex index 44f08b4..160bcfe 100644 --- a/lib/shopify/resources/collect.ex +++ b/lib/shopify/resources/collect.ex @@ -19,7 +19,6 @@ defmodule Shopify.Collect do defstruct [ :collection_id, :created_at, - :featured, :id, :position, :product_id, From 9fe4e373280c8c5ca01e55b87549f781b2e6d0d0 Mon Sep 17 00:00:00 2001 From: rutabaniazi Date: Wed, 26 Feb 2020 16:31:02 +0500 Subject: [PATCH 07/16] Added new properties to customer struct added :accepts_marketing_updated_at, :metafield, :marketing_opt_in_level and :tax_exemptions --- lib/shopify/resources/customer.ex | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/shopify/resources/customer.ex b/lib/shopify/resources/customer.ex index 6bb167b..ec8c4e5 100644 --- a/lib/shopify/resources/customer.ex +++ b/lib/shopify/resources/customer.ex @@ -22,6 +22,7 @@ defmodule Shopify.Customer do defstruct [ :accepts_marketing, + :accepts_marketing_updated_at, :addresses, :created_at, :currency, @@ -34,11 +35,14 @@ defmodule Shopify.Customer do :last_name, :last_order_id, :last_order_name, + :metafield, + :marketing_opt_in_level, :note, :orders_count, :state, :tags, :tax_exempt, + :tax_exemptions, :total_spent, :updated_at, :verified_email, From f7ee9cf7860da5943c6f87f0cd460b2a4156f85b Mon Sep 17 00:00:00 2001 From: rutabaniazi Date: Wed, 26 Feb 2020 16:33:40 +0500 Subject: [PATCH 08/16] Added :name and removed :id and :default --- lib/shopify/resources/customer_address.ex | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/shopify/resources/customer_address.ex b/lib/shopify/resources/customer_address.ex index c53dbb6..cdda12c 100644 --- a/lib/shopify/resources/customer_address.ex +++ b/lib/shopify/resources/customer_address.ex @@ -23,6 +23,7 @@ defmodule Shopify.CustomerAddress do :company, :first_name, :last_name, + :name, :phone, :province, :country, @@ -30,9 +31,7 @@ defmodule Shopify.CustomerAddress do :name, :province_code, :country_code, - :country_name, - :id, - :default + :country_name ] @doc false From 3a80f95a325eab5ad98a8b0a6d7f30cea2073600 Mon Sep 17 00:00:00 2001 From: rutabaniazi Date: Wed, 26 Feb 2020 16:37:15 +0500 Subject: [PATCH 09/16] Added new properties and removed deprecated ones --- lib/shopify/resources/customer_saved_search.ex | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/shopify/resources/customer_saved_search.ex b/lib/shopify/resources/customer_saved_search.ex index a4d53f5..3859c96 100644 --- a/lib/shopify/resources/customer_saved_search.ex +++ b/lib/shopify/resources/customer_saved_search.ex @@ -5,11 +5,14 @@ defmodule Shopify.CustomerSavedSearch do use Shopify.Resource, import: [:all, :find, :create, :update, :delete, :count] defstruct [ - :created_at, - :id, - :name, - :query, - :updated_at + :accepts_marketing, + :country, + :last_abandoned_order_date, + :last_order_date, + :orders_count, + :state, + :tag, + :total_spent ] @doc false From c730bb8960a804ee51f7ca0792e344726adc7b78 Mon Sep 17 00:00:00 2001 From: rutabaniazi Date: Wed, 26 Feb 2020 16:46:52 +0500 Subject: [PATCH 10/16] Updated the struct updated the struct as per Shopify API version 2020-01 --- lib/shopify/resources/discount_code.ex | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/shopify/resources/discount_code.ex b/lib/shopify/resources/discount_code.ex index 5065189..38df6ab 100644 --- a/lib/shopify/resources/discount_code.ex +++ b/lib/shopify/resources/discount_code.ex @@ -4,8 +4,11 @@ defmodule Shopify.DiscountCode do @derive [Poison.Encoder] defstruct [ - :amount, :code, - :type - ] + :created_at, + :updated_at, + :id, + :price_rule_id, + :usage_count + ] end From a8d804eb03d7519b1b11a7d5a9ed6224b87525b8 Mon Sep 17 00:00:00 2001 From: rutabaniazi Date: Wed, 26 Feb 2020 16:53:10 +0500 Subject: [PATCH 11/16] added :allocation_limit, :prerequisite_to_entitlement_quantity_ratio --- lib/shopify/resources/price_rule.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/shopify/resources/price_rule.ex b/lib/shopify/resources/price_rule.ex index f414dd2..44f948a 100644 --- a/lib/shopify/resources/price_rule.ex +++ b/lib/shopify/resources/price_rule.ex @@ -19,6 +19,7 @@ defmodule Shopify.PriceRule do :customer_selection, :target_type, :target_selection, + :allocation_limit :allocation_method, :once_per_customer, :usage_limit, @@ -36,7 +37,8 @@ defmodule Shopify.PriceRule do :entitled_country_ids, :prerequisite_saved_search_ids, :prerequisite_customer_ids, - :discount_codes + :discount_codes, + :prerequisite_to_entitlement_quantity_ratio ] @doc false From b543f255a1300b6a7fd17f610aef012b6f1e3171 Mon Sep 17 00:00:00 2001 From: rutabaniazi Date: Wed, 26 Feb 2020 16:55:40 +0500 Subject: [PATCH 12/16] removed :description property --- lib/shopify/resources/event.ex | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/shopify/resources/event.ex b/lib/shopify/resources/event.ex index d56552a..de3e428 100644 --- a/lib/shopify/resources/event.ex +++ b/lib/shopify/resources/event.ex @@ -15,7 +15,6 @@ defmodule Shopify.Event do :body, :created_at, :id, - :description, :path, :message, :subject_id, From da1ecd10adf405c234f273e575079594129d4f40 Mon Sep 17 00:00:00 2001 From: rutabaniazi Date: Wed, 26 Feb 2020 16:57:18 +0500 Subject: [PATCH 13/16] Added :api_version --- lib/shopify/resources/webhook.ex | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/shopify/resources/webhook.ex b/lib/shopify/resources/webhook.ex index 67587fb..2674c7f 100644 --- a/lib/shopify/resources/webhook.ex +++ b/lib/shopify/resources/webhook.ex @@ -20,6 +20,7 @@ defmodule Shopify.Webhook do defstruct [ :address, + :api_version, :created_at, :fields, :format, From f5f2b99ac67f5bd51dfe269f358a0878b47ccc29 Mon Sep 17 00:00:00 2001 From: rutabaniazi Date: Wed, 26 Feb 2020 16:59:18 +0500 Subject: [PATCH 14/16] Added properties --- lib/shopify/resources/inventory_item.ex | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/shopify/resources/inventory_item.ex b/lib/shopify/resources/inventory_item.ex index f63776f..c22c63f 100644 --- a/lib/shopify/resources/inventory_item.ex +++ b/lib/shopify/resources/inventory_item.ex @@ -14,6 +14,11 @@ defmodule Shopify.InventoryItem do :id, :sku, :cost, + :country_code_of_origin, + :country_harmonized_system_codes, + :harmonized_system_code, + :province_code_of_origin, + :requires_shipping, :tracked, :created_at, :updated_at From 0ad4229cd5784bb1261e0b6158e4088b07c5e809 Mon Sep 17 00:00:00 2001 From: rutabaniazi Date: Fri, 28 Feb 2020 10:38:00 +0500 Subject: [PATCH 15/16] Delete customer_saved_search.ex --- .../resources/customer_saved_search.ex | 29 ------------------- 1 file changed, 29 deletions(-) delete mode 100644 lib/shopify/resources/customer_saved_search.ex diff --git a/lib/shopify/resources/customer_saved_search.ex b/lib/shopify/resources/customer_saved_search.ex deleted file mode 100644 index 3859c96..0000000 --- a/lib/shopify/resources/customer_saved_search.ex +++ /dev/null @@ -1,29 +0,0 @@ -defmodule Shopify.CustomerSavedSearch do - @plural "customer_saved_searches" - @singular "customer_saved_search" - - use Shopify.Resource, import: [:all, :find, :create, :update, :delete, :count] - - defstruct [ - :accepts_marketing, - :country, - :last_abandoned_order_date, - :last_order_date, - :orders_count, - :state, - :tag, - :total_spent - ] - - @doc false - def empty_resource, do: %__MODULE__{} - - @doc false - def all_url, do: @plural <> ".json" - - @doc false - def find_url(id), do: @plural <> "/#{id}.json" - - @doc false - def count_url, do: @plural <> "/count.json" -end From ed85f3023827e81fcea0cf1e723693ac47e3c3ca Mon Sep 17 00:00:00 2001 From: rutabaniazi Date: Fri, 28 Feb 2020 10:40:42 +0500 Subject: [PATCH 16/16] Create customer_saved_search.ex --- .../resources/customer_saved_search.ex | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 lib/shopify/resources/customer_saved_search.ex diff --git a/lib/shopify/resources/customer_saved_search.ex b/lib/shopify/resources/customer_saved_search.ex new file mode 100644 index 0000000..a4d53f5 --- /dev/null +++ b/lib/shopify/resources/customer_saved_search.ex @@ -0,0 +1,26 @@ +defmodule Shopify.CustomerSavedSearch do + @plural "customer_saved_searches" + @singular "customer_saved_search" + + use Shopify.Resource, import: [:all, :find, :create, :update, :delete, :count] + + defstruct [ + :created_at, + :id, + :name, + :query, + :updated_at + ] + + @doc false + def empty_resource, do: %__MODULE__{} + + @doc false + def all_url, do: @plural <> ".json" + + @doc false + def find_url(id), do: @plural <> "/#{id}.json" + + @doc false + def count_url, do: @plural <> "/count.json" +end