Skip to content

Commit

Permalink
Code tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
craigedmunds committed Jan 14, 2025
1 parent 2af751e commit ee26939
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 37 deletions.
9 changes: 0 additions & 9 deletions Btms.Analytics/Dataset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,9 @@ public override TType Read(
{
newOptions.Converters.Add(jsonConverter);
}
// newOptions.Converters.Append<IEnumerable<JsonConverter>>(converters);

TType result = JsonSerializer.Deserialize<TType>(ref reader, newOptions)!;

// TType result = JsonSerializer.Deserialize<TType>(ref reader, options)!;

// return new ByNumericDimensionResult() { Dimension = 1, Value = 1};
return result;
}

Expand All @@ -107,11 +103,6 @@ public override void Write(Utf8JsonWriter writer, TType value, JsonSerializerOpt
{
JsonSerializer.Serialize(writer, value as SummarisedDataset<SingleSeriesDataset, StringBucketDimensionResult>, options);
}
// else if (value is EntityDataset<(string scenario, string ched, string[] mrns)>)
// {
// JsonSerializer.Serialize(writer, value as EntityDataset<(string scenario, string ched, string[] mrns)>, options);
// }

else
{
throw new NotImplementedException();
Expand Down
5 changes: 2 additions & 3 deletions Btms.Analytics/DatasetDimensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,9 @@ public override TType Read(
{
PropertyNamingPolicy = options.PropertyNamingPolicy
};
// ByNumericDimensionResult byNumeric = JsonSerializer.Deserialize<ByNumericDimensionResult>(ref reader, newOptions)!;


TType result = JsonSerializer.Deserialize<TType>(ref reader, newOptions)!;
// return new ByNumericDimensionResult() { Dimension = 1, Value = 1};

return result;
}

Expand Down
2 changes: 0 additions & 2 deletions Btms.Analytics/Extensions/AnalyticsHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,5 @@ public static string[] GetImportNotificationSegments()
public static LinkStatusEnum[] GetMovementStatusSegments()
{
return Enum.GetValues<LinkStatusEnum>();
// .Select(e => e.AsString()).ToArray();
// return ["Linked", "Not Linked", "Investigate"];
}
}
3 changes: 0 additions & 3 deletions Btms.Analytics/Extensions/MovementExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ public static IQueryable<MovementWithLinkStatus> SelectLinkStatus(this IQueryabl
Movement = m,
CreatedSource = m.CreatedSource!.Value,
Status = m.BtmsStatus.LinkStatus
// m.Relationships.Notifications.Data.Count > 0 ? "Linked" :
// m.AlvsDecisionStatus!.Context!.AlvsCheckStatus!.AnyMatch ? "Investigate" :
// "Not Linked"
});

return m;
Expand Down
11 changes: 0 additions & 11 deletions Btms.Analytics/ImportNotificationsAggregationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,6 @@ public EntityDataset<ScenarioItem> Scenarios(DateTime? from = null, DateTime? to
.ToList();

return new EntityDataset<ScenarioItem>(data);

// new [] {
// new ScenarioItem() { Scenario = "Sweet Peppers", Keys = new[] { "Test" }}
// }));
// return Task.FromResult(new EntityDataset<(string scenario, string ched, string[] mrns)>(
// new (string scenario, string ched, string[] mrns)[]
// {
// ("Ched with sweet peppers commodity 07096010", "", [""])
// })
// );

}

public Task<MultiSeriesDataset<ByNumericDimensionResult>> ByCommodityCount(DateTime from, DateTime to)
Expand Down
4 changes: 0 additions & 4 deletions Btms.Business/Extensions/MovementExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ public static void AddLinkStatus(this Movement movement)
linkStatus = LinkStatusEnum.Linked;
linked = true;
}
// else if (movement.Relationships.Notifications.Data.Count == 0)
// {
// linkStatus = LinkStatusEnum.NotLinked;
// }

movement.BtmsStatus.LinkStatus = linkStatus;
movement.BtmsStatus.Linked = linked;
Expand Down
6 changes: 1 addition & 5 deletions Btms.Model/Cds/AlvsDecision.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,7 @@ public class StatusChecker
}

public class MovementStatus
{
// public const string NotLinkedStatus = "Not Linked";
// public const string LinkedStatus = "Linked";
// public const string InvestigateStatus = "Investigate";

{
public static MovementStatus Default()
{
return new MovementStatus()
Expand Down

0 comments on commit ee26939

Please sign in to comment.