Skip to content

Commit 3e7b510

Browse files
committed
Add support to GET_FBA_MYI_UNSUPPRESSED_INVENTORY_DATA inreport manager
1 parent 21a01e6 commit 3e7b510

File tree

4 files changed

+95
-5
lines changed

4 files changed

+95
-5
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ var returnFBAOrder = reportManager.GetReturnFBAOrder(90); //GET_FBA_FULFILLMENT_
270270
var reimbursementsOrder = reportManager.GetReimbursementsOrder(180); //GET_FBA_REIMBURSEMENTS_DATA
271271
var feedbacks = reportManager.GetFeedbackFromDays(180); //GET_SELLER_FEEDBACK_DATA
272272
var LedgerDetails = reportManager.GetLedgerDetailAsync(10); //GET_LEDGER_DETAIL_VIEW_DATA
273+
var UnsuppressedInventory = reportManager.GetUnsuppressedInventoryDataAsync().ConfigureAwait(false).GetAwaiter().GetResult(); //GET_FBA_MYI_UNSUPPRESSED_INVENTORY_DATA
273274
```
274275

275276

Source/FikaAmazonAPI.SampleCode/ReportManagerSample.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
using FikaAmazonAPI.ReportGeneration;
2-
using System;
3-
using System.Collections.Generic;
4-
using System.Linq;
5-
using System.Text;
6-
using System.Threading.Tasks;
72

83
namespace FikaAmazonAPI.SampleCode
94
{
@@ -28,6 +23,7 @@ public void CallReport()
2823
var returnFBAOrder = reportManager.GetReturnFBAOrder(90); //GET_FBA_FULFILLMENT_CUSTOMER_RETURNS_DATA
2924
var reimbursementsOrder = reportManager.GetReimbursementsOrder(180); //GET_FBA_REIMBURSEMENTS_DATA
3025
var feedbacks = reportManager.GetFeedbackFromDays(180); //GET_SELLER_FEEDBACK_DATA
26+
var UnsuppressedInventory = reportManager.GetUnsuppressedInventoryDataAsync().ConfigureAwait(false).GetAwaiter().GetResult(); //GET_FBA_MYI_UNSUPPRESSED_INVENTORY_DATA
3127
}
3228
}
3329
}

Source/FikaAmazonAPI/ReportGeneration/ReportManager.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,20 @@ private async Task<IList<string>> GetSettlementOrderAsync(AmazonConnection amazo
158158
}
159159
#endregion
160160

161+
162+
#region GetUnsuppressedInventoryData
163+
public async Task<List<UnsuppressedInventoryDataRow>> GetUnsuppressedInventoryDataAsync()
164+
{
165+
var path = await GetUnsuppressedInventoryDatayAsync(_amazonConnection);
166+
var report = new UnsuppressedInventoryDataReport(path, _amazonConnection.RefNumber);
167+
return report.Data;
168+
}
169+
private async Task<string> GetUnsuppressedInventoryDatayAsync(AmazonConnection amazonConnection)
170+
{
171+
return await amazonConnection.Reports.CreateReportAndDownloadFileAsync(ReportTypes.GET_FBA_MYI_UNSUPPRESSED_INVENTORY_DATA);
172+
}
173+
#endregion
174+
161175
#region GetInventoryQty
162176
public async Task<List<ProductAFNInventoryRow>> GetAFNInventoryQtyAsync()
163177
{
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
using FikaAmazonAPI.ReportGeneration.ReportDataTable;
2+
using System.Collections.Generic;
3+
4+
namespace FikaAmazonAPI.ReportGeneration
5+
{
6+
public class UnsuppressedInventoryDataReport
7+
{
8+
public List<UnsuppressedInventoryDataRow> Data { get; set; } = new List<UnsuppressedInventoryDataRow>();
9+
10+
public UnsuppressedInventoryDataReport(string path, string refNumber)
11+
{
12+
if (string.IsNullOrEmpty(path))
13+
return;
14+
15+
var table = Table.ConvertFromCSV(path);
16+
17+
List<UnsuppressedInventoryDataRow> values = new List<UnsuppressedInventoryDataRow>();
18+
foreach (var row in table.Rows)
19+
{
20+
values.Add(UnsuppressedInventoryDataRow.FromRow(row, refNumber));
21+
}
22+
Data = values;
23+
}
24+
}
25+
26+
public class UnsuppressedInventoryDataRow
27+
{
28+
public string SellerSku { get; set; }
29+
public string FNSKU { get; set; }
30+
public string ASIN { get; set; }
31+
public string ProductName { get; set; }
32+
public string Condition { get; set; }
33+
public decimal? YourPrice { get; set; }
34+
public string MfnListingExists { get; set; }
35+
public int? MfnFulfillableQuantity { get; set; }
36+
public string AfnListingExists { get; set; }
37+
public int? AfnWarehouseQuantity { get; set; }
38+
public int? AfnFulfillableQuantity { get; set; }
39+
public int? AfnUnsellableQuantity { get; set; }
40+
public int? AfnReservedQuantity { get; set; }
41+
public int? AfnTotalQuantity { get; set; }
42+
public decimal? PerUnitVolume { get; set; }
43+
public int? AfnInboundWorkingQuantity { get; set; }
44+
public int? AfnInboundShippedQuantity { get; set; }
45+
public int? AfnInboundReceivingQuantity { get; set; }
46+
public int? AfnResearchingQuantity { get; set; }
47+
public int? AfnReservedFutureSupply { get; set; }
48+
public int? AfnFutureSupplyBuyable { get; set; }
49+
public string refNumber { get; set; }
50+
public static UnsuppressedInventoryDataRow FromRow(TableRow rowData, string refNumber)
51+
{
52+
var row = new UnsuppressedInventoryDataRow();
53+
row.SellerSku = rowData.GetString("sku");
54+
row.FNSKU = rowData.GetString("fnsku");
55+
row.ASIN = rowData.GetString("asin");
56+
row.ProductName = rowData.GetString("product-name");
57+
row.Condition = rowData.GetString("condition");
58+
row.YourPrice = rowData.GetDecimal("your-price");
59+
row.MfnListingExists = rowData.GetString("mfn-listing-exists");
60+
row.MfnFulfillableQuantity = rowData.GetInt32("mfn-fulfillable-quantity");
61+
row.AfnListingExists = rowData.GetString("afn-listing-exists");
62+
row.AfnWarehouseQuantity = rowData.GetInt32("afn-warehouse-quantity");
63+
row.AfnFulfillableQuantity = rowData.GetInt32("afn-fulfillable-quantity");
64+
row.AfnUnsellableQuantity = rowData.GetInt32("afn-unsellable-quantity");
65+
row.AfnReservedQuantity = rowData.GetInt32("afn-reserved-quantity");
66+
row.AfnTotalQuantity = rowData.GetInt32("afn-total-quantity");
67+
row.PerUnitVolume = rowData.GetDecimal("per-unit-volume");
68+
row.AfnInboundWorkingQuantity = rowData.GetInt32("afn-inbound-working-quantity");
69+
row.AfnInboundShippedQuantity = rowData.GetInt32("afn-inbound-shipped-quantity");
70+
row.AfnInboundReceivingQuantity = rowData.GetInt32("afn-inbound-receiving-quantity");
71+
row.AfnResearchingQuantity = rowData.GetInt32("afn-researching-quantity");
72+
row.AfnReservedFutureSupply = rowData.GetInt32("afn-reserved-future-supply");
73+
row.AfnFutureSupplyBuyable = rowData.GetInt32("afn-future-supply-buyable");
74+
row.refNumber = refNumber;
75+
76+
return row;
77+
}
78+
}
79+
}

0 commit comments

Comments
 (0)