The notification service has a method that accepts a batch of recipient codes and returns a short processing summary. Contract:
BuildAsync(IEnumerable<string?> recipientCodes, CancellationToken cancellationToken = default) returns RecipientBatchSummary.Accepted is the number of unique normalized codes actually added to the local registry during this call.Skipped is the number of input batch elements that were not added during this call: empty/whitespace values and duplicates within the same call.Trim() and conversion to uppercase via ToUpperInvariant().Accepted, but they are also not counted in Skipped for the current batch.A review is needed for the PR change and the defects in the after version must be found.
Environment and run:
RecipientBatchPlanner.BuildAsync(...) from a test or Program.csReproduction steps:
var source = new List<string?> { " a1 ", "", "b2" };var task = planner.BuildAsync(source);task completes, execute source.Add("c3");new[] { " a1 ", "A1", "b2" } on a new planner instance.new[] { "a1" }, then new[] { "A1", "b2" }.Assumptions:
List<string?>.Skipped considers only problems within the current input batch, not records already present in the registry from previous calls.C# 12, .NET 8.0.x, dotnet build / dotnet test or running in a console application. No additional dependencies.
Use line comments to explain the problem, its impact, the fix and how to test it.