diff --git a/azure/accounts.template.json b/azure/accounts.template.json index 73b9434e64..0c59aa4c1f 100644 --- a/azure/accounts.template.json +++ b/azure/accounts.template.json @@ -564,10 +564,6 @@ "AccountsCosmosDbName": { "type": "string", "value": "[variables('cosmosDbName')]" - }, - "AccountsCosmosDbPrimaryMasterKey": { - "type": "string", - "value": "[reference('cosmos-db-resources-deployment').outputs.PrimaryMasterKey.value]" } } } diff --git a/src/SFA.DAS.EmployerAccounts.UnitTests/Commands/RemoveLegalEntityTests/WhenIRemoveALegalEntity.cs b/src/SFA.DAS.EmployerAccounts.UnitTests/Commands/RemoveLegalEntityTests/WhenIRemoveALegalEntity.cs index ad200686b0..8e2628ddb5 100644 --- a/src/SFA.DAS.EmployerAccounts.UnitTests/Commands/RemoveLegalEntityTests/WhenIRemoveALegalEntity.cs +++ b/src/SFA.DAS.EmployerAccounts.UnitTests/Commands/RemoveLegalEntityTests/WhenIRemoveALegalEntity.cs @@ -114,7 +114,11 @@ public void Arrange() { new ApprenticeshipStatusSummary { - ActiveCount = 0,PausedCount = 0,PendingApprovalCount = 0,LegalEntityIdentifier = _expectedAgreement.LegalEntityCode + ActiveCount = 0, + PausedCount = 0, + PendingApprovalCount = 0, + CompletedCount = 0, + LegalEntityIdentifier = _expectedAgreement.LegalEntityCode } }); @@ -229,7 +233,27 @@ public async Task ThenTheAgreementIsCheckedToSeeIfItHasBeenSignedAndHasActiveCom { new ApprenticeshipStatusSummary { - ActiveCount = 1,PausedCount = 1,PendingApprovalCount = 1,LegalEntityIdentifier = _expectedAgreement.LegalEntityCode + ActiveCount = 1, + PausedCount = 1, + PendingApprovalCount = 1, + LegalEntityIdentifier = _expectedAgreement.LegalEntityCode + } + }); + + Assert.ThrowsAsync(() => _handler.Handle(_command)); + } + + [Test] + public async Task ThenTheAgreementIsCheckedToSeeIfItHasBeenSignedAndHasWithdrawnCommitments() + { + _commitmentsApi + .Setup(x => x.GetEmployerAccountSummary(ExpectedAccountId)) + .ReturnsAsync(new List + { + new ApprenticeshipStatusSummary + { + WithdrawnCount = 1, + LegalEntityIdentifier = _expectedAgreement.LegalEntityCode } }); diff --git a/src/SFA.DAS.EmployerAccounts.Web/SFA.DAS.EmployerAccounts.Web.csproj b/src/SFA.DAS.EmployerAccounts.Web/SFA.DAS.EmployerAccounts.Web.csproj index a89a2a284c..4dd1022ac2 100644 --- a/src/SFA.DAS.EmployerAccounts.Web/SFA.DAS.EmployerAccounts.Web.csproj +++ b/src/SFA.DAS.EmployerAccounts.Web/SFA.DAS.EmployerAccounts.Web.csproj @@ -138,7 +138,7 @@ 1.0.16 - 1.1.72 + 1.1.75 diff --git a/src/SFA.DAS.EmployerAccounts.Web/Views/Settings/NotificationSettings.cshtml b/src/SFA.DAS.EmployerAccounts.Web/Views/Settings/NotificationSettings.cshtml index e896e80fb7..fa527f71a1 100644 --- a/src/SFA.DAS.EmployerAccounts.Web/Views/Settings/NotificationSettings.cshtml +++ b/src/SFA.DAS.EmployerAccounts.Web/Views/Settings/NotificationSettings.cshtml @@ -1,13 +1,15 @@ -@model OrchestratorResponse -@{ViewBag.Title = "Notification Settings"; } -@{ ViewBag.PageId = "notification-settings"; } -@{ViewBag.HideNav = true; } +@using SFA.DAS.EmployerAccounts.Web.Helpers +@model OrchestratorResponse -
+@{ + ViewBag.Title = "Notification Settings"; + ViewBag.PageId = "notification-settings"; + ViewBag.HideNav = true; +} +
-

Notification Settings

Choose which accounts you want to receive cohort and apprentice updates from.

Changes to these settings won't affect service emails, such as password resets.

@@ -15,7 +17,7 @@ @Html.AntiForgeryToken() - + @@ -24,55 +26,46 @@ + - @for (var i = 0; i < Model.Data.NotificationSettings.Count; i++) { var setting = Model.Data.NotificationSettings[i]; - } - -
No emails
- @setting.Name - + @setting.Name + @Html.Hidden($"NotificationSettings[{i}].HashedAccountId", setting.HashedAccountId) @Html.Hidden($"NotificationSettings[{i}].Name", setting.Name) @Html.Hidden($"NotificationSettings[{i}].Id", setting.Id) - - @{ var trueId = $"NotificationSettings-true-{i}"; + @{ + var trueId = $"NotificationSettings-true-{i}"; var falseId = $"NotificationSettings-false-{i}"; - - } + } - + @Html.RadioButton($"NotificationSettings[{i}].ReceiveNotifications", true, setting.ReceiveNotifications, new { id = trueId }) + -
- - - - - Cancel + +

+

Cancel

-
diff --git a/src/SFA.DAS.EmployerAccounts/Commands/RemoveLegalEntity/RemoveLegalEntityCommandHandler.cs b/src/SFA.DAS.EmployerAccounts/Commands/RemoveLegalEntity/RemoveLegalEntityCommandHandler.cs index 70dc3c90aa..ad09af67e2 100644 --- a/src/SFA.DAS.EmployerAccounts/Commands/RemoveLegalEntity/RemoveLegalEntityCommandHandler.cs +++ b/src/SFA.DAS.EmployerAccounts/Commands/RemoveLegalEntity/RemoveLegalEntityCommandHandler.cs @@ -125,7 +125,7 @@ private async Task ValidateLegalEntityHasNoCommitments(EmployerAgreementView agr && c.LegalEntityIdentifier.Equals(agreement.LegalEntityCode) && c.LegalEntityOrganisationType == agreement.LegalEntitySource); - if (commitment != null && (commitment.ActiveCount + commitment.PausedCount + commitment.PendingApprovalCount) != 0) + if (commitment != null && (commitment.ActiveCount + commitment.PausedCount + commitment.PendingApprovalCount + commitment.WithdrawnCount) != 0) { validationResult.AddError(nameof(agreement.HashedAgreementId), "Agreement has already been signed and has active commitments"); throw new InvalidRequestException(validationResult.ValidationDictionary); diff --git a/src/SFA.DAS.EmployerAccounts/DependencyResolution/HashingRegistry.cs b/src/SFA.DAS.EmployerAccounts/DependencyResolution/HashingRegistry.cs index b507b69196..d1f2053b63 100644 --- a/src/SFA.DAS.EmployerAccounts/DependencyResolution/HashingRegistry.cs +++ b/src/SFA.DAS.EmployerAccounts/DependencyResolution/HashingRegistry.cs @@ -30,7 +30,7 @@ public HashingRegistry() .Ctor() .Is(c => new HashingService.HashingService( - c.GetInstance() .PublicAllowedAccountLegalEntityHashstringCharacters, + c.GetInstance().PublicAllowedAccountLegalEntityHashstringCharacters, c.GetInstance().PublicAllowedAccountLegalEntityHashstringSalt)); } diff --git a/src/SFA.DAS.EmployerAccounts/Queries/GetAccountLegalEntityRemove/GetAccountLegalEntityRemoveQueryHandler.cs b/src/SFA.DAS.EmployerAccounts/Queries/GetAccountLegalEntityRemove/GetAccountLegalEntityRemoveQueryHandler.cs index e7d5d0f0fe..5bee6daeab 100644 --- a/src/SFA.DAS.EmployerAccounts/Queries/GetAccountLegalEntityRemove/GetAccountLegalEntityRemoveQueryHandler.cs +++ b/src/SFA.DAS.EmployerAccounts/Queries/GetAccountLegalEntityRemove/GetAccountLegalEntityRemoveQueryHandler.cs @@ -84,6 +84,7 @@ private async Task SetRemovedStatusBasedOnCommitments(long accountId, Acco return commitmentConnectedToEntity == null || (commitmentConnectedToEntity.ActiveCount + commitmentConnectedToEntity.PendingApprovalCount + + commitmentConnectedToEntity.WithdrawnCount + commitmentConnectedToEntity.PausedCount) == 0; } } diff --git a/src/SFA.DAS.EmployerFinance.Web/SFA.DAS.EmployerFinance.Web.csproj b/src/SFA.DAS.EmployerFinance.Web/SFA.DAS.EmployerFinance.Web.csproj index 86cbcdcbd5..1eb399f82a 100644 --- a/src/SFA.DAS.EmployerFinance.Web/SFA.DAS.EmployerFinance.Web.csproj +++ b/src/SFA.DAS.EmployerFinance.Web/SFA.DAS.EmployerFinance.Web.csproj @@ -97,7 +97,7 @@ 1.0.5
- 1.1.72 + 1.1.75