From f805342d0900c6ead4f34c82e811ebb140739451 Mon Sep 17 00:00:00 2001 From: James Lynch Date: Wed, 21 Jun 2023 15:37:24 -0400 Subject: [PATCH 1/2] Update PriceRule.cs Fixed property names to match ShopifySharp standard Signed-off-by: James Lynch --- ShopifySharp/Entities/PriceRule.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ShopifySharp/Entities/PriceRule.cs b/ShopifySharp/Entities/PriceRule.cs index f0136552..542c20f7 100644 --- a/ShopifySharp/Entities/PriceRule.cs +++ b/ShopifySharp/Entities/PriceRule.cs @@ -79,7 +79,7 @@ public class PriceRule : ShopifyObject public PrerequisiteValueRange PrerequisiteShippingPriceRange { get; set; } [JsonProperty("prerequisite_quantity_range")] - public PrerequisiteQuantityRange prerequisite_quantity_range { get; set; } + public PrerequisiteQuantityRange PrerequisiteQuantityRange { get; set; } /** * A list of prerequisite customer saved search ids. For the price rule to be applicable, @@ -89,24 +89,24 @@ public class PriceRule : ShopifyObject public IEnumerable PrerequisiteSavedSearchIds { get; set; } [JsonProperty("customer_segment_prerequisite_ids")] - public IEnumerable customer_segment_prerequisite_ids { get; set; } + public IEnumerable CustomerSegmentPrerequisiteIds { get; set; } [JsonProperty("prerequisite_to_entitlement_purchase")] - public PrerequisiteToEntitlementPurchase prerequisite_to_entitlement_purchase { get; set; } + public PrerequisiteToEntitlementPurchase PrerequisiteToEntitlementPurchase { get; set; } [JsonProperty("prerequisite_product_ids")] - public IEnumerable prerequisite_product_ids { get; set; } + public IEnumerable PrerequisiteProductIds { get; set; } [JsonProperty("prerequisite_variant_ids")] - public IEnumerable prerequisite_variant_ids { get; set; } + public IEnumerable PrerequisiteVariantIds { get; set; } [JsonProperty("prerequisite_collection_ids")] - public List prerequisite_collection_ids { get; set; } + public List PrerequisiteCollectionIds { get; set; } [JsonProperty("prerequisite_to_entitlement_quantity_ratio")] - public PrerequisiteToEntitlementQuantityRatio prerequisite_to_entitlement_quantity_ratio { get; set; } + public PrerequisiteToEntitlementQuantityRatio PrerequisiteToEntitlementQuantityRatio { get; set; } [JsonProperty("allocation_limit")] - public int allocation_limit { get; set; } + public int AllocationLimit { get; set; } @@ -173,4 +173,4 @@ public class PriceRule : ShopifyObject [JsonProperty("updated_at")] public DateTimeOffset? UpdatedAt { get; set; } } -} \ No newline at end of file +} From 5ff31df2eb1ccd58f53a590d6a271ec60dae9d57 Mon Sep 17 00:00:00 2001 From: Jim Lynch Date: Thu, 22 Jun 2023 14:36:45 -0400 Subject: [PATCH 2/2] More Format Fixes --- ShopifySharp/Entities/PrerequisiteQuantityRange.cs | 2 +- ShopifySharp/Entities/PrerequisiteToEntitlementPurchase.cs | 2 +- .../Entities/PrerequisiteToEntitlementQuantityRatio.cs | 4 ++-- ShopifySharp/Entities/PriceRule.cs | 6 +++++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ShopifySharp/Entities/PrerequisiteQuantityRange.cs b/ShopifySharp/Entities/PrerequisiteQuantityRange.cs index d0535a05..292d5aa1 100644 --- a/ShopifySharp/Entities/PrerequisiteQuantityRange.cs +++ b/ShopifySharp/Entities/PrerequisiteQuantityRange.cs @@ -5,6 +5,6 @@ namespace ShopifySharp public class PrerequisiteQuantityRange { [JsonProperty("greater_than_or_equal_to")] - public int greater_than_or_equal_to { get; set; } + public int GreaterThanOrEqualTo { get; set; } } } \ No newline at end of file diff --git a/ShopifySharp/Entities/PrerequisiteToEntitlementPurchase.cs b/ShopifySharp/Entities/PrerequisiteToEntitlementPurchase.cs index 1fe6b243..6ddd1b5e 100644 --- a/ShopifySharp/Entities/PrerequisiteToEntitlementPurchase.cs +++ b/ShopifySharp/Entities/PrerequisiteToEntitlementPurchase.cs @@ -5,6 +5,6 @@ namespace ShopifySharp public class PrerequisiteToEntitlementPurchase { [JsonProperty("prerequisite_amount")] - public string prerequisite_amount { get; set; } + public string PrerequisiteAmount { get; set; } } } \ No newline at end of file diff --git a/ShopifySharp/Entities/PrerequisiteToEntitlementQuantityRatio.cs b/ShopifySharp/Entities/PrerequisiteToEntitlementQuantityRatio.cs index 0bcad0cb..68a2118a 100644 --- a/ShopifySharp/Entities/PrerequisiteToEntitlementQuantityRatio.cs +++ b/ShopifySharp/Entities/PrerequisiteToEntitlementQuantityRatio.cs @@ -5,9 +5,9 @@ namespace ShopifySharp public class PrerequisiteToEntitlementQuantityRatio { [JsonProperty("prerequisite_quantity")] - public int prerequisite_quantity { get; set; } + public int PrerequisiteQuantity { get; set; } [JsonProperty("entitled_quantity")] - public int entitled_quantity { get; set; } + public int EntitledQuantity { get; set; } } } \ No newline at end of file diff --git a/ShopifySharp/Entities/PriceRule.cs b/ShopifySharp/Entities/PriceRule.cs index 542c20f7..55e69ca7 100644 --- a/ShopifySharp/Entities/PriceRule.cs +++ b/ShopifySharp/Entities/PriceRule.cs @@ -78,6 +78,9 @@ public class PriceRule : ShopifyObject [JsonProperty("prerequisite_shipping_price_range")] public PrerequisiteValueRange PrerequisiteShippingPriceRange { get; set; } + /** + * Prerequisite cart quantity range. + */ [JsonProperty("prerequisite_quantity_range")] public PrerequisiteQuantityRange PrerequisiteQuantityRange { get; set; } @@ -102,11 +105,12 @@ public class PriceRule : ShopifyObject [JsonProperty("prerequisite_collection_ids")] public List PrerequisiteCollectionIds { get; set; } + [JsonProperty("prerequisite_to_entitlement_quantity_ratio")] public PrerequisiteToEntitlementQuantityRatio PrerequisiteToEntitlementQuantityRatio { get; set; } [JsonProperty("allocation_limit")] - public int AllocationLimit { get; set; } + public int? AllocationLimit { get; set; }