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

Fixed the downloading issues and updated the downloads to include fin… #42

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Btms.Backend/Endpoints/SyncEndpoints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ internal static async Task<IResult> InitialiseEnvironment(IHost app, SyncPeriod

private static IResult DownloadNotifications([FromServices] IWebHostEnvironment env, string id)
{
var stream = File.OpenRead($"{Path.Combine(env.ContentRootPath, id)}.zip");
var stream = File.OpenRead($"{env.ContentRootPath}/{id}.zip");
return Results.File(stream, "application/zip", $"{id}.zip", enableRangeProcessing: true);
}

Expand Down
6 changes: 4 additions & 2 deletions Btms.Business/Commands/DownloadNotificationsCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ public async Task Handle(DownloadCommand request, CancellationToken cancellation
await Download(request, rootFolder, "RAW/GVMSAPIRESPONSE", typeof(SearchGmrsForDeclarationIdsResponse), cancellationToken);

await Download(request, rootFolder, "RAW/DECISIONS", typeof(AlvsClearanceRequest), cancellationToken);

ZipFile.CreateFromDirectory(rootFolder, $"{env.ContentRootPath}\\{request.JobId}.zip");

await Download(request, rootFolder, "RAW/FINALISATION", typeof(AlvsClearanceRequest), cancellationToken);

ZipFile.CreateFromDirectory(rootFolder, $"{env.ContentRootPath}/{request.JobId}.zip");

Directory.Delete(rootFolder, true);
}
Expand Down
5 changes: 5 additions & 0 deletions Btms.SensitiveData/SensitiveDataSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ public string RedactRawJson(string json, Type type)
}
var sensitiveFields = SensitiveFieldsProvider.Get(type);

if (!sensitiveFields.Any())
{
return json;
}

var rootNode = JsonNode.Parse(json);

foreach (var sensitiveField in sensitiveFields)
Expand Down
Loading