Preparing for the History query

This commit is contained in:
Mikhail Shabanov committed 2020-11-17 11:01:35 +01:00
1 parent ddbf42e7bb
commit ed52a65788
14 files changed
+334 -6

No files matched your search

@@ -1,4 +1,5 @@
using System.Threading.Tasks;
using System;
using System.Threading.Tasks;
using WotBlitzStatisticsPro.Common.Model;
using WotBlitzStatisticsPro.Logic.AccountInformationPipeline;
using WotBlitzStatisticsPro.Logic.AccountInformationPipeline.Operations;
@@ -53,5 +54,27 @@ namespace WotBlitzStatisticsPro.Logic
return context.Response;
}
public async Task<AccountInfoHistoryResponse> GetAccountInfoHistory(RealmType realm, long accountId, DateTime startDate, RequestLanguage requestLanguage)
{
var context = new HistoryInformationPipelineContext(accountId, realm, requestLanguage);
var pipeline = new Pipeline<HistoryInformationPipelineContext>(_operationFactory);
//pipeline.AddOperation<ReadAccountInfoFromDbOperation>()
// ToDo:
// 1. First read account info from DB operation
// 2. Read account history from DB at the startDate !Array SortedByDate! operation
// 3. Fill the OverallAccountStatistics
// PeriodAccountStatistics
// PeriodDifference
// StatisticsHistory
await pipeline.Build()
.Invoke(context, null)
.ConfigureAwait(false);
return context.Response;
}
}
}