Skip to content

Commit

Permalink
CDMS-200 initial version of decision refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
craigedmunds committed Dec 23, 2024
1 parent ef57bf1 commit d2585a9
Show file tree
Hide file tree
Showing 24 changed files with 253 additions and 46 deletions.
4 changes: 2 additions & 2 deletions Btms.Analytics/MovementsAggregationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Btms.Common.Extensions;
using Btms.Model.Extensions;
using Btms.Model;
using Btms.Model.Alvs;
using Btms.Model.Cds;
using Btms.Model.Auditing;
using Btms.Model.Ipaffs;
using MongoDB.Bson;
Expand Down Expand Up @@ -344,7 +344,7 @@ public Task<SummarisedDataset<SingleSeriesDataset, StringBucketDimensionResult>>
.FirstOrDefault())
// Creates a default item & check so we don't lose
// it in the selectmany below
?? new AlvsClearanceRequest()
?? new CdsClearanceRequest()
{
Items = new []
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using TestDataGenerator;
using TestDataGenerator.Scenarios;
using Xunit;
using Check = Btms.Model.Alvs.Check;
using Check = Btms.Model.Cds.Check;
using Decision = Btms.Model.Ipaffs.Decision;

namespace Btms.Business.Tests.Services.Decisions;
Expand Down
8 changes: 4 additions & 4 deletions Btms.Business.Tests/Services/Linking/LinkingServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
using Btms.Backend.Data.InMemory;
using Btms.Business.Services.Linking;
using Btms.Metrics;
using Btms.Model.Alvs;
using Btms.Model.Cds;
using Btms.Model.ChangeLog;
using Btms.Model.Ipaffs;
using FluentAssertions;
using Microsoft.Extensions.Logging.Abstractions;
using Xunit;
using Document = Btms.Model.Alvs.Document;
using Items = Btms.Model.Alvs.Items;
using Document = Btms.Model.Cds.Document;
using Items = Btms.Model.Cds.Items;
using Movement = Btms.Model.Movement;

namespace Btms.Business.Tests.Services.Linking;
Expand Down Expand Up @@ -393,7 +393,7 @@ private ImportNotificationLinkContext CreateNotificationContext(int chedReferenc
EntryReference = entryRef,
ClearanceRequests =
[
new AlvsClearanceRequest
new CdsClearanceRequest
{
Header = new() { EntryReference = entryRef, EntryVersionNumber = 3, DeclarationType = "F" }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public async Task<PreProcessingResult<Movement>> Process(PreProcessingContext<Al

}

public static Movement BuildMovement(Model.Alvs.AlvsClearanceRequest request)
public static Movement BuildMovement(Model.Cds.CdsClearanceRequest request)
{
return new Movement
{
Expand Down
4 changes: 2 additions & 2 deletions Btms.Business/Services/Decisions/DecisionMessageBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private static IEnumerable<Items> BuildItems(Movement movement, IGrouping<string
}
}

private static IEnumerable<Check> BuildChecks(Model.Alvs.Items item, IGrouping<int, DocumentDecisionResult> itemsGroup)
private static IEnumerable<Check> BuildChecks(Model.Cds.Items item, IGrouping<int, DocumentDecisionResult> itemsGroup)
{
if (item.Checks != null)
{
Expand All @@ -81,7 +81,7 @@ private static IEnumerable<Check> BuildChecks(Model.Alvs.Items item, IGrouping<i
}
}

public static string[] BuildDecisionReasons(Model.Alvs.Items item, DecisionCode decisionCode)
public static string[] BuildDecisionReasons(Model.Cds.Items item, DecisionCode decisionCode)
{
switch (decisionCode)
{
Expand Down
2 changes: 1 addition & 1 deletion Btms.Business/Services/Matching/MatchingContext.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Diagnostics;
using Btms.Model;
using Btms.Model.Alvs;
using Btms.Model.Cds;
using Btms.Model.Ipaffs;

namespace Btms.Business.Services.Matching;
Expand Down
83 changes: 83 additions & 0 deletions Btms.Model/Cds/AlvsDecision.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated from a template.
//
// Manual changes to this file may cause unexpected behavior in your application.
// Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable

using JsonApiDotNetCore.Resources.Annotations;
using System.Text.Json.Serialization;
using System.Dynamic;


namespace Btms.Model.Cds;

/// <summary>
///
/// </summary>
public partial class AlvsDecisionItem
{
[Attr]
[System.ComponentModel.Description("")]
public int ItemNumber { get; set; }

[Attr]
[System.ComponentModel.Description("")]
public required string CheckCode { get; set; }

[Attr]
[System.ComponentModel.Description("")]
public required string AlvsDecisionCode { get; set; }

[Attr]
[System.ComponentModel.Description("")]
public string? BtmsDecisionCode { get; set; }
}

/// <summary>
///
/// </summary>
public partial class AlvsDecision //
{
[Attr]
[System.ComponentModel.Description("")]
public required CdsClearanceRequest Decision { get; set; }

[Attr]
[System.ComponentModel.Description("")]
public int AlvsDecisionNumber { get; set; } = default;

[Attr]
[System.ComponentModel.Description("")]
public int BtmsDecisionNumber { get; set; } = default;

[Attr]
[System.ComponentModel.Description("")]
public int EntryVersionNumber { get; set; } = default;

[Attr]
[System.ComponentModel.Description("")]
public bool Paired { get; set; } = default;

[Attr]
[System.ComponentModel.Description("")]
public string? PairStatus { get; set; }

[Attr]
[System.ComponentModel.Description("")]
public bool IsNoMatch { get; set; } = default;

[Attr]
[System.ComponentModel.Description("")]
public bool BtmsDecisionMatched { get; set; } = default;

[Attr]
[System.ComponentModel.Description("")]
public required List<AlvsDecisionItem> Checks { get; set; }

}


Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
using System.Dynamic;


namespace Btms.Model.Alvs;
namespace Btms.Model.Cds;

/// <summary>
///
/// </summary>
public partial class AlvsClearanceRequest //
public partial class CdsClearanceRequest //
{


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
using System.Dynamic;


namespace Btms.Model.Alvs;
namespace Btms.Model.Cds;

/// <summary>
/// Message sent to the server to send an ALVSClearanceRequest.
/// </summary>
public partial class AlvsClearanceRequestPost //
public partial class CdsClearanceRequestPost //
{


Expand Down Expand Up @@ -59,7 +59,7 @@ public partial class AlvsClearanceRequestPost //
/// </summary>
[Attr]
[System.ComponentModel.Description("")]
public AlvsClearanceRequest? AlvsClearanceRequest { get; set; }
public CdsClearanceRequest? AlvsClearanceRequest { get; set; }

}

Expand Down
2 changes: 1 addition & 1 deletion Btms.Model/Alvs/Check.g.cs → Btms.Model/Cds/Check.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
using System.Dynamic;


namespace Btms.Model.Alvs;
namespace Btms.Model.Cds;

/// <summary>
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
using System.Dynamic;


namespace Btms.Model.Alvs;
namespace Btms.Model.Cds;

/// <summary>
///
Expand Down
2 changes: 1 addition & 1 deletion Btms.Model/Alvs/Header.g.cs → Btms.Model/Cds/Header.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
using System.Dynamic;


namespace Btms.Model.Alvs;
namespace Btms.Model.Cds;

/// <summary>
///
Expand Down
2 changes: 1 addition & 1 deletion Btms.Model/Alvs/Items.cs → Btms.Model/Cds/Items.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#nullable enable


namespace Btms.Model.Alvs;
namespace Btms.Model.Cds;

/// <summary>
///
Expand Down
2 changes: 1 addition & 1 deletion Btms.Model/Alvs/Items.g.cs → Btms.Model/Cds/Items.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
using System.Dynamic;


namespace Btms.Model.Alvs;
namespace Btms.Model.Cds;

/// <summary>
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
using System.Dynamic;


namespace Btms.Model.Alvs;
namespace Btms.Model.Cds;

/// <summary>
///
Expand Down
Loading

0 comments on commit d2585a9

Please sign in to comment.