Skip to content

Commit 396e17c

Browse files
committed
full implementation of B2B_OFFER_CHANGE, some small code cleanum may still be needed.
Code tested with realtime data from amazon
1 parent dacbfe6 commit 396e17c

File tree

11 files changed

+111
-41
lines changed

11 files changed

+111
-41
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace FikaAmazonAPI.NotificationMessages
2+
{
3+
public class BuyBoxPriceB2B : PriceBaseB2B
4+
{
5+
}
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace FikaAmazonAPI.NotificationMessages
2+
{
3+
public class BuyBoxPriceB2C : PriceBaseB2C
4+
{
5+
}
6+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using Newtonsoft.Json;
2+
3+
namespace FikaAmazonAPI.NotificationMessages
4+
{
5+
public class LowestPriceB2B : PriceBaseB2B
6+
{
7+
/// <summary>
8+
/// Required. Indicates whether the item is fulfilled by Amazon or by the seller.
9+
/// </summary>
10+
/// <remarks>
11+
/// See values from FulfillmentChannelType class.
12+
/// </remarks>
13+
[JsonProperty("FulfillmentChannel")]
14+
public string FulfillmentChannel { get; set; }
15+
}
16+
}

Source/FikaAmazonAPI/NotificationMessages/LowestPrice.cs renamed to Source/FikaAmazonAPI/NotificationMessages/LowestPriceB2C.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace FikaAmazonAPI.NotificationMessages
66
/// <summary>
77
/// An explanation about the purpose of this instance.
88
/// </summary>
9-
public partial class LowestPrice : BuyBoxPrice
9+
public partial class LowestPriceB2C : PriceBaseB2C
1010
{
1111
/// <summary>
1212
/// Required. Indicates whether the item is fulfilled by Amazon or by the seller.

Source/FikaAmazonAPI/NotificationMessages/Price.cs

Lines changed: 0 additions & 14 deletions
This file was deleted.

Source/FikaAmazonAPI/NotificationMessages/BuyBoxPrice.cs renamed to Source/FikaAmazonAPI/NotificationMessages/PriceBase.cs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22

33
namespace FikaAmazonAPI.NotificationMessages
44
{
5-
6-
/// <summary>
7-
/// An explanation about the purpose of this instance.
8-
/// </summary>
9-
public partial class BuyBoxPrice
5+
public abstract class PriceBase
106
{
117
/// <summary>
128
/// Required. ListingPrice + Shipping - Points.
@@ -26,15 +22,6 @@ public partial class BuyBoxPrice
2622
[JsonProperty("Shipping")]
2723
public MoneyType Shipping { get; set; }
2824

29-
/// <summary>
30-
/// Optional. The number of Amazon Points offered with the purchase of an item.
31-
/// </summary>
32-
/// <remarks>
33-
/// Note: The Points object is only returned in Japan (JP).
34-
/// </remarks>
35-
[JsonProperty("Points", NullValueHandling = NullValueHandling.Ignore)]
36-
public Points Points { get; set; }
37-
3825
/// <summary>
3926
/// Required. Indicates the condition of the item. For example: New, Used, Collectible, Refurbished, or Club.
4027
/// </summary>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using Newtonsoft.Json;
2+
3+
namespace FikaAmazonAPI.NotificationMessages
4+
{
5+
public abstract class PriceBaseB2B : PriceBase
6+
{
7+
/// <summary>
8+
/// Required. Indicates whether the offer is a B2B offer or a B2C offer. When the offer type is B2C in a quantity discount, the seller is winning the Buy Box because others do not have inventory at that quantity, not because they have a quantity discount on the ASIN.
9+
/// </summary>
10+
[JsonProperty("OfferType")]
11+
public string OfferType { get; set; }
12+
13+
/// <summary>
14+
/// Required. The quantity tier for the offer.
15+
/// </summary>
16+
[JsonProperty("QuantityTier")]
17+
public int QuantityTier { get; set; }
18+
19+
/// <summary>
20+
/// Optional. Indicates whether the quantity tier is for Quantity Discount or Progressive Discount.
21+
/// </summary>
22+
[JsonProperty("DiscountType")]
23+
public string DiscountType { get; set; }
24+
25+
/// <summary>
26+
/// Optional. The seller identifier for the offer.
27+
/// </summary>
28+
[JsonProperty("SellerId")]
29+
public string SellerId { get; set; }
30+
}
31+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using Newtonsoft.Json;
2+
3+
namespace FikaAmazonAPI.NotificationMessages
4+
{
5+
6+
/// <summary>
7+
/// An explanation about the purpose of this instance.
8+
/// </summary>
9+
public abstract class PriceBaseB2C : PriceBase
10+
{
11+
/// <summary>
12+
/// Optional. The number of Amazon Points offered with the purchase of an item.
13+
/// </summary>
14+
/// <remarks>
15+
/// Note: The Points object is only returned in Japan (JP).
16+
/// </remarks>
17+
[JsonProperty("Points", NullValueHandling = NullValueHandling.Ignore)]
18+
public Points Points { get; set; }
19+
}
20+
}

Source/FikaAmazonAPI/NotificationMessages/SummaryB2B.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,24 @@ namespace FikaAmazonAPI.NotificationMessages
55
{
66
public class SummaryB2B : SummaryBase
77
{
8+
/// <summary>
9+
/// Required. A list that contains the lowest prices of the item for the given conditions, fulfillment channels, quantity tiers, and discount types.
10+
/// </summary>
11+
/// <remarks>
12+
/// The seven pre-defined quantity tiers for discount type “Quantity Discounts” are 2, 3, 5, 10, 20, 30 and 50.
13+
/// </remarks>
14+
[JsonProperty("LowestPrices")]
15+
public List<LowestPriceB2B> LowestPrices { get; set; }
16+
17+
/// <summary>
18+
/// Optional. A list that contains the Buy Box price of the item for the given conditions, quantity tiers, and discount types.
19+
/// </summary>
20+
/// <remarks>
21+
/// Up to the first 50 quantity tiers are shown.
22+
/// </remarks>
23+
[JsonProperty("BuyBoxPrices")]
24+
public List<BuyBoxPriceB2B> BuyBoxPrices { get; set; }
25+
826
/// <summary>
927
/// Required. A list that contains the total number of offers that are eligible for the Buy Box for the given conditions and fulfillment channels.
1028
/// </summary>

Source/FikaAmazonAPI/NotificationMessages/SummaryB2C.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ namespace FikaAmazonAPI.NotificationMessages
55
{
66
public class SummaryB2C : SummaryBase
77
{
8+
/// <summary>
9+
/// Required. A list that contains the lowest prices of the item for the given conditions and fulfillment channels.
10+
/// </summary>
11+
[JsonProperty("LowestPrices")]
12+
public List<LowestPriceB2C> LowestPrices { get; set; }
13+
14+
/// <summary>
15+
/// Optional. A list that contains the Buy Box price of the item for the given conditions.
16+
/// </summary>
17+
[JsonProperty("BuyBoxPrices")]
18+
public List<BuyBoxPriceB2C> BuyBoxPrices { get; set; }
19+
820
/// <summary>
921
/// Optional. The list price of the item as suggested by the manufacturer.
1022
/// </summary>

0 commit comments

Comments
 (0)