|
| 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