This repository was archived by the owner on Jul 28, 2025. It is now read-only.
generated from nhs-england-tools/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 1
feat: DTOSS-9179 - Transform function completion, and test/logging refactoring #23
Merged
Merged
Changes from 17 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
e0c1a0e
WIP
ianfnelson 551a364
WIP
ianfnelson c2cfceb
WIP
ianfnelson 5ce8b6d
test commit
ianfnelson e5a817b
commit test 2
ianfnelson 24b2ba5
foo who?
ianfnelson 67eaa69
DI wireup for NBSS appointment events, using Scrutor
ianfnelson b194995
WIP
ianfnelson d5b2bc6
WIP
ianfnelson 41fbb54
Merge branch 'main' into DTOSS-9179-transform-function-complete
ianfnelson 41acd1b
whitespace
ianfnelson 053f5e1
Finished?
ianfnelson e5d6b11
Whitespace
ianfnelson 717b95e
Whitespace
ianfnelson ea35f9d
Whitespace
ianfnelson 1e2391f
move class to file
ianfnelson 8cdc2d6
remove redundancy
ianfnelson 12920b5
Responding to review feedback
ianfnelson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
225 changes: 225 additions & 0 deletions
225
src/ServiceLayer.Common/Data/Migrations/20250527094020_ValidationErrors.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
src/ServiceLayer.Common/Data/Migrations/20250527094020_ValidationErrors.cs
This file contains hidden or 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 Microsoft.EntityFrameworkCore.Migrations; | ||
|
|
||
| #nullable disable | ||
|
|
||
| namespace ServiceLayer.Mesh.Migrations | ||
| { | ||
| /// <inheritdoc /> | ||
| public partial class ValidationErrors : Migration | ||
| { | ||
| /// <inheritdoc /> | ||
| protected override void Up(MigrationBuilder migrationBuilder) | ||
| { | ||
| migrationBuilder.AddColumn<string>( | ||
| name: "ValidationErrors", | ||
| table: "MeshFiles", | ||
| type: "nvarchar(max)", | ||
| nullable: true); | ||
| } | ||
|
|
||
| /// <inheritdoc /> | ||
| protected override void Down(MigrationBuilder migrationBuilder) | ||
| { | ||
| migrationBuilder.DropColumn( | ||
| name: "ValidationErrors", | ||
| table: "MeshFiles"); | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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
6 changes: 0 additions & 6 deletions
6
src/ServiceLayer.Mesh/Configuration/IFileExtractFunctionConfiguration.cs
This file was deleted.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
src/ServiceLayer.Mesh/Extensions/ApiErrorResponseExtensions.cs
This file contains hidden or 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,11 @@ | ||
| using NHS.MESH.Client.Models; | ||
|
|
||
| namespace ServiceLayer.Mesh.Extensions; | ||
|
|
||
| public static class ApiErrorResponseExtensions | ||
| { | ||
| public static string ToFormattedString(this APIErrorResponse? error) | ||
| { | ||
| return error == null ? "Unknown error" : $"ErrorEvent: {error.ErrorEvent ?? "N/A"}, ErrorCode: {error.ErrorCode ?? "N/A"}, ErrorDescription: {error.ErrorDescription}"; | ||
| } | ||
| } |
This file contains hidden or 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,10 @@ | ||
| using ServiceLayer.Data.Models; | ||
|
|
||
| namespace ServiceLayer.Mesh; | ||
|
|
||
| public abstract class FileTransformerBase : IFileTransformer | ||
| { | ||
| protected abstract MeshFileType HandlesFileType { get; } | ||
| public virtual bool CanHandle(MeshFileType fileType) => fileType == HandlesFileType; | ||
| public abstract Task<IList<ValidationError>> TransformFileAsync(Stream stream, MeshFile metaData); | ||
| } |
This file contains hidden or 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
35 changes: 35 additions & 0 deletions
35
src/ServiceLayer.Mesh/FileTypes/NbssAppointmentEvents/ServiceCollectionExtensions.cs
This file contains hidden or 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,35 @@ | ||
| using Microsoft.Extensions.DependencyInjection; | ||
| using ServiceLayer.Mesh.FileTypes.NbssAppointmentEvents.Validation; | ||
|
|
||
|
|
||
| namespace ServiceLayer.Mesh.FileTypes.NbssAppointmentEvents; | ||
|
|
||
| public static class ServiceCollectionExtensions | ||
| { | ||
| public static IServiceCollection ConfigureNbssAppointmentEvents(this IServiceCollection services) | ||
| { | ||
| services.AddTransient<IFileTransformer, FileTransformer>(); | ||
| services.AddTransient<IFileParser, FileParser>(); | ||
| services.AddTransient<IStagingPersister, StagingPersister>(); | ||
|
|
||
ianfnelson marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| services.AddSingleton<IValidationRunner, ValidationRunner>(); | ||
| services.RegisterValidators(); | ||
|
|
||
| return services; | ||
| } | ||
|
|
||
| private static IServiceCollection RegisterValidators(this IServiceCollection services) | ||
| { | ||
| foreach (var recordValidator in ValidatorRegistry.GetAllRecordValidators()) | ||
| { | ||
| services.AddSingleton<IRecordValidator>(_ => recordValidator); | ||
| } | ||
|
|
||
| foreach (var fileValidator in ValidatorRegistry.GetAllFileValidators()) | ||
| { | ||
| services.AddSingleton<IFileValidator>(_ => fileValidator); | ||
| } | ||
|
|
||
| return services; | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.