Skip to content

Commit

Permalink
Fixed the downloading issues and updated the downloads to include fin…
Browse files Browse the repository at this point in the history
…alisations (#42)

Co-authored-by: Thomas Anderson <[email protected]>
  • Loading branch information
2 people authored and Lim Sim committed Jan 8, 2025
1 parent 438d3b2 commit de1fc27
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
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

0 comments on commit de1fc27

Please sign in to comment.