SP-API stock reconciliation

Amazon had depreciated a number of reports that were used for stock reconciliation. Application now uses the new fba ledger report to reconcile. It is currently untested, as this requires data from Amazon. Methods that require testing will return a 'NotImplementedException'.

Also, removed the depreciated ILMerge and replaced with ILRepack.

Plus much more tidying up, and improvements.
This commit is contained in:
Bobbie Hodgetts
2024-05-07 08:24:00 +01:00
committed by GitHub
parent 2f919d7b5a
commit 91ef9acc78
1272 changed files with 4944 additions and 2773311 deletions

View File

@@ -4,18 +4,19 @@ namespace bnhtrade.Core.Logic.Import
{
public class AmazonSettlement
{
Data.Amazon.Report.SettlementReport amazonReport;
private Data.Amazon.Report.SettlementReport amazonReport;
private Logic.Log.LogEvent log = new Log.LogEvent();
public AmazonSettlement(Model.Credentials.AmazonSPAPI spapiCredentials)
public AmazonSettlement()
{
amazonReport = new Data.Amazon.Report.SettlementReport();
}
public void SyncDatabase(string sqlConnectionString)
public void SyncDatabase()
{
string operation = "Import Amazon Settlement Reports";
new Logic.Log.LogEvent().EventLogInsert("Started '" + operation + "' operation.");
log.LogInformation("Started '" + operation + "' operation.");
// get avaiable reports from amazon api
var spapiReportIdList = amazonReport.ListAvaliableReports();
@@ -23,7 +24,7 @@ namespace bnhtrade.Core.Logic.Import
if (reportCount == 0)
{
new Logic.Log.LogEvent().EventLogInsert("Exiting '" + operation + "' operation. No settlement reports availble on Amazon SP-API.");
log.LogInformation("Exiting '" + operation + "' operation. No settlement reports availble on Amazon SP-API.");
return;
}
@@ -47,7 +48,7 @@ namespace bnhtrade.Core.Logic.Import
if (!spapiReportIdList.Any())
{
new Logic.Log.LogEvent().EventLogInsert("Exiting '" + operation + "' operation. No new reports to import (" + reportCount + " avaibale).");
log.LogInformation("Exiting '" + operation + "' operation. No new reports to import (" + reportCount + " avaibale).");
return;
}
@@ -58,7 +59,7 @@ namespace bnhtrade.Core.Logic.Import
UI.Console.WriteLine("Importing settlement report " + (i + 1) + " of " + spapiReportIdList.Count() + " (ReportID:" + spapiReportIdList[i] + ").");
var filePath = amazonReport.GetFile(spapiReportIdList[i]);
bool ack = dbImport.ByFlatFile(filePath, spapiReportIdList[i]);
new Logic.Log.LogEvent().EventLogInsert("Settlment Report imported (ReportID:" + spapiReportIdList[i] + ").");
log.LogInformation("Settlment Report imported (ReportID:" + spapiReportIdList[i] + ").");
}
return;