Skip to content

Commit

Permalink
CDMS-200 removes commented out lines
Browse files Browse the repository at this point in the history
  • Loading branch information
craigedmunds committed Dec 17, 2024
1 parent 49ffb59 commit 0c42872
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 30 deletions.
27 changes: 0 additions & 27 deletions Btms.Analytics/ImportNotificationsAggregationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ public Task<MultiSeriesDataset> ByCommodityCount(DateTime from, DateTime to)
.GroupBy(r => new { r.Key.ImportNotificationType, r.Key.Linked })
.ToList();

// var maxCommodities = result.Max(r => r.Max(i => i.Key.CommodityCount));

var maxCommodities = result.Count > 0 ?
result.Max(r => r.Any() ? r.Max(i => i.Key.CommodityCount) : 0) : 0;

Expand Down Expand Up @@ -107,32 +105,7 @@ public Task<MultiSeriesDataset> ByCommodityCount(DateTime from, DateTime to)
}).ToList()
})
.ToList()
// .AsOrderedArray(d => d.Name)

});

// return Task.FromResult(
// AnalyticsHelpers.GetImportNotificationSegments()
// .Select(title => new MultiSeriesDataset(title, "ItemCount")
// {
// // Results = asDictionary.AsResultList(title, maxCommodities)
// Series =
// [
// new Series()
// {
// Results = Enumerable.Range(0, maxCommodities)
// .Select(i => new ByNumericDimensionResult
// {
// Dimension = i,
// Value = asDictionary.GetValueOrDefault(new { Title=title, CommodityCount = i })
// }).ToList()
// }
// ]
//
// }
// )
// .AsOrderedArray(d => d.Name)
// );
}

private Task<MultiSeriesDatetimeDataset> Aggregate(DateTime[] dateRange, Func<BsonDocument, string> createDatasetName, Expression<Func<ImportNotification, bool>> filter, string dateField, AggregationPeriod aggregateBy)
Expand Down
3 changes: 0 additions & 3 deletions Btms.Backend/Config/AnalyticsDashboards.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,11 @@ public static async Task<IDictionary<string, IDataset>> GetCharts(
await Task.WhenAll(taskList.Select(r => r.Value));

var output = taskList
// .Select(t => t.Value.Result)
.ToDictionary(t => t.Key, t => t.Value.Result);

logger.LogInformation("Results found {0} Datasets, {1}", output.Count, output.Keys);

return output;

// return output.ToList();

}
}

0 comments on commit 0c42872

Please sign in to comment.