Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial implementation of DatasetSpecificFilesScenarioGenerator #160

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using Btms.Types.Ipaffs;
using Microsoft.Extensions.Logging;
using TestDataGenerator.Helpers;

namespace TestDataGenerator.Scenarios.SpecificFiles;

public abstract class DatasetSpecificFilesScenarioGenerator(IServiceProvider sp, ILogger<DatasetSpecificFilesScenarioGenerator> logger, string? sampleFolder = null) : SpecificFilesScenarioGenerator(sp, logger, sampleFolder)
{
protected override List<(string filePath, IBaseBuilder builder)> ModifyBuilders(List<(string filePath, IBaseBuilder builder)> builders, int? scenario = null, int? item = null, DateTime? entryDate = null)
{
if (!scenario.HasValue || !item.HasValue || !entryDate.HasValue)
{
return builders;
}

// There may be multiple CHEDs and MRNs in the list of builders, we want to keep those that
// are the same, the same, but change them to something thats unique...
Dictionary<string, string> referenceMap = new Dictionary<string, string>();

builders.ForEach(b =>
{
switch (b.builder)
{
case ImportNotificationBuilder i:
//Todo, need ched type...
var chedReference = DataHelpers.GenerateReferenceNumber(ImportNotificationTypeEnum.Chedpp, scenario.Value, DateTime.Today, item.Value);

break;
case ClearanceRequestBuilder c:
break;
default:
break;
}
});


// .WithReferenceNumber(ImportNotificationTypeEnum.Cveda, scenario, entryDate, item)

return builders;
}
}