From 1c219687736dce217722387af5f44632f3ec62b1 Mon Sep 17 00:00:00 2001 From: Joseph2910 <184524642+Joseph2910@users.noreply.github.com> Date: Thu, 18 Sep 2025 17:23:39 +0100 Subject: [PATCH 1/6] chore: some fixes --- .../CohortManager/Set-up/azurite/Dockerfile | 2 +- .../RetrieveMeshFile/RetrieveMeshFile.cs | 6 +++--- .../CallDurableDemographicFunc.cs | 4 +--- .../receiveCaasFile/receiveCaasFile.cs | 3 +-- .../DurableDemographicFunction.cs | 2 +- .../ManageCaasSubscription.cs | 15 ++++++--------- .../NemsMeshRetrieval/NemsMeshRetrieval.cs | 8 +++----- .../src/Functions/Shared/Model/PdsDemographic.cs | 12 ++++++------ scripts/backups/db-backup-container/Dockerfile | 14 +++++++------- scripts/backups/db-restore-container/Dockerfile | 8 ++++---- 10 files changed, 33 insertions(+), 41 deletions(-) diff --git a/application/CohortManager/Set-up/azurite/Dockerfile b/application/CohortManager/Set-up/azurite/Dockerfile index 324eab1f5f..f2a05fe1fa 100644 --- a/application/CohortManager/Set-up/azurite/Dockerfile +++ b/application/CohortManager/Set-up/azurite/Dockerfile @@ -2,7 +2,7 @@ FROM python:3.12 COPY ./Set-up/azurite . -RUN pip install azure-storage-blob==12.22.0 +RUN pip install azure-storage-blob==12.22.0 \ && pip install azure-storage-queue CMD ["python3", "-u", "./azurite-setup.py"] diff --git a/application/CohortManager/src/Functions/CaasIntegration/RetrieveMeshFile/RetrieveMeshFile.cs b/application/CohortManager/src/Functions/CaasIntegration/RetrieveMeshFile/RetrieveMeshFile.cs index abe788c83d..3307c94078 100644 --- a/application/CohortManager/src/Functions/CaasIntegration/RetrieveMeshFile/RetrieveMeshFile.cs +++ b/application/CohortManager/src/Functions/CaasIntegration/RetrieveMeshFile/RetrieveMeshFile.cs @@ -42,7 +42,7 @@ public RetrieveMeshFile(ILogger logger, IMeshToBlobTransferHan [Function("RetrieveMeshFile")] public async Task RunAsync([TimerTrigger("0 */5 * * * *")] TimerInfo myTimer) { - _logger.LogInformation("C# Timer trigger function executed at: ,{datetime}", DateTime.UtcNow); + _logger.LogInformation("C# Timer trigger function executed at: ,{DateTime}", DateTime.UtcNow); static bool messageFilter(MessageMetaData i) => true; // No current filter defined there might be business rules here @@ -65,7 +65,7 @@ public async Task RunAsync([TimerTrigger("0 */5 * * * *")] TimerInfo myTimer) if (myTimer.ScheduleStatus is not null) { - _logger.LogInformation("Next timer schedule at: {scheduleStatus}", myTimer.ScheduleStatus.Next); + _logger.LogInformation("Next timer schedule at: {ScheduleStatus}", myTimer.ScheduleStatus.Next); } } @@ -127,7 +127,7 @@ private async Task ShouldExecuteHandShake() return true; } - _logger.LogInformation("Next handshake scheduled for {nextHandShakeDateTime}", nextHandShakeDateTime); + _logger.LogInformation("Next handshake scheduled for {NextHandShakeDateTime}", nextHandShakeDateTime); return false; } diff --git a/application/CohortManager/src/Functions/CaasIntegration/receiveCaasFile/ProcessFileClasses/CallDurableDemographicFunc.cs b/application/CohortManager/src/Functions/CaasIntegration/receiveCaasFile/ProcessFileClasses/CallDurableDemographicFunc.cs index cad696d519..c985bc3f50 100644 --- a/application/CohortManager/src/Functions/CaasIntegration/receiveCaasFile/ProcessFileClasses/CallDurableDemographicFunc.cs +++ b/application/CohortManager/src/Functions/CaasIntegration/receiveCaasFile/ProcessFileClasses/CallDurableDemographicFunc.cs @@ -1,10 +1,8 @@ namespace NHS.Screening.ReceiveCaasFile; -using System.Net.Http.Headers; using System.Text.Json; using Common; -using Microsoft.Azure.Functions.Worker.Extensions.Abstractions; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Model; @@ -84,7 +82,7 @@ public async Task PostDemographicDataAsync(List pa if (finalStatus == WorkFlowStatus.Completed) { - _logger.LogWarning("Durable function completed {finalStatus}", finalStatus); + _logger.LogWarning("Durable function completed {FinalStatus}", finalStatus); return true; } else diff --git a/application/CohortManager/src/Functions/CaasIntegration/receiveCaasFile/receiveCaasFile.cs b/application/CohortManager/src/Functions/CaasIntegration/receiveCaasFile/receiveCaasFile.cs index fe8c3469ff..927b5d5a04 100644 --- a/application/CohortManager/src/Functions/CaasIntegration/receiveCaasFile/receiveCaasFile.cs +++ b/application/CohortManager/src/Functions/CaasIntegration/receiveCaasFile/receiveCaasFile.cs @@ -10,7 +10,6 @@ namespace NHS.Screening.ReceiveCaasFile; using Common; using DataServices.Client; using Microsoft.Extensions.Options; -using Azure.Messaging.ServiceBus; public class ReceiveCaasFile { @@ -117,7 +116,7 @@ public async Task Run([BlobTrigger("inbound/{name}", Connection = "caasfolder_ST public async Task GetScreeningService(FileNameParser fileNameParser) { var screeningWorkflowId = fileNameParser.GetScreeningService(); - _logger.LogInformation("Screening Acronym {screeningWorkflowId}", screeningWorkflowId); + _logger.LogInformation("Screening Acronym {ScreeningWorkflowId}", screeningWorkflowId); ScreeningLkp screeningService = await _screeningLkpClient.GetSingleByFilter(x => x.ScreeningWorkflowId == screeningWorkflowId) ?? throw new ArgumentException("Could not get screening service data for screening id: " + screeningWorkflowId); diff --git a/application/CohortManager/src/Functions/DemographicServices/DemographicDurableFunction/DurableDemographicFunction.cs b/application/CohortManager/src/Functions/DemographicServices/DemographicDurableFunction/DurableDemographicFunction.cs index 1f014cd20e..6f933449eb 100644 --- a/application/CohortManager/src/Functions/DemographicServices/DemographicDurableFunction/DurableDemographicFunction.cs +++ b/application/CohortManager/src/Functions/DemographicServices/DemographicDurableFunction/DurableDemographicFunction.cs @@ -85,7 +85,7 @@ public async Task RunOrchestrator( } catch (Exception ex) { - _logger.LogError(ex, "Orchestration failed with exception. {exception}", ex.Message); + _logger.LogError(ex, "Orchestration failed with exception. {Exception}", ex.Message); throw; } } diff --git a/application/CohortManager/src/Functions/DemographicServices/ManageCaasSubscription/ManageCaasSubscription.cs b/application/CohortManager/src/Functions/DemographicServices/ManageCaasSubscription/ManageCaasSubscription.cs index 314b143d0d..135048d8f7 100644 --- a/application/CohortManager/src/Functions/DemographicServices/ManageCaasSubscription/ManageCaasSubscription.cs +++ b/application/CohortManager/src/Functions/DemographicServices/ManageCaasSubscription/ManageCaasSubscription.cs @@ -7,12 +7,8 @@ namespace NHS.CohortManager.DemographicServices; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Common; -using System.Collections.Specialized; -using System.Text; using DataServices.Core; using Model; -using NHS.CohortManager.DemographicServices; -using Common.Interfaces; /// /// Azure Functions endpoints for managing CaaS subscriptions via MESH and data services. @@ -27,6 +23,7 @@ public class ManageCaasSubscription private readonly IDataServiceAccessor _nemsSubscriptionAccessor; private readonly IMeshPoller _meshPoller; private readonly IExceptionHandler _exceptionHandler; + private const string? nhsNum = "nhsNumber"; public ManageCaasSubscription( ILogger logger, @@ -57,9 +54,9 @@ public ManageCaasSubscription( [Function("Subscribe")] public async Task Subscribe([HttpTrigger(AuthorizationLevel.Anonymous, "post")] HttpRequestData req) { + string? nhsNumber = req.Query[nhsNum]; try { - var nhsNumber = req.Query["nhsNumber"]; if (!ValidationHelper.ValidateNHSNumber(nhsNumber!)) { return await _createResponse.CreateHttpResponseWithBodyAsync(HttpStatusCode.BadRequest, req, "NHS number is required and must be valid format."); @@ -114,7 +111,7 @@ public async Task Subscribe([HttpTrigger(AuthorizationLevel.An _logger.LogError(ex, "Error sending CAAS subscribe request"); try { - string? rawNhs = req.Query["nhsNumber"]; + string? rawNhs = req.Query[nhsNum]; var nhsForLog = ValidationHelper.ValidateNHSNumber(rawNhs!) ? rawNhs! : string.Empty; await _exceptionHandler.CreateSystemExceptionLogFromNhsNumber(ex, nhsForLog, nameof(ManageCaasSubscription), "", string.Empty); } @@ -134,7 +131,7 @@ public async Task Subscribe([HttpTrigger(AuthorizationLevel.An [Function("Unsubscribe")] public async Task Unsubscribe([HttpTrigger(AuthorizationLevel.Anonymous, "post")] HttpRequestData req) { - var nhsNumber = req.Query["nhsNumber"]; + var nhsNumber = req.Query[nhsNum]; if (!ValidationHelper.ValidateNHSNumber(nhsNumber!)) { return await _createResponse.CreateHttpResponseWithBodyAsync(HttpStatusCode.BadRequest, req, "NHS number is required and must be valid format."); @@ -156,7 +153,7 @@ public async Task CheckSubscriptionStatus([HttpTrigger(Authori { _logger.LogInformation("Received check subscription request"); - string? nhsNumber = req.Query["nhsNumber"]; + string? nhsNumber = req.Query[nhsNum]; if (!ValidationHelper.ValidateNHSNumber(nhsNumber!)) { @@ -179,7 +176,7 @@ public async Task CheckSubscriptionStatus([HttpTrigger(Authori _logger.LogError(ex, "Error checking subscription status"); try { - string? rawNhs = req.Query["nhsNumber"]; + string? rawNhs = req.Query[nhsNum]; var nhsForLog = ValidationHelper.ValidateNHSNumber(rawNhs!) ? rawNhs! : string.Empty; await _exceptionHandler.CreateSystemExceptionLogFromNhsNumber(ex, nhsForLog, nameof(ManageCaasSubscription), "", string.Empty); } diff --git a/application/CohortManager/src/Functions/NemsSubscriptionService/NemsMeshRetrieval/NemsMeshRetrieval.cs b/application/CohortManager/src/Functions/NemsSubscriptionService/NemsMeshRetrieval/NemsMeshRetrieval.cs index 56ff0fff9f..93916a624a 100644 --- a/application/CohortManager/src/Functions/NemsSubscriptionService/NemsMeshRetrieval/NemsMeshRetrieval.cs +++ b/application/CohortManager/src/Functions/NemsSubscriptionService/NemsMeshRetrieval/NemsMeshRetrieval.cs @@ -1,9 +1,7 @@ namespace NHS.Screening.NemsMeshRetrieval; using System; -using System.Diagnostics.CodeAnalysis; using System.Globalization; -using System.Text; using System.Text.Json; using System.Threading.Tasks; using Common; @@ -42,7 +40,7 @@ public NemsMeshRetrieval(ILogger logger, IMeshToBlobTransferH [Function("RetrieveNemsMeshFile")] public async Task RunAsync([TimerTrigger("0 */5 * * * *")] TimerInfo myTimer) { - _logger.LogInformation("C# Timer trigger function executed at: ,{datetime}", DateTime.UtcNow); + _logger.LogInformation("C# Timer trigger function executed at: ,{Datetime}", DateTime.UtcNow); static bool messageFilter(MessageMetaData i) => true; // No current filter defined there might be business rules here @@ -65,7 +63,7 @@ public async Task RunAsync([TimerTrigger("0 */5 * * * *")] TimerInfo myTimer) if (myTimer.ScheduleStatus is not null) { - _logger.LogInformation("Next timer schedule at: {scheduleStatus}", myTimer.ScheduleStatus.Next); + _logger.LogInformation("Next timer schedule at: {ScheduleStatus}", myTimer.ScheduleStatus.Next); } } @@ -127,7 +125,7 @@ private async Task ShouldExecuteHandShake() return true; } - _logger.LogInformation("Next handshake scheduled for {nextHandShakeDateTime}", nextHandShakeDateTime); + _logger.LogInformation("Next handshake scheduled for {NextHandShakeDateTime}", nextHandShakeDateTime); return false; } diff --git a/application/CohortManager/src/Functions/Shared/Model/PdsDemographic.cs b/application/CohortManager/src/Functions/Shared/Model/PdsDemographic.cs index 903e519de8..332ddfcc99 100644 --- a/application/CohortManager/src/Functions/Shared/Model/PdsDemographic.cs +++ b/application/CohortManager/src/Functions/Shared/Model/PdsDemographic.cs @@ -1,6 +1,5 @@ namespace Model; -using System.Data; using System.Text.Json.Serialization; using Model.Enums; using NHS.CohortManager.Shared.Utilities; @@ -15,6 +14,7 @@ public class PdsDemographic : Demographic public string? RemovalEffectiveToDate { get; set; } [JsonPropertyOrder(903)] public string? ConfidentialityCode { get; set; } = ""; + private const string DateFormat = "yyyyMMdd"; public PdsDemographic() { } public ParticipantDemographic ToParticipantDemographic() @@ -29,7 +29,7 @@ public ParticipantDemographic ToParticipantDemographic() OtherGivenName = OtherGivenNames, FamilyName = FamilyName, PreviousFamilyName = PreviousFamilyName, - DateOfBirth = MappingUtilities.ParseDates(DateOfBirth!)?.ToString("yyyyMMdd"), + DateOfBirth = MappingUtilities.ParseDates(DateOfBirth!)?.ToString(DateFormat), Gender = (short?)(Gender.HasValue ? (Gender?)Gender.Value : null), AddressLine1 = AddressLine1, AddressLine2 = AddressLine2, @@ -38,15 +38,15 @@ public ParticipantDemographic ToParticipantDemographic() AddressLine5 = AddressLine5, PostCode = Postcode, PafKey = PafKey, - UsualAddressFromDate = MappingUtilities.ParseDates(UsualAddressEffectiveFromDate!)?.ToString("yyyyMMdd"), + UsualAddressFromDate = MappingUtilities.ParseDates(UsualAddressEffectiveFromDate!)?.ToString(DateFormat), DateOfDeath = DateOfDeath, DeathStatus = (short?)(DeathStatus.HasValue ? (Status?)DeathStatus.Value : null), TelephoneNumberHome = TelephoneNumber, - TelephoneNumberHomeFromDate = MappingUtilities.ParseDates(TelephoneNumberEffectiveFromDate!)?.ToString("yyyy-MM-dd"), + TelephoneNumberHomeFromDate = MappingUtilities.ParseDates(TelephoneNumberEffectiveFromDate!)?.ToString(DateFormat), TelephoneNumberMob = MobileNumber, - TelephoneNumberMobFromDate = MappingUtilities.ParseDates(MobileNumberEffectiveFromDate!)?.ToString("yyyyMMdd"), + TelephoneNumberMobFromDate = MappingUtilities.ParseDates(MobileNumberEffectiveFromDate!)?.ToString(DateFormat), EmailAddressHome = EmailAddress, - EmailAddressHomeFromDate = MappingUtilities.ParseDates(EmailAddressEffectiveFromDate!)?.ToString("yyyyMMdd"), + EmailAddressHomeFromDate = MappingUtilities.ParseDates(EmailAddressEffectiveFromDate!)?.ToString(DateFormat), PreferredLanguage = PreferredLanguage, InterpreterRequired = IsInterpreterRequired?.ToLower() switch { diff --git a/scripts/backups/db-backup-container/Dockerfile b/scripts/backups/db-backup-container/Dockerfile index 7930cea698..f6799ff53a 100644 --- a/scripts/backups/db-backup-container/Dockerfile +++ b/scripts/backups/db-backup-container/Dockerfile @@ -2,22 +2,22 @@ FROM mcr.microsoft.com/powershell:latest # Create a non-root user and group -RUN groupadd -r appgroup && useradd -r -g appgroup appuser +RUN groupadd -r appgroup && useradd -r -g appgroup appuser \ # Update package lists and install required tools. # 'lsb-release' is added to fix the 'lsb_release: not found' error. -RUN apt-get update && apt-get install -y --no-install-recommends \ - wget \ - unzip \ +&& apt-get update && apt-get install -y --no-install-recommends \ gnupg \ lsb-release \ - && rm -rf /var/lib/apt/lists/* + unzip \ + wget \ + && rm -rf /var/lib/apt/lists/* \ # Install the Az PowerShell module for Azure authentication. -RUN pwsh -Command "Install-Module -Name Az.Accounts -RequiredVersion 2.12.0 -Force -Scope AllUsers" +&& pwsh -Command "Install-Module -Name Az.Accounts -RequiredVersion 2.12.0 -Force -Scope AllUsers" # Install SqlPackage by downloading the binary. -RUN wget -O sqlpackage.zip https://aka.ms/sqlpackage-linux \ +ADD -O sqlpackage.zip https://aka.ms/sqlpackage-linux \ && mkdir /opt/sqlpackage \ && unzip sqlpackage.zip -d /opt/sqlpackage \ && rm sqlpackage.zip \ diff --git a/scripts/backups/db-restore-container/Dockerfile b/scripts/backups/db-restore-container/Dockerfile index 9402826bff..e281dc9089 100644 --- a/scripts/backups/db-restore-container/Dockerfile +++ b/scripts/backups/db-restore-container/Dockerfile @@ -2,16 +2,16 @@ FROM mcr.microsoft.com/powershell:latest # Create a non-root user and group -RUN groupadd -r appgroup && useradd -r -g appgroup appuser +RUN groupadd -r appgroup && useradd -r -g appgroup appuser \ # Update package lists and install wget and unzip. -RUN apt-get update && apt-get --no-install-recommends install -y wget unzip +&& apt-get update && apt-get --no-install-recommends install -y wget unzip \ # Install the Az PowerShell module for Azure authentication -RUN pwsh -Command "Install-Module -Name Az.Accounts -RequiredVersion 2.12.0 -Force -Scope AllUsers" +&& pwsh -Command "Install-Module -Name Az.Accounts -RequiredVersion 2.12.0 -Force -Scope AllUsers" \ # Install SqlPackage. -RUN wget -O sqlpackage.zip https://aka.ms/sqlpackage-linux \ +ADD -O sqlpackage.zip https://aka.ms/sqlpackage-linux \ && mkdir /opt/sqlpackage \ && unzip sqlpackage.zip -d /opt/sqlpackage \ && rm sqlpackage.zip \ From a2c1241a93bb5f59bb2408686a4aa2a1129f4a34 Mon Sep 17 00:00:00 2001 From: Joseph2910 <184524642+Joseph2910@users.noreply.github.com> Date: Tue, 23 Sep 2025 15:56:06 +0100 Subject: [PATCH 2/6] chore: More sonarqube fixes --- .../DurableDemographicFunction.cs | 1 - .../BlockParticipantHandler.cs | 9 ++++---- .../ReceiveServiceNowMessageFunction.cs | 2 +- .../ServiceNowClient.cs | 2 +- .../Common/AuthorizationClientCredentials.cs | 2 +- .../Shared/Common/AzureQueueStorageHelper.cs | 2 +- .../Shared/Common/AzureServiceBusClient.cs | 2 +- .../Shared/Common/ExceptionHandler.cs | 2 +- .../Common/MeshToBlobTransferHandler.cs | 8 +++---- .../src/Functions/Shared/Common/ReadRules.cs | 6 ++--- .../Database/CreateCohortDistributionData.cs | 1 - .../DataServiceCacheClient.cs | 4 ++-- .../app/api/GetValidationExceptions/route.ts | 4 ++-- .../src/Web/app/api/UpdateException/route.ts | 4 ++-- .../api/UpdateExceptionServiceNowId/route.ts | 2 +- .../src/Web/app/data/mockDataStore.ts | 9 ++++++-- .../src/Web/app/exceptions/[filter]/page.tsx | 2 +- .../src/Web/app/exceptions/page.tsx | 2 +- .../src/Web/app/lib/pagination.ts | 4 ++-- .../CohortManager/src/Web/app/lib/utils.ts | 4 ++-- .../src/Web/app/reports/page.tsx | 23 ++++++++++--------- .../CohortManager/src/Web/jest.config.ts | 2 +- .../playwright-tests/scripts/health-check.js | 8 +++---- 23 files changed, 55 insertions(+), 50 deletions(-) diff --git a/application/CohortManager/src/Functions/DemographicServices/DemographicDurableFunction/DurableDemographicFunction.cs b/application/CohortManager/src/Functions/DemographicServices/DemographicDurableFunction/DurableDemographicFunction.cs index 6f933449eb..cb0d71d3c4 100644 --- a/application/CohortManager/src/Functions/DemographicServices/DemographicDurableFunction/DurableDemographicFunction.cs +++ b/application/CohortManager/src/Functions/DemographicServices/DemographicDurableFunction/DurableDemographicFunction.cs @@ -5,7 +5,6 @@ namespace NHS.CohortManager.DemographicServices; using System.Text.Json; using Common; using DataServices.Client; -using Microsoft.AspNetCore.Components; using Microsoft.Azure.Functions.Worker; using Microsoft.Azure.Functions.Worker.Http; using Microsoft.DurableTask; diff --git a/application/CohortManager/src/Functions/ParticipantManagementServices/UpdateBlockedFlag/BlockParticipantHandler.cs b/application/CohortManager/src/Functions/ParticipantManagementServices/UpdateBlockedFlag/BlockParticipantHandler.cs index 0c7646d8eb..f5a9ab1c2a 100644 --- a/application/CohortManager/src/Functions/ParticipantManagementServices/UpdateBlockedFlag/BlockParticipantHandler.cs +++ b/application/CohortManager/src/Functions/ParticipantManagementServices/UpdateBlockedFlag/BlockParticipantHandler.cs @@ -16,6 +16,7 @@ public class BlockParticipantHandler : IBlockParticipantHandler private readonly IDataServiceClient _participantDemographicDataService; private readonly IHttpClientFunction _httpClient; private readonly UpdateBlockedFlagConfig _config; + private static string CultureInfo = "en-GB"; public BlockParticipantHandler(ILogger logger, IDataServiceClient participantManagementDataService, IDataServiceClient participantDemographicDataService, @@ -241,12 +242,12 @@ private async Task GetPDSParticipant(long nhsNumber) private static bool ValidateRecordsMatch(ParticipantDemographic participant, BlockParticipantDto dto) { - if (!DateOnly.TryParseExact(dto.DateOfBirth, "yyyy-MM-dd", new CultureInfo("en-GB"), DateTimeStyles.None, out var dtoDateOfBirth)) + if (!DateOnly.TryParseExact(dto.DateOfBirth, "yyyy-MM-dd", new CultureInfo(CultureInfo), DateTimeStyles.None, out var dtoDateOfBirth)) { throw new FormatException("Date of Birth not in the correct format"); } - if (!DateOnly.TryParseExact(participant.DateOfBirth, "yyyyMMdd", new CultureInfo("en-GB"), DateTimeStyles.None, out var parsedDob)) + if (!DateOnly.TryParseExact(participant.DateOfBirth, "yyyyMMdd", new CultureInfo(CultureInfo), DateTimeStyles.None, out var parsedDob)) { return false; } @@ -259,12 +260,12 @@ private static bool ValidateRecordsMatch(ParticipantDemographic participant, Blo private static bool ValidateRecordsMatch(PdsDemographic participant, BlockParticipantDto dto) { - if (!DateOnly.TryParseExact(dto.DateOfBirth, "yyyy-MM-dd", new CultureInfo("en-GB"), DateTimeStyles.None, out var dtoDateOfBirth)) + if (!DateOnly.TryParseExact(dto.DateOfBirth, "yyyy-MM-dd", new CultureInfo(CultureInfo), DateTimeStyles.None, out var dtoDateOfBirth)) { throw new FormatException("Date of Birth not in the correct format"); } - if (!DateOnly.TryParseExact(participant.DateOfBirth, "yyyy-MM-dd", new CultureInfo("en-GB"), DateTimeStyles.None, out var parsedDob)) + if (!DateOnly.TryParseExact(participant.DateOfBirth, "yyyy-MM-dd", new CultureInfo(CultureInfo), DateTimeStyles.None, out var parsedDob)) { return false; } diff --git a/application/CohortManager/src/Functions/ServiceNowIntegration/ServiceNowMessageHandler/ReceiveServiceNowMessageFunction.cs b/application/CohortManager/src/Functions/ServiceNowIntegration/ServiceNowMessageHandler/ReceiveServiceNowMessageFunction.cs index 6a63c72d4c..25cb220725 100644 --- a/application/CohortManager/src/Functions/ServiceNowIntegration/ServiceNowMessageHandler/ReceiveServiceNowMessageFunction.cs +++ b/application/CohortManager/src/Functions/ServiceNowIntegration/ServiceNowMessageHandler/ReceiveServiceNowMessageFunction.cs @@ -107,7 +107,7 @@ public async Task Run( } catch (JsonException ex) { - _logger.LogError(ex, "Failed to deserialize json request body to type {type}", nameof(ReceiveServiceNowMessageRequestBody)); + _logger.LogError(ex, "Failed to deserialize json request body to type {Type}", nameof(ReceiveServiceNowMessageRequestBody)); return _createResponse.CreateHttpResponse(HttpStatusCode.BadRequest, req); } catch (Exception ex) diff --git a/application/CohortManager/src/Functions/ServiceNowIntegration/ServiceNowMessageHandler/ServiceNowClient.cs b/application/CohortManager/src/Functions/ServiceNowIntegration/ServiceNowMessageHandler/ServiceNowClient.cs index 753202a0ae..f505c0cd8c 100644 --- a/application/CohortManager/src/Functions/ServiceNowIntegration/ServiceNowMessageHandler/ServiceNowClient.cs +++ b/application/CohortManager/src/Functions/ServiceNowIntegration/ServiceNowMessageHandler/ServiceNowClient.cs @@ -156,7 +156,7 @@ private static HttpRequestMessage CreateRequest(string url, string json, string if (!response.IsSuccessStatusCode) { - _logger.LogError("Failed to refresh ServiceNow access token. StatusCode: {statusCode}", response.StatusCode); + _logger.LogError("Failed to refresh ServiceNow access token. StatusCode: {StatusCode}", response.StatusCode); return null; } diff --git a/application/CohortManager/src/Functions/Shared/Common/AuthorizationClientCredentials.cs b/application/CohortManager/src/Functions/Shared/Common/AuthorizationClientCredentials.cs index fd0947bfb5..e430128c28 100644 --- a/application/CohortManager/src/Functions/Shared/Common/AuthorizationClientCredentials.cs +++ b/application/CohortManager/src/Functions/Shared/Common/AuthorizationClientCredentials.cs @@ -40,7 +40,7 @@ public AuthorizationClientCredentials(IJwtTokenService jwtTokenService, HttpClie if (response.StatusCode != HttpStatusCode.OK) { - _logger.LogError("there was an error getting the bearer token from the NHS token service. Response: {resBody}", resBody); + _logger.LogError("there was an error getting the bearer token from the NHS token service. Response: {ResBody}", resBody); return null; } diff --git a/application/CohortManager/src/Functions/Shared/Common/AzureQueueStorageHelper.cs b/application/CohortManager/src/Functions/Shared/Common/AzureQueueStorageHelper.cs index 74673ade38..f4e334ca35 100644 --- a/application/CohortManager/src/Functions/Shared/Common/AzureQueueStorageHelper.cs +++ b/application/CohortManager/src/Functions/Shared/Common/AzureQueueStorageHelper.cs @@ -31,7 +31,7 @@ public async Task AddAsync(T message, string queueName) } catch (Exception ex) { - _logger.LogError(ex, "There was an error while putting item on queue for queue: {queueName}", queueName); + _logger.LogError(ex, "There was an error while putting item on queue for queue: {QueueName}", queueName); return false; } } diff --git a/application/CohortManager/src/Functions/Shared/Common/AzureServiceBusClient.cs b/application/CohortManager/src/Functions/Shared/Common/AzureServiceBusClient.cs index dc65fdd124..22367d8e54 100644 --- a/application/CohortManager/src/Functions/Shared/Common/AzureServiceBusClient.cs +++ b/application/CohortManager/src/Functions/Shared/Common/AzureServiceBusClient.cs @@ -46,7 +46,7 @@ public async Task AddAsync(T message, string queueName) } catch (Exception ex) { - _logger.LogError(ex, "There was an error sending message to service bus queue {queueName} {errorMessage}", queueName, ex.Message); + _logger.LogError(ex, "There was an error sending message to service bus queue {QueueName} {ErrorMessage}", queueName, ex.Message); return false; } } diff --git a/application/CohortManager/src/Functions/Shared/Common/ExceptionHandler.cs b/application/CohortManager/src/Functions/Shared/Common/ExceptionHandler.cs index 29937ead84..d23bb64847 100644 --- a/application/CohortManager/src/Functions/Shared/Common/ExceptionHandler.cs +++ b/application/CohortManager/src/Functions/Shared/Common/ExceptionHandler.cs @@ -225,7 +225,7 @@ public async Task CreateValidationExceptionLog(IEnumerab if (!string.IsNullOrEmpty(error.ExceptionMessage)) { errorMessage = error.ExceptionMessage; - _logger.LogError("an exception was raised while running the rules. Exception Message: {exceptionMessage}", error.ExceptionMessage); + _logger.LogError("an exception was raised while running the rules. Exception Message: {ExceptionMessage}", error.ExceptionMessage); } var exception = new ValidationException diff --git a/application/CohortManager/src/Functions/Shared/Common/MeshToBlobTransferHandler.cs b/application/CohortManager/src/Functions/Shared/Common/MeshToBlobTransferHandler.cs index 87b4f2d6e7..2255a80a23 100644 --- a/application/CohortManager/src/Functions/Shared/Common/MeshToBlobTransferHandler.cs +++ b/application/CohortManager/src/Functions/Shared/Common/MeshToBlobTransferHandler.cs @@ -63,7 +63,7 @@ public async Task MoveFilesFromMeshToBlob(Func predi messageCount = checkForMessages.Response.Messages.Count(); - _logger.LogInformation("{messageCount} Messages were found within mailbox {mailboxId}",messageCount,mailboxId); + _logger.LogInformation("{MessageCount} Messages were found within mailbox {MailboxId}",messageCount,mailboxId); if(messageCount == 0) { @@ -72,7 +72,7 @@ public async Task MoveFilesFromMeshToBlob(Func predi var messagesMoved = await MoveAllMessagesToBlobStorage(checkForMessages.Response.Messages,predicate); - _logger.LogInformation("{messagesMoved} out of {messageCount} Messages were moved mailbox: {mailboxId} to Blob Storage",messagesMoved,messageCount,mailboxId); + _logger.LogInformation("{MessagesMoved} out of {MessageCount} Messages were moved mailbox: {MailboxId} to Blob Storage",messagesMoved,messageCount,mailboxId); if(messagesMoved == 0 && messageCount == 500) { @@ -150,7 +150,7 @@ private async Task TransferMessageToBlobStorage(MessageMetaData messageHea var result = await _meshInboxService.GetChunkedMessageByIdAsync(_mailboxId,messageId); if(!result.IsSuccessful) { - _logger.LogError("Failed to download chunked message from MESH MessageId: {messageId}",messageId); + _logger.LogError("Failed to download chunked message from MESH MessageId: {MessageId}",messageId); return null; } @@ -165,7 +165,7 @@ private async Task TransferMessageToBlobStorage(MessageMetaData messageHea var result = await _meshInboxService.GetMessageByIdAsync(_mailboxId,messageId); if(!result.IsSuccessful) { - _logger.LogError("Failed to download chunked message from MESH MessageId: {messageId}",messageId); + _logger.LogError("Failed to download chunked message from MESH MessageId: {MessageId}",messageId); return null; } diff --git a/application/CohortManager/src/Functions/Shared/Common/ReadRules.cs b/application/CohortManager/src/Functions/Shared/Common/ReadRules.cs index 24dd729790..4cfb016b85 100644 --- a/application/CohortManager/src/Functions/Shared/Common/ReadRules.cs +++ b/application/CohortManager/src/Functions/Shared/Common/ReadRules.cs @@ -22,12 +22,12 @@ public async Task GetRulesFromDirectory(string jsonFileName) // Construct the path to the JSON file (assuming it was copied to the output directory) var filePath = Path.Combine(currentDirectory, jsonFileName); - _logger.LogInformation("file path: {filePath}", filePath); + _logger.LogInformation("file path: {FilePath}", filePath); // Check if the file exists if (!File.Exists(filePath)) { - _logger.LogError("File not found: {filePath}", filePath); + _logger.LogError("File not found: {FilePath}", filePath); return string.Empty; } @@ -37,7 +37,7 @@ public async Task GetRulesFromDirectory(string jsonFileName) } catch (Exception ex) { - _logger.LogError(ex, "error while getting rules from directory: {ex} {fileName}", ex.Message, jsonFileName); + _logger.LogError(ex, "error while getting rules from directory: {Ex} {FileName}", ex.Message, jsonFileName); return string.Empty; } } diff --git a/application/CohortManager/src/Functions/Shared/Data/Database/CreateCohortDistributionData.cs b/application/CohortManager/src/Functions/Shared/Data/Database/CreateCohortDistributionData.cs index ec7258c6a9..85512628e7 100644 --- a/application/CohortManager/src/Functions/Shared/Data/Database/CreateCohortDistributionData.cs +++ b/application/CohortManager/src/Functions/Shared/Data/Database/CreateCohortDistributionData.cs @@ -49,7 +49,6 @@ public async Task> GetUnextractedCohortDi public async Task> GetCohortDistributionParticipantsByRequestId(Guid requestId) { - var requestIdString = requestId.ToString(); if (requestId == Guid.Empty) { CohortDistributionParticipantDto(new List()); diff --git a/application/CohortManager/src/Functions/Shared/DataServices.Client/DataServiceCacheClient.cs b/application/CohortManager/src/Functions/Shared/DataServices.Client/DataServiceCacheClient.cs index 6b815c3e4e..82fdbdc136 100644 --- a/application/CohortManager/src/Functions/Shared/DataServices.Client/DataServiceCacheClient.cs +++ b/application/CohortManager/src/Functions/Shared/DataServices.Client/DataServiceCacheClient.cs @@ -19,10 +19,10 @@ public override async Task GetSingle(string id) { if (_cache.TryGetValue(id, out TEntity entity)) { - _logger.LogInformation("Cache Hit reading key {key} for entity : {entity}", id, typeof(TEntity).FullName); + _logger.LogInformation("Cache Hit reading key {Key} for entity : {Entity}", id, typeof(TEntity).FullName); return entity; } - _logger.LogInformation("Cache Miss reading key {key} for entity : {entity}", id, typeof(TEntity).FullName); + _logger.LogInformation("Cache Miss reading key {Key} for entity : {Entity}", id, typeof(TEntity).FullName); entity = await base.GetSingle(id); if (entity == null) { diff --git a/application/CohortManager/src/Web/app/api/GetValidationExceptions/route.ts b/application/CohortManager/src/Web/app/api/GetValidationExceptions/route.ts index 2d0a1867ab..b88546a10f 100644 --- a/application/CohortManager/src/Web/app/api/GetValidationExceptions/route.ts +++ b/application/CohortManager/src/Web/app/api/GetValidationExceptions/route.ts @@ -61,7 +61,7 @@ function paginate( IsFirstPage: clampedPage === 1, HasNextPage: clampedPage < safeTotalPages, HasPreviousPage: clampedPage > 1, - LastResultId: pageItems[pageItems.length - 1]?.ExceptionId ?? null, + LastResultId: pageItems.at(-1)?.ExceptionId ?? null, TotalItems: totalItems, TotalPages: safeTotalPages, CurrentPage: clampedPage, @@ -146,7 +146,7 @@ export async function GET(request: Request) { const isReport = searchParams.get("isReport"); const exceptionCategory = searchParams.get("exceptionCategory"); const reportDate = searchParams.get("reportDate"); - const page = Math.max(1, parseInt(searchParams.get("page") || "1", 10)); + const page = Math.max(1, Number.parseInt(searchParams.get("page") || "1", 10)); // Handle single exception requests - get fresh data from store if (exceptionId !== null) { diff --git a/application/CohortManager/src/Web/app/api/UpdateException/route.ts b/application/CohortManager/src/Web/app/api/UpdateException/route.ts index de54882220..18cc545b59 100644 --- a/application/CohortManager/src/Web/app/api/UpdateException/route.ts +++ b/application/CohortManager/src/Web/app/api/UpdateException/route.ts @@ -48,8 +48,8 @@ export async function PUT(request: NextRequest) { ); } - const exceptionId = parseInt(updateRequest.ExceptionId, 10); - if (isNaN(exceptionId) || exceptionId === 0) { + const exceptionId = Number.parseInt(updateRequest.ExceptionId, 10); + if (Number.isNaN(exceptionId) || exceptionId === 0) { console.warn("Invalid ExceptionId provided:", updateRequest.ExceptionId); return NextResponse.json( { error: "Invalid ExceptionId provided" }, diff --git a/application/CohortManager/src/Web/app/api/UpdateExceptionServiceNowId/route.ts b/application/CohortManager/src/Web/app/api/UpdateExceptionServiceNowId/route.ts index f4f422800f..96323d94db 100644 --- a/application/CohortManager/src/Web/app/api/UpdateExceptionServiceNowId/route.ts +++ b/application/CohortManager/src/Web/app/api/UpdateExceptionServiceNowId/route.ts @@ -51,7 +51,7 @@ export async function PUT(request: NextRequest) { const exceptionId = typeof rawExceptionId === "number" ? rawExceptionId - : parseInt(rawExceptionId, 10); + : Number.parseInt(rawExceptionId, 10); if (!Number.isFinite(exceptionId) || exceptionId <= 0) { console.warn("Invalid ExceptionId provided:", rawExceptionId); return NextResponse.json( diff --git a/application/CohortManager/src/Web/app/data/mockDataStore.ts b/application/CohortManager/src/Web/app/data/mockDataStore.ts index ff7c12e783..185888e59d 100644 --- a/application/CohortManager/src/Web/app/data/mockDataStore.ts +++ b/application/CohortManager/src/Web/app/data/mockDataStore.ts @@ -66,8 +66,13 @@ const initializeDataStore = () => { } }; - store.raisedExceptions.forEach(updateListItem); - store.notRaisedExceptions.forEach(updateListItem); + for (const item of store.raisedExceptions) { + updateListItem(item); + } + + for (const item of store.notRaisedExceptions) { + updateListItem(item); + } }; // 3001: category 12 (raised) – keep original times but set to today diff --git a/application/CohortManager/src/Web/app/exceptions/[filter]/page.tsx b/application/CohortManager/src/Web/app/exceptions/[filter]/page.tsx index 6c5eef5b8e..5f3466367f 100644 --- a/application/CohortManager/src/Web/app/exceptions/[filter]/page.tsx +++ b/application/CohortManager/src/Web/app/exceptions/[filter]/page.tsx @@ -42,7 +42,7 @@ export default async function Page({ const sortBy = resolvedSearchParams.sortBy === "0" ? 0 : 1; const currentPage = Math.max( 1, - parseInt(resolvedSearchParams.page || "1", 10) + Number.parseInt(resolvedSearchParams.page || "1", 10) ); const sortOptions = [ diff --git a/application/CohortManager/src/Web/app/exceptions/page.tsx b/application/CohortManager/src/Web/app/exceptions/page.tsx index 45c9d433db..38e0ece1a1 100644 --- a/application/CohortManager/src/Web/app/exceptions/page.tsx +++ b/application/CohortManager/src/Web/app/exceptions/page.tsx @@ -52,7 +52,7 @@ export default async function Page({ const sortBy = resolvedSearchParams.sortBy === "0" ? 0 : 1; const currentPage = Math.max( 1, - parseInt(resolvedSearchParams.page || "1", 10) + Number.parseInt(resolvedSearchParams.page || "1", 10) ); const sortOptions = [ diff --git a/application/CohortManager/src/Web/app/lib/pagination.ts b/application/CohortManager/src/Web/app/lib/pagination.ts index d922d6c4d3..5ada5d2837 100644 --- a/application/CohortManager/src/Web/app/lib/pagination.ts +++ b/application/CohortManager/src/Web/app/lib/pagination.ts @@ -116,12 +116,12 @@ export function extractPageFromUrl(url: string): number { try { const parsed = new URL(url); const value = parsed.searchParams.get(PAGE_PARAM); - const page = value ? parseInt(value, 10) : 1; + const page = value ? Number.parseInt(value, 10) : 1; return Number.isNaN(page) ? 1 : Math.max(1, page); } catch { const pageRegex = new RegExp(`[?&]${PAGE_PARAM}=(\\d+)`); const match = pageRegex.exec(url); - const page = match ? parseInt(match[1], 10) : 1; + const page = match ? Number.parseInt(match[1], 10) : 1; return Number.isNaN(page) ? 1 : Math.max(1, page); } } diff --git a/application/CohortManager/src/Web/app/lib/utils.ts b/application/CohortManager/src/Web/app/lib/utils.ts index 05c9614b52..eb7513919e 100644 --- a/application/CohortManager/src/Web/app/lib/utils.ts +++ b/application/CohortManager/src/Web/app/lib/utils.ts @@ -18,7 +18,7 @@ export const formatCompactDate = (dateString: string): string => { if (!dateString) return ""; const date = new Date(dateString); - if (isNaN(date.getTime())) return ""; + if (Number.isNaN(date.getTime())) return ""; const options: Intl.DateTimeFormatOptions = { day: "numeric", @@ -39,7 +39,7 @@ export function getCurrentDate(): string { export function formatGenderValue(gender?: number | string | null): string { if (gender === null || gender === undefined || gender === "") return ""; - const genderNum = typeof gender === "string" ? parseInt(gender, 10) : gender; + const genderNum = typeof gender === "string" ? Number.parseInt(gender, 10) : gender; if (genderNum === 1) return "Male"; if (genderNum === 2) return "Female"; if (genderNum === 9) return "Unspecified"; diff --git a/application/CohortManager/src/Web/app/reports/page.tsx b/application/CohortManager/src/Web/app/reports/page.tsx index 7fb5c9962e..35d580cfbe 100644 --- a/application/CohortManager/src/Web/app/reports/page.tsx +++ b/application/CohortManager/src/Web/app/reports/page.tsx @@ -36,17 +36,18 @@ export default async function Page() { d.setDate(today.getDate() - i); const dateString = formatIsoDate(d); - reports.push({ - reportId: `${dateString}?category=13`, - dateCreated: dateString, - category: 13, - }); - - reports.push({ - reportId: `${dateString}?category=12`, - dateCreated: dateString, - category: 12, - }); + reports.push( + { + reportId: `${dateString}?category=13`, + dateCreated: dateString, + category: 13, + }, + { + reportId: `${dateString}?category=12`, + dateCreated: dateString, + category: 12, + } + ); } return ( diff --git a/application/CohortManager/src/Web/jest.config.ts b/application/CohortManager/src/Web/jest.config.ts index e3950bff8a..24e2f103de 100644 --- a/application/CohortManager/src/Web/jest.config.ts +++ b/application/CohortManager/src/Web/jest.config.ts @@ -10,7 +10,7 @@ const createJestConfig = nextJest({ const config: Config = { coverageProvider: "v8", testEnvironment: "jsdom", - testPathIgnorePatterns: ["/node_modules/", "/\\.features-gen/"], + testPathIgnorePatterns: ["/node_modules/", String.raw`/\.features-gen/`], // Add more setup options before each test is run // setupFilesAfterEnv: ['/jest.setup.ts'], }; diff --git a/tests/playwright-tests/scripts/health-check.js b/tests/playwright-tests/scripts/health-check.js index c1e68d991f..7fd13f780c 100644 --- a/tests/playwright-tests/scripts/health-check.js +++ b/tests/playwright-tests/scripts/health-check.js @@ -15,16 +15,16 @@ function parseArgs() { if (skipNext) { skipNext = false; continue; } const a = args[i]; if (a === '--max-attempts' && args[i + 1]) { - const parsed = parseInt(args[i + 1], 10); - if (isNaN(parsed) || parsed < 1) { + const parsed = Number.parseInt(args[i + 1], 10); + if (Number.isNaN(parsed) || parsed < 1) { console.error('Error: --max-attempts must be a positive number'); process.exit(1); } maxAttempts = parsed; skipNext = true; } else if (a === '--interval' && args[i + 1]) { - const parsed = parseInt(args[i + 1], 10); - if (isNaN(parsed) || parsed < 100) { + const parsed = Number.parseInt(args[i + 1], 10); + if (Number.isNaN(parsed) || parsed < 100) { console.error('Error: --interval must be at least 100ms'); process.exit(1); } From 3efb7d30bb3d2bd4eedcc8b8c40e4bbfcaa0c9d6 Mon Sep 17 00:00:00 2001 From: Joseph2910 <184524642+Joseph2910@users.noreply.github.com> Date: Tue, 23 Sep 2025 16:03:05 +0100 Subject: [PATCH 3/6] chore: remove whitespace --- application/CohortManager/src/Web/app/reports/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/CohortManager/src/Web/app/reports/page.tsx b/application/CohortManager/src/Web/app/reports/page.tsx index 35d580cfbe..8446a5163b 100644 --- a/application/CohortManager/src/Web/app/reports/page.tsx +++ b/application/CohortManager/src/Web/app/reports/page.tsx @@ -41,7 +41,7 @@ export default async function Page() { reportId: `${dateString}?category=13`, dateCreated: dateString, category: 13, - }, + }, { reportId: `${dateString}?category=12`, dateCreated: dateString, From fc93054791934e6910ce072686c6909deac12ea5 Mon Sep 17 00:00:00 2001 From: Joseph2910 <184524642+Joseph2910@users.noreply.github.com> Date: Wed, 24 Sep 2025 09:31:32 +0100 Subject: [PATCH 4/6] chore: Address comments --- .../UpdateBlockedFlag/BlockParticipantHandler.cs | 2 +- .../CohortManager/src/Functions/Shared/Model/PdsDemographic.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/CohortManager/src/Functions/ParticipantManagementServices/UpdateBlockedFlag/BlockParticipantHandler.cs b/application/CohortManager/src/Functions/ParticipantManagementServices/UpdateBlockedFlag/BlockParticipantHandler.cs index f5a9ab1c2a..fb97a2f2c6 100644 --- a/application/CohortManager/src/Functions/ParticipantManagementServices/UpdateBlockedFlag/BlockParticipantHandler.cs +++ b/application/CohortManager/src/Functions/ParticipantManagementServices/UpdateBlockedFlag/BlockParticipantHandler.cs @@ -16,7 +16,7 @@ public class BlockParticipantHandler : IBlockParticipantHandler private readonly IDataServiceClient _participantDemographicDataService; private readonly IHttpClientFunction _httpClient; private readonly UpdateBlockedFlagConfig _config; - private static string CultureInfo = "en-GB"; + private static readonly string CultureInfo = "en-GB"; public BlockParticipantHandler(ILogger logger, IDataServiceClient participantManagementDataService, IDataServiceClient participantDemographicDataService, diff --git a/application/CohortManager/src/Functions/Shared/Model/PdsDemographic.cs b/application/CohortManager/src/Functions/Shared/Model/PdsDemographic.cs index 332ddfcc99..ea442adc9f 100644 --- a/application/CohortManager/src/Functions/Shared/Model/PdsDemographic.cs +++ b/application/CohortManager/src/Functions/Shared/Model/PdsDemographic.cs @@ -44,7 +44,7 @@ public ParticipantDemographic ToParticipantDemographic() TelephoneNumberHome = TelephoneNumber, TelephoneNumberHomeFromDate = MappingUtilities.ParseDates(TelephoneNumberEffectiveFromDate!)?.ToString(DateFormat), TelephoneNumberMob = MobileNumber, - TelephoneNumberMobFromDate = MappingUtilities.ParseDates(MobileNumberEffectiveFromDate!)?.ToString(DateFormat), + TelephoneNumberMobFromDate = MappingUtilities.ParseDates(MobileNumberEffectiveFromDate!)?.ToString("yyyy-MM-dd"), EmailAddressHome = EmailAddress, EmailAddressHomeFromDate = MappingUtilities.ParseDates(EmailAddressEffectiveFromDate!)?.ToString(DateFormat), PreferredLanguage = PreferredLanguage, From 95abc0fda5ca67647edbb40520011af2eaa575c6 Mon Sep 17 00:00:00 2001 From: Joe P <184524642+Joseph2910@users.noreply.github.com> Date: Thu, 2 Oct 2025 14:37:02 +0100 Subject: [PATCH 5/6] chore: Add import --- .../ManageCaasSubscription/ManageCaasSubscription.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/application/CohortManager/src/Functions/DemographicServices/ManageCaasSubscription/ManageCaasSubscription.cs b/application/CohortManager/src/Functions/DemographicServices/ManageCaasSubscription/ManageCaasSubscription.cs index 677e2a32d2..c9af05a595 100644 --- a/application/CohortManager/src/Functions/DemographicServices/ManageCaasSubscription/ManageCaasSubscription.cs +++ b/application/CohortManager/src/Functions/DemographicServices/ManageCaasSubscription/ManageCaasSubscription.cs @@ -7,6 +7,7 @@ namespace NHS.CohortManager.DemographicServices; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Common; +using System.Text; using DataServices.Core; using Model; using System.Text.Json; From d563db85c7a00adc62fa5c3ff9d2d8dba1340e3f Mon Sep 17 00:00:00 2001 From: Joseph2910 <184524642+Joseph2910@users.noreply.github.com> Date: Mon, 13 Oct 2025 16:02:09 +0100 Subject: [PATCH 6/6] fix: Revert add --- scripts/backups/db-backup-container/Dockerfile | 14 +++++++------- scripts/backups/db-restore-container/Dockerfile | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/backups/db-backup-container/Dockerfile b/scripts/backups/db-backup-container/Dockerfile index f6799ff53a..7930cea698 100644 --- a/scripts/backups/db-backup-container/Dockerfile +++ b/scripts/backups/db-backup-container/Dockerfile @@ -2,22 +2,22 @@ FROM mcr.microsoft.com/powershell:latest # Create a non-root user and group -RUN groupadd -r appgroup && useradd -r -g appgroup appuser \ +RUN groupadd -r appgroup && useradd -r -g appgroup appuser # Update package lists and install required tools. # 'lsb-release' is added to fix the 'lsb_release: not found' error. -&& apt-get update && apt-get install -y --no-install-recommends \ +RUN apt-get update && apt-get install -y --no-install-recommends \ + wget \ + unzip \ gnupg \ lsb-release \ - unzip \ - wget \ - && rm -rf /var/lib/apt/lists/* \ + && rm -rf /var/lib/apt/lists/* # Install the Az PowerShell module for Azure authentication. -&& pwsh -Command "Install-Module -Name Az.Accounts -RequiredVersion 2.12.0 -Force -Scope AllUsers" +RUN pwsh -Command "Install-Module -Name Az.Accounts -RequiredVersion 2.12.0 -Force -Scope AllUsers" # Install SqlPackage by downloading the binary. -ADD -O sqlpackage.zip https://aka.ms/sqlpackage-linux \ +RUN wget -O sqlpackage.zip https://aka.ms/sqlpackage-linux \ && mkdir /opt/sqlpackage \ && unzip sqlpackage.zip -d /opt/sqlpackage \ && rm sqlpackage.zip \ diff --git a/scripts/backups/db-restore-container/Dockerfile b/scripts/backups/db-restore-container/Dockerfile index e281dc9089..9402826bff 100644 --- a/scripts/backups/db-restore-container/Dockerfile +++ b/scripts/backups/db-restore-container/Dockerfile @@ -2,16 +2,16 @@ FROM mcr.microsoft.com/powershell:latest # Create a non-root user and group -RUN groupadd -r appgroup && useradd -r -g appgroup appuser \ +RUN groupadd -r appgroup && useradd -r -g appgroup appuser # Update package lists and install wget and unzip. -&& apt-get update && apt-get --no-install-recommends install -y wget unzip \ +RUN apt-get update && apt-get --no-install-recommends install -y wget unzip # Install the Az PowerShell module for Azure authentication -&& pwsh -Command "Install-Module -Name Az.Accounts -RequiredVersion 2.12.0 -Force -Scope AllUsers" \ +RUN pwsh -Command "Install-Module -Name Az.Accounts -RequiredVersion 2.12.0 -Force -Scope AllUsers" # Install SqlPackage. -ADD -O sqlpackage.zip https://aka.ms/sqlpackage-linux \ +RUN wget -O sqlpackage.zip https://aka.ms/sqlpackage-linux \ && mkdir /opt/sqlpackage \ && unzip sqlpackage.zip -d /opt/sqlpackage \ && rm sqlpackage.zip \