-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/cdms 200 decision analytics (#21)
* CDMS-200 refactoring to make decision analytics easier * CDMS-200 refactors analytics chart mechanism to run in parrallel and allow charts to be specified * CDMS-200 get history of movement from /analytics/history * CDMS-200 removes commented out lines * Fixes wait()
- Loading branch information
1 parent
6a55fc5
commit 53326d0
Showing
25 changed files
with
510 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using Btms.Common.Extensions; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
|
||
using Btms.Analytics.Tests.Fixtures; | ||
using Btms.Analytics.Tests.Helpers; | ||
using FluentAssertions; | ||
|
||
namespace Btms.Analytics.Tests; | ||
|
||
[Collection(nameof(MultiItemDataTestCollection))] | ||
public class MovementHistoryTests( | ||
MultiItemDataTestFixture multiItemDataTestFixture, | ||
ITestOutputHelper testOutputHelper) | ||
{ | ||
[Fact] | ||
public async Task WhenCalled_ReturnsHistory() | ||
{ | ||
testOutputHelper.WriteLine("Querying for history"); | ||
var result = await multiItemDataTestFixture.MovementsAggregationService | ||
.GetHistory("23GB9999001215000001"); | ||
|
||
testOutputHelper.WriteLine("{0} history items found", result.Items.Count()); | ||
|
||
result.Items.Should().HasValue(); | ||
result.Items.Select(a => a.AuditEntry.CreatedSource).Should().BeInAscendingOrder(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
using Btms.Model.Auditing; | ||
|
||
namespace Btms.Analytics; | ||
|
||
public interface IMovementsAggregationService | ||
{ | ||
public Task<MultiSeriesDatetimeDataset[]> ByCreated(DateTime from, DateTime to, AggregationPeriod aggregateBy = AggregationPeriod.Day); | ||
public Task<SingeSeriesDataset> ByStatus(DateTime from, DateTime to); | ||
public Task<MultiSeriesDataset[]> ByItemCount(DateTime from, DateTime to); | ||
public Task<MultiSeriesDataset[]> ByUniqueDocumentReferenceCount(DateTime from, DateTime to); | ||
public Task<SingeSeriesDataset> UniqueDocumentReferenceByMovementCount(DateTime from, DateTime to); | ||
public Task<MultiSeriesDatetimeDataset> ByCreated(DateTime from, DateTime to, AggregationPeriod aggregateBy = AggregationPeriod.Day); | ||
public Task<SingleSeriesDataset> ByStatus(DateTime from, DateTime to); | ||
public Task<MultiSeriesDataset> ByItemCount(DateTime from, DateTime to); | ||
public Task<MultiSeriesDataset> ByUniqueDocumentReferenceCount(DateTime from, DateTime to); | ||
public Task<SingleSeriesDataset> UniqueDocumentReferenceByMovementCount(DateTime from, DateTime to); | ||
public Task<MultiSeriesDataset> ByCheck(DateTime from, DateTime to); | ||
public Task<EntityDataset<AuditHistory>> GetHistory(string movementId); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.