diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api.Types/Responses/AccountLegalEntityResponse.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api.Types/Responses/AccountLegalEntityResponse.cs index 1e02a5c801..003c9f64bf 100644 --- a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api.Types/Responses/AccountLegalEntityResponse.cs +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api.Types/Responses/AccountLegalEntityResponse.cs @@ -1,4 +1,6 @@ -namespace SFA.DAS.CommitmentsV2.Api.Types.Responses +using SFA.DAS.CommitmentsV2.Types; + +namespace SFA.DAS.CommitmentsV2.Api.Types.Responses { public class AccountLegalEntityResponse { @@ -6,5 +8,6 @@ public class AccountLegalEntityResponse public long MaLegalEntityId { get; set; } public string AccountName { get; set; } public string LegalEntityName { get; set; } + public ApprenticeshipEmployerType LevyStatus { get; set; } } } diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api.Types/Responses/AccountResponse.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api.Types/Responses/AccountResponse.cs index baa4e37f5f..3037ed1fde 100644 --- a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api.Types/Responses/AccountResponse.cs +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api.Types/Responses/AccountResponse.cs @@ -1,9 +1,12 @@ -namespace SFA.DAS.CommitmentsV2.Api.Types.Responses +using SFA.DAS.CommitmentsV2.Types; + +namespace SFA.DAS.CommitmentsV2.Api.Types.Responses { public class AccountResponse { public long AccountId { get; set; } public bool HasCohorts { get; set; } public bool HasApprenticeships { get; set; } + public ApprenticeshipEmployerType LevyStatus { get; set; } } } diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api.Types/Responses/GetCohortResponse.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api.Types/Responses/GetCohortResponse.cs index 0cb7213563..75f54b3b0b 100644 --- a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api.Types/Responses/GetCohortResponse.cs +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api.Types/Responses/GetCohortResponse.cs @@ -16,5 +16,6 @@ public sealed class GetCohortResponse public bool IsApprovedByEmployer { get; set; } public bool IsApprovedByProvider { get; set; } public bool IsCompleteForEmployer { get; set; } + public ApprenticeshipEmployerType LevyStatus { get; set; } } } \ No newline at end of file diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api.UnitTests/Controllers/AccountControllerTests.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api.UnitTests/Controllers/AccountControllerTests.cs index 22f031cfe0..db3bf26dc8 100644 --- a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api.UnitTests/Controllers/AccountControllerTests.cs +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api.UnitTests/Controllers/AccountControllerTests.cs @@ -86,8 +86,7 @@ public void VerifyResult() var response = (AccountResponse) objectResult.Value; Assert.AreEqual(MediatorQueryResult.AccountId, response.AccountId); - Assert.AreEqual(MediatorQueryResult.HasApprenticeships, response.HasApprenticeships); - Assert.AreEqual(MediatorQueryResult.HasCohorts, response.HasCohorts); + Assert.AreEqual(MediatorQueryResult.LevyStatus, response.LevyStatus); } public void VerifyApprovedProviderResponse() diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api.UnitTests/Controllers/AccountLegalEntityControllerTests.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api.UnitTests/Controllers/AccountLegalEntityControllerTests.cs index 3dafc87bb7..a79ac8ccb2 100644 --- a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api.UnitTests/Controllers/AccountLegalEntityControllerTests.cs +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api.UnitTests/Controllers/AccountLegalEntityControllerTests.cs @@ -8,6 +8,7 @@ using SFA.DAS.CommitmentsV2.Api.Controllers; using SFA.DAS.CommitmentsV2.Api.Types.Responses; using SFA.DAS.CommitmentsV2.Application.Queries.GetAccountLegalEntity; +using SFA.DAS.CommitmentsV2.Types; namespace SFA.DAS.CommitmentsV2.Api.UnitTests.Controllers { @@ -41,7 +42,7 @@ public async Task GetAccountLegalEntity_WithValidModelAndExistingId_ShouldResult // arrange var fixtures = new AccountLegalEntityControllerTestFixtures() - .SetQueryResponse(accountLegalEntityId, new GetAccountLegalEntityQueryResult { AccountId = 1, MaLegalEntityId = 234, AccountName = "AccountName", LegalEntityName = "ABC" }); + .SetQueryResponse(accountLegalEntityId, new GetAccountLegalEntityQueryResult { AccountId = 1, MaLegalEntityId = 234, AccountName = "AccountName", LegalEntityName = "ABC", LevyStatus = ApprenticeshipEmployerType.Levy }); // act var response = await fixtures.CallControllerMethod(accountLegalEntityId); @@ -55,6 +56,7 @@ public async Task GetAccountLegalEntity_WithValidModelAndExistingId_ShouldResult Assert.AreEqual(234, model.MaLegalEntityId); Assert.AreEqual("AccountName", model.AccountName); Assert.AreEqual("ABC", model.LegalEntityName); + Assert.AreEqual(ApprenticeshipEmployerType.Levy, model.LevyStatus); } [Test] diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api.UnitTests/Controllers/CohortControllerTests/GetTests.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api.UnitTests/Controllers/CohortControllerTests/GetTests.cs index b6e72eda5f..7f4b091744 100644 --- a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api.UnitTests/Controllers/CohortControllerTests/GetTests.cs +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api.UnitTests/Controllers/CohortControllerTests/GetTests.cs @@ -40,7 +40,8 @@ await TestAsync( v.LatestMessageCreatedByEmployer == f.GetCohortResult.LatestMessageCreatedByEmployer && v.LatestMessageCreatedByProvider == f.GetCohortResult.LatestMessageCreatedByProvider && v.IsApprovedByEmployer == f.GetCohortResult.IsApprovedByEmployer && - v.IsApprovedByProvider == f.GetCohortResult.IsApprovedByProvider)); + v.IsApprovedByProvider == f.GetCohortResult.IsApprovedByProvider && + v.LevyStatus == f.GetCohortResult.LevyStatus)); } [Test] diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api/Controllers/AccountController.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api/Controllers/AccountController.cs index 45197b0078..0620265317 100644 --- a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api/Controllers/AccountController.cs +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api/Controllers/AccountController.cs @@ -5,6 +5,7 @@ using SFA.DAS.CommitmentsV2.Api.Types.Responses; using SFA.DAS.CommitmentsV2.Application.Queries.GetAccountSummary; using SFA.DAS.CommitmentsV2.Application.Queries.GetApprovedProviders; +using SFA.DAS.CommitmentsV2.Types; namespace SFA.DAS.CommitmentsV2.Api.Controllers { @@ -32,8 +33,7 @@ public async Task GetAccount(long accountId) return Ok(new AccountResponse { AccountId = employer.AccountId, - HasApprenticeships = employer.HasApprenticeships, - HasCohorts = employer.HasCohorts + LevyStatus = employer.LevyStatus }); } diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api/Controllers/AccountLegalEntityController.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api/Controllers/AccountLegalEntityController.cs index bdf18d9619..01d69c887f 100644 --- a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api/Controllers/AccountLegalEntityController.cs +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api/Controllers/AccountLegalEntityController.cs @@ -7,6 +7,7 @@ using SFA.DAS.CommitmentsV2.Api.Extensions; using SFA.DAS.CommitmentsV2.Api.Types.Responses; using SFA.DAS.CommitmentsV2.Application.Queries.GetAccountLegalEntity; +using SFA.DAS.CommitmentsV2.Types; namespace SFA.DAS.CommitmentsV2.Api.Controllers { @@ -51,7 +52,8 @@ public async Task GetAccountLegalEntity(long accountLegalEntityId AccountId = employer.AccountId, MaLegalEntityId = employer.MaLegalEntityId, AccountName = employer.AccountName, - LegalEntityName = employer.LegalEntityName + LegalEntityName = employer.LegalEntityName, + LevyStatus = employer.LevyStatus }); } } diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api/Controllers/CohortController.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api/Controllers/CohortController.cs index 0d4b81d01d..520393c5bf 100644 --- a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api/Controllers/CohortController.cs +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.Api/Controllers/CohortController.cs @@ -118,7 +118,8 @@ public async Task Get(long cohortId) LatestMessageCreatedByProvider = result.LatestMessageCreatedByProvider, IsApprovedByEmployer = result.IsApprovedByEmployer, IsApprovedByProvider = result.IsApprovedByProvider, - IsCompleteForEmployer = result.IsCompleteForEmployer + IsCompleteForEmployer = result.IsCompleteForEmployer, + LevyStatus = result.LevyStatus }); } diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.MessageHandlers.TestHarness/SFA.DAS.CommitmentsV2.MessageHandlers.TestHarness.csproj b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.MessageHandlers.TestHarness/SFA.DAS.CommitmentsV2.MessageHandlers.TestHarness.csproj index 3963e38286..971931843b 100644 --- a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.MessageHandlers.TestHarness/SFA.DAS.CommitmentsV2.MessageHandlers.TestHarness.csproj +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.MessageHandlers.TestHarness/SFA.DAS.CommitmentsV2.MessageHandlers.TestHarness.csproj @@ -13,6 +13,7 @@ + diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.MessageHandlers.TestHarness/TestHarness.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.MessageHandlers.TestHarness/TestHarness.cs index df71fc4b8c..a33b3506ad 100644 --- a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.MessageHandlers.TestHarness/TestHarness.cs +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.MessageHandlers.TestHarness/TestHarness.cs @@ -7,6 +7,7 @@ using SFA.DAS.CommitmentsV2.Types; using SFA.DAS.EmployerAccounts.Messages.Events; using SFA.DAS.EmployerAccounts.Types.Models; +using SFA.DAS.EmployerFinance.Messages.Events; using SFA.DAS.Payments.ProviderPayments.Messages; namespace SFA.DAS.CommitmentsV2.MessageHandlers.TestHarness @@ -51,6 +52,7 @@ public async Task Run() Console.WriteLine("O - CohortDeletedEvent"); Console.WriteLine("P - ApproveTransferRequestCommand"); Console.WriteLine("Q - RejectTransferRequestCommand"); + Console.WriteLine("S - LevyAddedToAccount"); Console.WriteLine("X - Exit"); Console.WriteLine("Press [Key] for Test Option"); key = Console.ReadKey().Key; @@ -147,6 +149,11 @@ await _publisher.Publish(new AddedLegalEntityEvent { AccountId = accountId, Crea Console.WriteLine(); Console.WriteLine($"Sent {nameof(RejectTransferRequestCommand)}"); break; + case ConsoleKey.S: + await _publisher.Publish(new LevyAddedToAccount { AccountId = accountId, Amount = 10, Created = DateTime.UtcNow }); + Console.WriteLine(); + Console.WriteLine($"Sent {nameof(LevyAddedToAccount)}"); + break; } } catch (Exception e) diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.MessageHandlers.UnitTests/EventHandlers/LevyAddedToAccountEventHandlerTests.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.MessageHandlers.UnitTests/EventHandlers/LevyAddedToAccountEventHandlerTests.cs new file mode 100644 index 0000000000..ce9182e5f8 --- /dev/null +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.MessageHandlers.UnitTests/EventHandlers/LevyAddedToAccountEventHandlerTests.cs @@ -0,0 +1,55 @@ +using System.Threading; +using System.Threading.Tasks; +using AutoFixture; +using MediatR; +using Microsoft.Extensions.Logging; +using Moq; +using NServiceBus; +using NUnit.Framework; +using SFA.DAS.CommitmentsV2.Application.Commands.UpdateLevyStatusToLevy; +using SFA.DAS.CommitmentsV2.MessageHandlers.EventHandlers; +using SFA.DAS.EmployerFinance.Messages.Events; + +namespace SFA.DAS.CommitmentsV2.MessageHandlers.UnitTests.EventHandlers +{ + [TestFixture] + [Parallelizable(ParallelScope.All)] + public class LevyAddedToAccountEventHandlerTests + { + [Test] + public async Task Handle_WhenLevyAddedToAccountIsRaised_LevyStatusIsSetToLevy() + { + var f = new LevyAddedToAccountEventHandlerTestsFixture(); + await f.Handle(); + f.VerifyUpdateLevyStatusToLevyCommandSent(); + } + } + + public class LevyAddedToAccountEventHandlerTestsFixture + { + public Mock Mediator { get; set; } + public LevyAddedToAccountEventHandler Sut; + public LevyAddedToAccount LevyAddedToAccount; + + public LevyAddedToAccountEventHandlerTestsFixture() + { + var autoFixture = new Fixture(); + Mediator = new Mock(); + LevyAddedToAccount = autoFixture.Create(); + + Sut = new LevyAddedToAccountEventHandler(Mediator.Object, Mock.Of>()); + } + + public Task Handle() + { + return Sut.Handle(LevyAddedToAccount, Mock.Of()); + } + + public void VerifyUpdateLevyStatusToLevyCommandSent() + { + Mediator.Verify(x => + x.Send(It.Is(p => p.AccountId == LevyAddedToAccount.AccountId), + It.IsAny())); + } + } +} diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.MessageHandlers/EventHandlers/LevyAddedToAccountEventHandler.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.MessageHandlers/EventHandlers/LevyAddedToAccountEventHandler.cs new file mode 100644 index 0000000000..b3a6631801 --- /dev/null +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.MessageHandlers/EventHandlers/LevyAddedToAccountEventHandler.cs @@ -0,0 +1,27 @@ +using MediatR; +using Microsoft.Extensions.Logging; +using NServiceBus; +using SFA.DAS.CommitmentsV2.Application.Commands.UpdateLevyStatusToLevy; +using SFA.DAS.EmployerFinance.Messages.Events; +using System.Threading.Tasks; + +namespace SFA.DAS.CommitmentsV2.MessageHandlers.EventHandlers +{ + public class LevyAddedToAccountEventHandler : IHandleMessages + { + private readonly IMediator _mediator; + private readonly ILogger _logger; + + public LevyAddedToAccountEventHandler(IMediator mediator, ILogger logger) + { + _mediator = mediator; + _logger = logger; + } + + public async Task Handle(LevyAddedToAccount message, IMessageHandlerContext context) + { + _logger.LogInformation($"LevyAddedToAccount event received for Account {message.AccountId}"); + await _mediator.Send(new UpdateLevyStatusToLevyCommand { AccountId = message.AccountId }); + } + } +} diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.MessageHandlers/SFA.DAS.CommitmentsV2.MessageHandlers.csproj b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.MessageHandlers/SFA.DAS.CommitmentsV2.MessageHandlers.csproj index a82b163bdb..ba22a7936c 100644 --- a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.MessageHandlers/SFA.DAS.CommitmentsV2.MessageHandlers.csproj +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.MessageHandlers/SFA.DAS.CommitmentsV2.MessageHandlers.csproj @@ -32,6 +32,7 @@ + diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Commands/UpdateLevyStatusToLevyCommandHandlerTests.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Commands/UpdateLevyStatusToLevyCommandHandlerTests.cs new file mode 100644 index 0000000000..b86a281cc2 --- /dev/null +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Commands/UpdateLevyStatusToLevyCommandHandlerTests.cs @@ -0,0 +1,83 @@ +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using AutoFixture; +using MediatR; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; +using Moq; +using NUnit.Framework; +using SFA.DAS.CommitmentsV2.Application.Commands.UpdateLevyStatusToLevy; +using SFA.DAS.CommitmentsV2.Data; +using SFA.DAS.CommitmentsV2.Models; +using SFA.DAS.CommitmentsV2.Types; + +namespace SFA.DAS.CommitmentsV2.UnitTests.Application.Commands +{ + [TestFixture] + [Parallelizable(ParallelScope.None)] + public class UpdateLevyStatusToLevyCommandHandlerTests + { + [Test] + public void Handle_WhenHandlingCommand_ThenShouldUpdateTheLevyStatus() + { + var f = new UpdateLevyStatusToLevyCommandHandlerTestsFixture(); + f.SetAccount() + .Handle(); + + Assert.IsTrue(f.IsValid(ApprenticeshipEmployerType.Levy)); + } + + [Test] + public void Handle_WhenHandlingCommand_AndAccountNotFound_ThenShouldnotUpdateTheLevyStatus() + { + var f = new UpdateLevyStatusToLevyCommandHandlerTestsFixture(); + f.SetAccount(); + f.Command.AccountId = 2; + f.Handle(); + + Assert.IsTrue(f.IsValid(ApprenticeshipEmployerType.NonLevy)); + } + } + + public class UpdateLevyStatusToLevyCommandHandlerTestsFixture + { + public IFixture AutoFixture { get; set; } + public UpdateLevyStatusToLevyCommand Command { get; set; } + public Mock Db { get; set; } + public IRequestHandler Handler { get; set; } + public long AccountId { get; set; } + + public UpdateLevyStatusToLevyCommandHandlerTestsFixture() + { + AutoFixture = new Fixture(); + AccountId = 1; + Command = new UpdateLevyStatusToLevyCommand { AccountId = AccountId }; + Db = new Mock(new DbContextOptionsBuilder().UseInMemoryDatabase(Guid.NewGuid().ToString()).Options) { CallBase = true }; + Handler = new UpdateLevyStatusToLevyCommandHandler(new Lazy(() => Db.Object), Mock.Of>()); + + AutoFixture.Behaviors.Add(new OmitOnRecursionBehavior()); + } + + public Task Handle() + { + return Handler.Handle(Command, CancellationToken.None); + } + + public UpdateLevyStatusToLevyCommandHandlerTestsFixture SetAccount() + { + var account = new Account(AccountId, "", "", "", DateTime.UtcNow); + + Db.Object.Accounts.Add(account); + Db.Object.SaveChanges(); + + return this; + } + + public bool IsValid(ApprenticeshipEmployerType levyStatus) + { + return levyStatus == Db.Object.Accounts.First().LevyStatus; + } + } +} \ No newline at end of file diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Queries/GetAccountLegalEntity/GetAccountLegalEntityHandlerTests.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Queries/GetAccountLegalEntity/GetAccountLegalEntityHandlerTests.cs index 6e3adf30e1..0669bf7b18 100644 --- a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Queries/GetAccountLegalEntity/GetAccountLegalEntityHandlerTests.cs +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Queries/GetAccountLegalEntity/GetAccountLegalEntityHandlerTests.cs @@ -15,31 +15,30 @@ using SFA.DAS.CommitmentsV2.Application.Queries.GetAccountLegalEntity; using SFA.DAS.CommitmentsV2.Data; using SFA.DAS.CommitmentsV2.Models; +using SFA.DAS.CommitmentsV2.Types; namespace SFA.DAS.CommitmentsV2.UnitTests.Application.Queries.GetAccountLegalEntity { [TestFixture] public class GetAccountLegalEntityHandlerTests { - [Test] - public async Task Handle_WithSpecifiedId_ShouldSetIsValidCorrectly() + [TestCase(123,456,987, ApprenticeshipEmployerType.Levy)] + [TestCase(1234, 4567, 9870, ApprenticeshipEmployerType.NonLevy)] + public async Task Handle_WithSpecifiedId_ShouldSetIsValidCorrectly(long accountId, long accountLegalEntityId, long maLegalEntityId, ApprenticeshipEmployerType levyStatus) { - const long accountId = 123; - const long accountLegalEntityId = 456; - const long maLegalEntityId = 987; - // arrange var fixtures = new GetEmployerHandlerTestFixtures() - .AddAccountWithLegalEntities(accountId, "Account123", accountLegalEntityId, maLegalEntityId, "LegalEntity456"); + .AddAccountWithLegalEntities(accountId, "Account123", accountLegalEntityId, maLegalEntityId, "LegalEntity456", levyStatus); // act var response = await fixtures.GetResponse(new GetAccountLegalEntityQuery {AccountLegalEntityId = accountLegalEntityId }); // Assert Assert.IsNotNull(response); - Assert.AreEqual(response.AccountId, accountId); - Assert.AreEqual(response.MaLegalEntityId, maLegalEntityId); - Assert.AreEqual(response.AccountName, "Account123"); + Assert.AreEqual(accountId, response.AccountId); + Assert.AreEqual(maLegalEntityId, response.MaLegalEntityId); + Assert.AreEqual("Account123", response.AccountName); + Assert.AreEqual(levyStatus, response.LevyStatus); } } @@ -62,9 +61,9 @@ public GetEmployerHandlerTestFixtures() public List SeedAccounts { get; } public GetEmployerHandlerTestFixtures AddAccountWithLegalEntities(long accountId, string accountName, - long accountLegalEntityId, long maLegalEntityId, string name) + long accountLegalEntityId, long maLegalEntityId, string name, ApprenticeshipEmployerType levyStatus) { - var account = new Account(accountId, "PRI123", "PUB123", accountName, DateTime.Now); + var account = new Account(accountId, "PRI123", "PUB123", accountName, DateTime.Now) { LevyStatus = levyStatus }; account.AddAccountLegalEntity(accountLegalEntityId, maLegalEntityId, "ABC456", "PUB456", name, OrganisationType.Charities, "My address", DateTime.Now); diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Queries/GetAccountSummary/GetAccountSummaryHandlerTests.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Queries/GetAccountSummary/GetAccountSummaryHandlerTests.cs index 6d3f2a01b5..142699bffb 100644 --- a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Queries/GetAccountSummary/GetAccountSummaryHandlerTests.cs +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Queries/GetAccountSummary/GetAccountSummaryHandlerTests.cs @@ -2,15 +2,13 @@ using System.Collections.Generic; using System.Data.Common; using System.Data.SQLite; +using System.Linq; using System.Threading; using System.Threading.Tasks; using AutoFixture; -using FluentValidation; -using MediatR; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Console; -using Moq; using NUnit.Framework; using SFA.DAS.CommitmentsV2.Application.Queries.GetAccountSummary; using SFA.DAS.CommitmentsV2.Data; @@ -22,37 +20,26 @@ namespace SFA.DAS.CommitmentsV2.UnitTests.Application.Queries.GetAccountSummary [TestFixture] public class GetAccountSummaryHandlerTests { - [TestCase(0, false)] - [TestCase(1, true)] - [TestCase(10, true)] - public async Task Handle_Should_Return_Expected_HasCohorts_Value(int cohorts, bool expectedHasCohorts) + [Test] + public async Task Handle_Should_Return_LevyStatus_NonLevy() { var fixture = new GetAccountSummaryHandlerTestsFixture(); - fixture - .AddCohorts(cohorts) - .AddApprentices(10) - .AddNoise(); + fixture.AddAccount(); + var response = await fixture.GetResponse(); - Assert.AreEqual(expectedHasCohorts, response.HasCohorts, $"Number of Cohorts = {cohorts}"); + Assert.AreEqual(ApprenticeshipEmployerType.NonLevy, response.LevyStatus); } - [TestCase(0, false)] - [TestCase(1, true)] - [TestCase(10, true)] - public async Task Handle_Should_Return_Expected_HasApprentices_Value(int apprentices, - bool expectedHasApprentices) + public async Task Handle_Should_Return_LevyStatus_Levy() { var fixture = new GetAccountSummaryHandlerTestsFixture(); - fixture - .AddCohorts(10) - .AddApprentices(apprentices) - .AddNoise(); + fixture.AddAccount().SetEmployerLevyStatusToLevy(); var response = await fixture.GetResponse(); - Assert.AreEqual(expectedHasApprentices, response.HasApprenticeships); + Assert.AreEqual(ApprenticeshipEmployerType.Levy, response.LevyStatus); } } @@ -61,77 +48,20 @@ public class GetAccountSummaryHandlerTestsFixture public GetAccountSummaryHandlerTestsFixture() { var autoFixture = new Fixture(); - - HandlerMock = new Mock>(); - ValidatorMock = new Mock>(); - - SeedApprenticeships = new List(); - SeedCohorts = new List(); + SeedAccounts = new List(); EmployerAccountId = autoFixture.Create(); } - public Mock> HandlerMock { get; set; } - - public Mock> ValidatorMock { get; set; } public long EmployerAccountId { get; } - public List SeedCohorts { get; set; } - public List SeedApprenticeships { get; set; } + public List SeedAccounts { get; set; } - public GetAccountSummaryHandlerTestsFixture AddCohorts(int numberOfCohorts) + public GetAccountSummaryHandlerTestsFixture AddAccount() { - AddCohortsForEmployerAccount(EmployerAccountId, numberOfCohorts); + SeedAccounts.Add(new Account(EmployerAccountId, "XYZ", "ZZZ", "Account1", DateTime.Now)); return this; - } - - private void AddCohortsForEmployerAccount(long employerAccountId, int numberOfCohorts) - { - for (var i = 0; i < numberOfCohorts; i++) - { - var cohort = new Cohort - { - EmployerAccountId = employerAccountId, - EditStatus = EditStatus.EmployerOnly, - Originator = Originator.Employer - }; - SeedCohorts.Add(cohort); - } - } - - public GetAccountSummaryHandlerTestsFixture AddApprentices(int numberOfApprentices) - { - AddApprenticesForEmployerAccount(EmployerAccountId, numberOfApprentices); - return this; - } - - private void AddApprenticesForEmployerAccount(long employerAccountId, int numberOfApprentices) - { - for (var i = 0; i < numberOfApprentices; i++) - { - var approvedCohort = new Cohort - { - EmployerAccountId = employerAccountId, - EditStatus = EditStatus.Both, - Originator = Originator.Employer - }; - - var apprenticeship = new Apprenticeship - { - Cohort = approvedCohort - }; - - SeedCohorts.Add(approvedCohort); - SeedApprenticeships.Add(apprenticeship); - } - } - - public GetAccountSummaryHandlerTestsFixture AddNoise() - { - AddCohortsForEmployerAccount(EmployerAccountId + 1, 10); - AddApprenticesForEmployerAccount(EmployerAccountId + 1, 10); - return this; } public Task GetResponse() @@ -167,8 +97,7 @@ public Task RunWithDbContext(Func> a private void SeedData(ProviderCommitmentsDbContext dbContext) { - dbContext.Cohorts.AddRange(SeedCohorts); - dbContext.Apprenticeships.AddRange(SeedApprenticeships); + dbContext.Accounts.AddRange(SeedAccounts); dbContext.SaveChanges(true); } @@ -188,6 +117,12 @@ public Task RunWithConnection(Func> action) } } + internal void SetEmployerLevyStatusToLevy() + { + var account = SeedAccounts.First(x => x.Id == EmployerAccountId); + account.LevyStatus = ApprenticeshipEmployerType.Levy; + } + public static readonly LoggerFactory MyLoggerFactory = new LoggerFactory(new[] { diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Queries/GetCohortSummary/GetCohortSummaryQueryHandlerTests.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Queries/GetCohortSummary/GetCohortSummaryQueryHandlerTests.cs index 2ab8d6ff6a..62229dd0ec 100644 --- a/src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Queries/GetCohortSummary/GetCohortSummaryQueryHandlerTests.cs +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2.UnitTests/Application/Queries/GetCohortSummary/GetCohortSummaryQueryHandlerTests.cs @@ -33,6 +33,7 @@ public class GetCohortSummaryQueryHandlerTests public bool HasTransferSender = true; public bool CohortIsDeleted; public Party Approvals; + public ApprenticeshipEmployerType LevyStatus = ApprenticeshipEmployerType.NonLevy; [Test] public async Task Handle_WithSpecifiedId_ShouldReturnValue() @@ -173,11 +174,19 @@ public async Task Handle_DeletedCohort_ShouldReturnNull() await CheckQueryResponse(Assert.IsNull); } + [TestCase(ApprenticeshipEmployerType.Levy)] + [TestCase(ApprenticeshipEmployerType.NonLevy)] + public async Task Handle_WithSpecifiedApprovals_ShouldReturnExpectedLevyStatus(ApprenticeshipEmployerType levyStatus) + { + LevyStatus = levyStatus; + await CheckQueryResponse(response => Assert.AreEqual(LevyStatus, response.LevyStatus, "Did not return expected LevyStatus")); + } + private async Task CheckQueryResponse(Action assert, DraftApprenticeshipDetails apprenticeshipDetails = null) { var autoFixture = new Fixture(); - var account = new Account(autoFixture.Create(), "", "", "", DateTime.UtcNow); + var account = new Account(autoFixture.Create(), "", "", "", DateTime.UtcNow) { LevyStatus = LevyStatus }; AccountLegalEntity = new AccountLegalEntity(account, 1, 1, "", "", autoFixture.Create(), OrganisationType.Charities, "", DateTime.UtcNow); Provider = new Provider{Name =autoFixture.Create()}; diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Commands/UpdateLevyStatusToLevy/UpdateLevyStatusToLevyCommand.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Commands/UpdateLevyStatusToLevy/UpdateLevyStatusToLevyCommand.cs new file mode 100644 index 0000000000..50c2e5aa5b --- /dev/null +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Commands/UpdateLevyStatusToLevy/UpdateLevyStatusToLevyCommand.cs @@ -0,0 +1,9 @@ +using MediatR; + +namespace SFA.DAS.CommitmentsV2.Application.Commands.UpdateLevyStatusToLevy +{ + public class UpdateLevyStatusToLevyCommand : IRequest + { + public long AccountId { get; set; } + } +} diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Commands/UpdateLevyStatusToLevy/UpdateLevyStatusToLevyCommandHandler.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Commands/UpdateLevyStatusToLevy/UpdateLevyStatusToLevyCommandHandler.cs new file mode 100644 index 0000000000..bec50e3bb0 --- /dev/null +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Commands/UpdateLevyStatusToLevy/UpdateLevyStatusToLevyCommandHandler.cs @@ -0,0 +1,35 @@ +using MediatR; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; +using SFA.DAS.CommitmentsV2.Data; +using SFA.DAS.CommitmentsV2.Types; +using System; +using System.Threading; +using System.Threading.Tasks; + +namespace SFA.DAS.CommitmentsV2.Application.Commands.UpdateLevyStatusToLevy +{ + public class UpdateLevyStatusToLevyCommandHandler : AsyncRequestHandler + { + private readonly Lazy _db; + private readonly ILogger _logger; + + public UpdateLevyStatusToLevyCommandHandler(Lazy db, ILogger logger) + { + _db = db; + _logger = logger; + } + + protected override async Task Handle(UpdateLevyStatusToLevyCommand request, CancellationToken cancellationToken) + { + var entity = await _db.Value.Accounts.FirstOrDefaultAsync(x => x.Id == request.AccountId, cancellationToken); + + if (entity != null) + { + entity.UpdateLevyStatus(ApprenticeshipEmployerType.Levy); + await _db.Value.SaveChangesAsync(); + _logger.LogInformation($"LevyStatus set to Levy for AccountId : {request.AccountId}"); + } + } + } +} diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetAccountLegalEntity/GetAccountLegalEntityQueryHandler.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetAccountLegalEntity/GetAccountLegalEntityQueryHandler.cs index 8637ff56af..4b9fa2c6b6 100644 --- a/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetAccountLegalEntity/GetAccountLegalEntityQueryHandler.cs +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetAccountLegalEntity/GetAccountLegalEntityQueryHandler.cs @@ -26,7 +26,8 @@ public Task Handle(GetAccountLegalEntityQuery AccountId = ale.AccountId, MaLegalEntityId = ale.MaLegalEntityId, AccountName = ale.Account.Name, - LegalEntityName = ale.Name + LegalEntityName = ale.Name, + LevyStatus = ale.Account.LevyStatus }, cancellationToken); } diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetAccountLegalEntity/GetAccountLegalEntityQueryResult.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetAccountLegalEntity/GetAccountLegalEntityQueryResult.cs index 8565818ae8..b0f4261554 100644 --- a/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetAccountLegalEntity/GetAccountLegalEntityQueryResult.cs +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetAccountLegalEntity/GetAccountLegalEntityQueryResult.cs @@ -1,4 +1,6 @@ -namespace SFA.DAS.CommitmentsV2.Application.Queries.GetAccountLegalEntity +using SFA.DAS.CommitmentsV2.Types; + +namespace SFA.DAS.CommitmentsV2.Application.Queries.GetAccountLegalEntity { public class GetAccountLegalEntityQueryResult { @@ -6,5 +8,6 @@ public class GetAccountLegalEntityQueryResult public long MaLegalEntityId { get; set; } public string AccountName { get; set; } public string LegalEntityName { get; set; } + public ApprenticeshipEmployerType LevyStatus { get; set; } } } diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetAccountSummary/GetAccountSummaryQueryHandler.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetAccountSummary/GetAccountSummaryQueryHandler.cs index 0d8fccb544..1b02ef37e9 100644 --- a/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetAccountSummary/GetAccountSummaryQueryHandler.cs +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetAccountSummary/GetAccountSummaryQueryHandler.cs @@ -4,8 +4,6 @@ using MediatR; using Microsoft.EntityFrameworkCore; using SFA.DAS.CommitmentsV2.Data; -using SFA.DAS.CommitmentsV2.Data.Expressions; -using SFA.DAS.CommitmentsV2.Models; namespace SFA.DAS.CommitmentsV2.Application.Queries.GetAccountSummary { @@ -21,19 +19,13 @@ public GetAccountSummaryQueryHandler(Lazy dbContex public async Task Handle(GetAccountSummaryQuery query, CancellationToken cancellationToken) { - var accountQuery = PredicateBuilder.True().And(c => c.EmployerAccountId == query.AccountId); - - var hasCohorts = await _dbContext.Value.Cohorts - .AnyAsync(accountQuery.And(CohortQueries.IsNotFullyApproved()), cancellationToken: cancellationToken); - - var hasApprenticeships = await _dbContext.Value.Apprenticeships - .AnyAsync(a => a.Cohort.EmployerAccountId == query.AccountId, cancellationToken: cancellationToken); + var account = await _dbContext.Value.Accounts + .SingleAsync(a => a.Id == query.AccountId, cancellationToken: cancellationToken); return new GetAccountSummaryQueryResult { AccountId = query.AccountId, - HasCohorts = hasCohorts, - HasApprenticeships = hasApprenticeships + LevyStatus = account.LevyStatus }; } } diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetAccountSummary/GetAccountSummaryQueryResult.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetAccountSummary/GetAccountSummaryQueryResult.cs index 0bc1e446c3..67bf4a1230 100644 --- a/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetAccountSummary/GetAccountSummaryQueryResult.cs +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetAccountSummary/GetAccountSummaryQueryResult.cs @@ -1,9 +1,10 @@ -namespace SFA.DAS.CommitmentsV2.Application.Queries.GetAccountSummary +using SFA.DAS.CommitmentsV2.Types; + +namespace SFA.DAS.CommitmentsV2.Application.Queries.GetAccountSummary { public class GetAccountSummaryQueryResult { public long AccountId { get; set; } - public bool HasCohorts { get; set; } - public bool HasApprenticeships { get; set; } + public ApprenticeshipEmployerType LevyStatus { get; set; } } } diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetCohortSummary/GetCohortSummaryQueryHandler.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetCohortSummary/GetCohortSummaryQueryHandler.cs index 528c6b8bd8..bc77c26d41 100644 --- a/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetCohortSummary/GetCohortSummaryQueryHandler.cs +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetCohortSummary/GetCohortSummaryQueryHandler.cs @@ -47,7 +47,8 @@ from c in _db.Value.Cohorts Approvals = c.Approvals, IsApprovedByEmployer = c.Approvals.HasFlag(Party.Employer), //redundant IsApprovedByProvider = c.Approvals.HasFlag(Party.Provider), //redundant - IsCompleteForEmployer = c.Apprenticeships.Any() && !c.Apprenticeships.Any(a => a.FirstName == null || a.LastName == null || a.DateOfBirth == null || a.CourseName == null || a.StartDate == null || a.EndDate == null || a.Cost == null) + IsCompleteForEmployer = c.Apprenticeships.Any() && !c.Apprenticeships.Any(a => a.FirstName == null || a.LastName == null || a.DateOfBirth == null || a.CourseName == null || a.StartDate == null || a.EndDate == null || a.Cost == null), + LevyStatus = c.AccountLegalEntity.Account.LevyStatus }) .SingleOrDefaultAsync(cancellationToken); diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetCohortSummary/GetCohortSummaryQueryResult.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetCohortSummary/GetCohortSummaryQueryResult.cs index 4aba1d23ca..3811b7bd31 100644 --- a/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetCohortSummary/GetCohortSummaryQueryResult.cs +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Application/Queries/GetCohortSummary/GetCohortSummaryQueryResult.cs @@ -32,5 +32,6 @@ public class GetCohortSummaryQueryResult public bool IsApprovedByEmployer { get; set; } public bool IsCompleteForEmployer { get; set; } public Party Approvals { get; set; } + public ApprenticeshipEmployerType LevyStatus { get; set; } } } \ No newline at end of file diff --git a/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Models/Account.cs b/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Models/Account.cs index ad8533e90f..f3a1a6f449 100644 --- a/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Models/Account.cs +++ b/src/CommitmentsV2/SFA.DAS.CommitmentsV2/Models/Account.cs @@ -1,4 +1,5 @@ -using System; +using SFA.DAS.CommitmentsV2.Types; +using System; using System.Collections.Generic; using System.Linq; @@ -12,6 +13,7 @@ public class Account public string Name { get; private set; } public DateTime Created { get; private set; } public DateTime? Updated { get; private set; } + public ApprenticeshipEmployerType LevyStatus { get; set; } public virtual ICollection AccountLegalEntities => _accountLegalEntities; private readonly List _accountLegalEntities = new List(); @@ -54,6 +56,11 @@ public void UpdateName(string name, DateTime updated) } } + public void UpdateLevyStatus(ApprenticeshipEmployerType apprenticeshipEmployerType) + { + LevyStatus = apprenticeshipEmployerType; + } + public void RemoveAccountLegalEntity(AccountLegalEntity accountLegalEntity, DateTime removed) { diff --git a/src/SFA.DAS.Commitments.Database/AdhocScripts/Manual/CV-684-Update-Account-LevyStatus.sql b/src/SFA.DAS.Commitments.Database/AdhocScripts/Manual/CV-684-Update-Account-LevyStatus.sql new file mode 100644 index 0000000000..ecd8449ab3 --- /dev/null +++ b/src/SFA.DAS.Commitments.Database/AdhocScripts/Manual/CV-684-Update-Account-LevyStatus.sql @@ -0,0 +1,11 @@ +/* +CV-684 - Initial set of Account levy status +Usage instructions: +Execute the below againsts the Accounts db. +Copy-paste the resulting output (a set of update statements), and execute those against the Commitments database. +*/ + +select +'update [Accounts] set [LevyStatus]=0 where [Id]=' + convert(varchar,Id) +from [employer_account].[Account] +where ApprenticeshipEmployerType = 0 diff --git a/src/SFA.DAS.Commitments.Database/PostDeployment/PostDeploymentScript.sql b/src/SFA.DAS.Commitments.Database/PostDeployment/PostDeploymentScript.sql index b8ea2ba415..cff2aeec6a 100644 --- a/src/SFA.DAS.Commitments.Database/PostDeployment/PostDeploymentScript.sql +++ b/src/SFA.DAS.Commitments.Database/PostDeployment/PostDeploymentScript.sql @@ -13,409 +13,6 @@ Post-Deployment Script Template EXEC sp_refreshview [dbo.CommitmentSummaryWithMessages] - ---CV-564 - Data fix missing legal entity codes -update [AccountLegalEntities] set [LegalEntityId]='cbbbe239-112b-4d63-a41d-7ceca6f577f5' where PublicHashedId ='X6N47Z' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='c0374f34-78d4-4f45-90c5-5aa0293a49f4' where PublicHashedId ='52V6WJ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='b849bb28-8889-4d24-9813-ff37bd5bd529' where PublicHashedId ='X3V628' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='f0c767a3-b99a-4e03-b538-db34539c750d' where PublicHashedId ='5JY8KB' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='5cc87817-7f32-4fd9-be36-fbc83fb4853d' where PublicHashedId ='5WJ8RG' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='9e1d8435-f2ad-4105-9693-f8d298188453' where PublicHashedId ='56N42K' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='8ac39d11-c2f3-4e99-9c95-f4f5ad273b3c' where PublicHashedId ='5PY8ED' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='5300580c-5430-4b8e-983a-f9b3aaa65591' where PublicHashedId ='5BYZP9' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='4f04cc83-90ab-44c8-a35c-4791742eb525' where PublicHashedId ='59JEE9' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='5c0cc2c6-9e63-4c19-be6b-23b329be8250' where PublicHashedId ='52V66R' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='73131f27-1bbf-4979-b204-6607f18c9580' where PublicHashedId ='5WJ89G' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='32f692bf-56a3-43b0-acfe-bf6569d474d2' where PublicHashedId ='X2V6RR' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='00cfdb72-bd91-49c0-befa-3fa7d0522e1d' where PublicHashedId ='XEJ7EY' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='96ab8dab-02ee-47ae-bf7a-4b4e26d1220d' where PublicHashedId ='5V28Y3' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='798e4b28-feea-4c68-9ba7-a7dbc3026326' where PublicHashedId ='X7NBY6' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='7fbf5ea8-0070-4557-8f16-889fc0b56302' where PublicHashedId ='XGD6MR' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='7dbd7405-9354-4a8d-957e-170f053b53d2' where PublicHashedId ='XGD646' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='150e8600-0f5a-480d-994f-8377c280f07a' where PublicHashedId ='56N43W' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='5b359c3e-dfe3-4f95-8f48-db5788e0be6f' where PublicHashedId ='XJY844' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='ecd8143c-54a5-46e4-b13f-584a572327ba' where PublicHashedId ='59JE7Z' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='f1419430-7f9b-49a0-be14-6a89b40d6220' where PublicHashedId ='53V6M3' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='9758ac42-0ea4-4a11-b538-91ab7c12a7ba' where PublicHashedId ='5ZYK3V' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='6348875f-3817-4a78-8020-c83c8de10e72' where PublicHashedId ='X7NB2J' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='18e192e1-d87f-4085-8394-73741b3c64f8' where PublicHashedId ='54Y6MK' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='7f0369ba-6b68-4375-81f6-03383af2b501' where PublicHashedId ='5R78PD' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='b36fddbf-1829-44bb-8014-c45e40599427' where PublicHashedId ='XKJ8ZJ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='01ee8122-3c3e-4c3a-96e6-e98f517364e3' where PublicHashedId ='XR78GD' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='bcf2b0df-5233-400d-baa1-e687aece12a2' where PublicHashedId ='5KJ84J' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='b768544e-ef9c-4565-8cb4-f164642311e2' where PublicHashedId ='5JY8M4' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='7c5cee55-a677-48d1-9deb-d1d873168253' where PublicHashedId ='XKJ8RJ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='beca3bf7-9fc2-4ee5-af1c-c01c1d6ffd9d' where PublicHashedId ='XZYK4R' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='03a72026-6a5a-4abb-81be-410bf2e29589' where PublicHashedId ='5PYBKZ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='a6eb64e3-517c-445d-9365-c0631445ee2b' where PublicHashedId ='X4Y3ZJ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='4268b076-9a5d-4bb0-8cb7-bca10498aac9' where PublicHashedId ='52VR2V' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='dfd76635-26ec-413f-a9d7-0678319f8ee5' where PublicHashedId ='XV2YG6' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='e7c20012-4c1f-48ab-aec9-43e2f9dc2ae5' where PublicHashedId ='5Y9RJ8' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='579b718c-9a35-454d-a8bd-99acbde94256' where PublicHashedId ='5R7ERW' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='f6fd8a48-6aa5-4d10-972d-9d0a2317535c' where PublicHashedId ='XKJNW4' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='6705a83f-70d7-49c1-82d0-1b1ca3cbebd6' where PublicHashedId ='57NGDR' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='c4120778-28e8-403d-b747-fcc8c7a8dde3' where PublicHashedId ='XM3WPP' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='f41c0eb3-1d9d-4b3a-afa6-56cfb2af38d7' where PublicHashedId ='XEJE86' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='3573ef3e-b780-4089-95c9-1000beb24bc6' where PublicHashedId ='XR7E2W' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='6825fea5-a744-488f-959b-9534ba443431' where PublicHashedId ='XWJ9EZ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='17f0cfab-a758-4a7b-9262-408bd7852ba3' where PublicHashedId ='5ZYWVR' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='46ab1540-e308-4cad-b967-d2eb004c685b' where PublicHashedId ='52VRVV' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='34aa9b8e-fa9a-4d82-abb2-176a342c3c84' where PublicHashedId ='XPYBYZ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='afbdc5a7-0d7a-4331-aff5-b475da58dbbb' where PublicHashedId ='5EJEJ6' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='452b0a69-7689-4a2f-b553-50c1f189f6da' where PublicHashedId ='5DNGNK' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='67e2c12a-c027-4843-8a72-2d98a9f9a77f' where PublicHashedId ='5Y9R98' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='bcfe6a46-e279-4d74-bcc2-1e4e9f03947f' where PublicHashedId ='5EJENJ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='3656c990-9c69-4906-a901-b9296929aae2' where PublicHashedId ='5DNG8B' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='b4b0cdc6-2f0b-4470-b351-8bd47de4e7c3' where PublicHashedId ='5Y9R6P' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='f03028c9-92f8-4b02-9af9-4ef9027126a5' where PublicHashedId ='XNW397' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='6b488dc0-dcb0-4bd3-b7ed-5f81d9f08496' where PublicHashedId ='XDNGPB' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='a0ef99e0-a8d2-4c5b-a88f-f765d9c33061' where PublicHashedId ='5NW327' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='3a8fede9-fe06-468e-b712-92969b80d9fd' where PublicHashedId ='XR7E63' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='0dfa81f6-4411-4d67-97d4-3edf3d0e448c' where PublicHashedId ='53VWD6' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='2fd39393-d010-45f1-9f32-6f856cee404d' where PublicHashedId ='X9JDYY' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='7fa93e66-a39e-4747-89e5-953412f92847' where PublicHashedId ='X3VWZD' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='33564eee-17e0-4d78-8db1-e8ddd1409e2d' where PublicHashedId ='59JDPJ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='1e63e63c-1a67-4f26-b372-f3030b058405' where PublicHashedId ='XWJ927' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='20621aba-393d-4eb6-9f2e-d7ff690c2809' where PublicHashedId ='5JYPKG' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='5cf4c8b3-048c-463d-9ece-1b3cdb8b9ae4' where PublicHashedId ='X9JDGJ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='3e0ce8ae-f33a-4669-9c60-e476849d388f' where PublicHashedId ='X2VR8G' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='28c2aa56-7396-4ccc-b2d2-64a55cb6577d' where PublicHashedId ='5PYBEN' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='8c066dc9-a23b-4ac1-a45b-c66a8d8ef5bb' where PublicHashedId ='X4Y38R' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='2589a862-63fa-4910-92bb-a72d2f952b47' where PublicHashedId ='5BY4PV' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='b4d50f6f-0f05-4b69-a372-2829ce619b11' where PublicHashedId ='XDNG76' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='edce86a8-664a-4e0b-b85a-075810bd5693' where PublicHashedId ='XR7E8K' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='db691e1a-fac6-4e00-bc0f-56275d163e38' where PublicHashedId ='X6NB42' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='0cd2d58b-e98b-4f39-9986-53c39088cb1b' where PublicHashedId ='54Y36R' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='691612f2-4809-482d-b3b6-217871f6764e' where PublicHashedId ='XGDV6N' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='793ad008-e04d-482c-a4bd-552acc080628' where PublicHashedId ='5R7EEK' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='b7c2de16-4d64-403f-ad86-196dfb6b1548' where PublicHashedId ='XZYW6Y' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='8696f062-2def-492a-9f30-46afdea82e8d' where PublicHashedId ='XR7EWB' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='e08ade80-88ba-4dc8-b0f9-8778c4633647' where PublicHashedId ='X7NGK8' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='d99ef746-4c9d-43c2-b0c9-f8f892f1a155' where PublicHashedId ='XGDV4V' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='b6b3af19-adde-414e-a437-0537dbbdf115' where PublicHashedId ='XZYWPY' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='3de2d6e1-3ea7-4e28-be7e-61c4ccf9a9dd' where PublicHashedId ='X8REK8' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='99ee1c79-e39f-4d62-b57c-971df5325401' where PublicHashedId ='XDNGR2' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='4f9d8d5f-7d48-4cee-a652-f4329838e348' where PublicHashedId ='XKJNZR' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='1f2ea815-6f19-4033-87f6-c632ede47832' where PublicHashedId ='56NB8G' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='bf13fc46-84f1-409c-9dbd-42c7b2c20766' where PublicHashedId ='XJYPM8' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='4c533ae0-59f8-42ce-a4ac-94d3c2969927' where PublicHashedId ='XWJ93N' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='a451bf54-a418-4eb1-91a8-77885118ff01' where PublicHashedId ='XM3BD3' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='1d86b9b9-9526-4d6c-b5b0-e40a6acdeb6e' where PublicHashedId ='5PYDK9' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='4007d166-2645-42b7-bf4a-0abeaa7313b2' where PublicHashedId ='X4YPZN' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='5251dd64-98ae-492c-acf1-e8e2422af54a' where PublicHashedId ='5BYMJ8' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='e00d6695-430b-484d-b583-ec83a621299e' where PublicHashedId ='5V2RVN' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='8ef3cda8-f584-4c30-965a-4d4e2e2aee7b' where PublicHashedId ='XJY2B8' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='6802cf5f-3c5b-4f61-821f-5dafc7d4f988' where PublicHashedId ='XY9ZVR' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='014a951e-fb11-4019-8196-b9b44e269853' where PublicHashedId ='59JNRN' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='aded1d60-895a-4301-912e-271735bd90cb' where PublicHashedId ='53VEPY' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='03c2479f-6e5b-4106-9d32-bb40805dbc50' where PublicHashedId ='5M3BR3' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='2d3e4ebd-6747-497f-a934-6ecad4a3d373' where PublicHashedId ='52VG2Y' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='757883fc-4582-403b-9cbb-e35d71a45742' where PublicHashedId ='XPYDR9' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='53e690a7-0750-4f2f-92f8-12b6d1925916' where PublicHashedId ='54YPEN' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='515afdf9-2992-4341-abec-77840d1af97e' where PublicHashedId ='XBYMG8' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='3976e6bf-e423-483c-b185-b38d96aaef00' where PublicHashedId ='XGDMJW' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='349a0ae8-246b-469a-8906-90d88868b22f' where PublicHashedId ='X3VE3Y' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='1200b729-13ff-4813-b9ba-5536bfd85f81' where PublicHashedId ='XDNMNE' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='3bb3e2dd-0498-46e5-afa7-b25431cda2ca' where PublicHashedId ='59JNJ8' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='34e9a1f4-61d4-4c96-839a-ec7a425ba17c' where PublicHashedId ='5EJPGG' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='5425ad3a-0340-493d-b371-db9c0c29c34a' where PublicHashedId ='5R7JZV' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='6ac43346-85cf-4e29-9efe-3e89833d185f' where PublicHashedId ='57NYJZ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='08bb411c-2786-4ca1-90e6-62b8eac6120c' where PublicHashedId ='X8R9VP' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='1fee07c1-e4a4-46f9-9b2e-d9d2c8f30b3e' where PublicHashedId ='X2VGY4' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='556b0738-c481-4072-87c7-e76a78596c68' where PublicHashedId ='52VG74' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='f844d45c-0888-412b-ae52-0b76f8d3abf8' where PublicHashedId ='54YPNE' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='2e1c3e28-604c-4a78-b1ac-cfb33312d977' where PublicHashedId ='XBYMND' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='caeb6620-dde8-41e3-869f-4926edd0d514' where PublicHashedId ='5DNMPD' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='fec44479-c4b8-4efa-8843-2fc64c13ee5c' where PublicHashedId ='5R7J6N' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='fcda2fae-be94-456d-8326-d51f8dc727e6' where PublicHashedId ='X3VEDB' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='d9cfc2a0-d491-4673-b625-9b1695cf9725' where PublicHashedId ='5V2RDG' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='abdb8f5d-4eeb-4b3e-8022-313519d6da80' where PublicHashedId ='5NWGMN' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='35936c80-1839-47f6-9f14-39e779f20f33' where PublicHashedId ='58R9JE' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='e469ad56-35b1-41e1-918d-62aee68f4b3e' where PublicHashedId ='5Y9Z49' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='90b64931-87ac-4d71-9a2a-11257d0674c3' where PublicHashedId ='XNWG7N' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='a3f5155d-64b1-43bb-8002-ce81f15ec10a' where PublicHashedId ='XY9Z39' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='89106381-b7c8-4580-9c2a-16125b3faa3f' where PublicHashedId ='XWJW26' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='4804996a-4ade-4cec-9aa0-6efb5627bd06' where PublicHashedId ='52VGKN' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='3afda52f-61aa-475d-b92f-7505d679d353' where PublicHashedId ='5EJP32' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='9740ec00-c575-4f8e-8095-3b98a2240fb0' where PublicHashedId ='5PYD8E' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='25b6140e-ceda-4150-9837-819f5c53bd81' where PublicHashedId ='5GDM6M' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='ac62ee2e-048a-4049-ab2a-1a3810f49a5d' where PublicHashedId ='XJY283' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='8b6cfe6f-3fd3-407c-99b1-cf611119b37b' where PublicHashedId ='XY9Z8K' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='167ec22d-855d-4175-b100-a8df35928ace' where PublicHashedId ='5KJMNP' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='56d81d51-69b6-4861-b8cb-cb2f6b3f3d4c' where PublicHashedId ='XKJMMP' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='8029c22a-7c97-4fff-acfb-a06dead05909' where PublicHashedId ='57NYY9' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='760776fd-6dcb-444f-9c7c-b58cc0236a8d' where PublicHashedId ='56NJJ6' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='4a287309-2b5a-46a8-a755-b2d3c86518b8' where PublicHashedId ='X8R99J' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='69afdb5b-b984-4771-b3ba-beacbf17f462' where PublicHashedId ='53VERV' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='4c494d07-329e-4f07-a16e-2b99fff4a308' where PublicHashedId ='XBYM24' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='af2841ce-a8e9-4a66-a9f9-995332ccc354' where PublicHashedId ='5EJP22' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='f40fdeb9-d125-4729-b58b-110bd13b2bd8' where PublicHashedId ='XKJMBP' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='ba92bdff-3dd3-46a5-acff-3950bd3e3e27' where PublicHashedId ='XBYM9W' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='4e7f79ce-1028-4365-b726-4cf4e698cb31' where PublicHashedId ='X3VENK' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='07560c2d-3707-4f0a-80e8-da883518f3f2' where PublicHashedId ='XJY2ZP' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='b5b3011b-0624-4198-b5d2-b30c10f83e5e' where PublicHashedId ='5ZY634' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='490b0e83-5309-49b1-914b-a944c3b0c191' where PublicHashedId ='X6NJRY' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='67f2ba9c-bb95-4fa8-8ed6-317ca5579bed' where PublicHashedId ='5WJWYY' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='dccff7d7-23cf-424b-8e0d-64266fa713d4' where PublicHashedId ='X3VEYK' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='8435706f-55db-42db-9f6f-7b72b24d618d' where PublicHashedId ='XKJM4G' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='d631c456-a397-4e85-af7c-6a4bae15dd13' where PublicHashedId ='XY9ZKZ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='60d65867-7bf7-43af-aa83-c3cca658f8c2' where PublicHashedId ='5JY29P' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='b2e2b093-dd89-41bf-aebc-c293d8cac85c' where PublicHashedId ='5EJ2VD' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='fb16e093-78d0-4923-8b3a-289b96ee7ad0' where PublicHashedId ='5JYEB6' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='4d4a789e-f259-4fe4-8421-0e4ed14b6c3c' where PublicHashedId ='X9J2RP' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='f132ee74-a16b-48ff-aaa5-77d3a8e03646' where PublicHashedId ='5WJBP9' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='2d83cc97-1ef8-46f8-ba14-afe76e459c55' where PublicHashedId ='XKJDGB' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='6173c7c8-4841-4822-b9c6-fa5ee1326b5a' where PublicHashedId ='X2VN2B' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='21657570-9fc9-4608-bbb5-efccf60be907' where PublicHashedId ='XR7WR8' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='282377a3-7e1d-489e-bff9-9d689ebdea29' where PublicHashedId ='5ZYDMD' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='7295c5eb-6215-4f6a-8e26-bc37552d1fdd' where PublicHashedId ='X7NKD2' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='5f789e38-efdb-4938-b9a2-adee1cbc3135' where PublicHashedId ='58R2Y4' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='59fe5e84-bae1-49b8-9152-d00ae683aa40' where PublicHashedId ='X4YWY4' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='5fa4411a-984c-47ea-a8f8-a58dfe6e8634' where PublicHashedId ='5BY2YY' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='927c10f9-9d86-4462-8544-671f0dcdf92a' where PublicHashedId ='5GD4DK' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='19fe3cfc-e744-4539-a96c-66ef6bb9ac9f' where PublicHashedId ='XDN2N8' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='c8f62244-5d0e-4d79-81d4-b752182926d5' where PublicHashedId ='5V242K' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='51b08384-f3b2-4aa3-87cf-40801a52f58d' where PublicHashedId ='XJYEY6' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='6a394594-97b0-4047-8665-71d97d85c269' where PublicHashedId ='5EJ2DV' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='5a42f09a-fee6-4704-a1f0-872fdc197fde' where PublicHashedId ='5JYEDY' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='8607507f-0f04-492e-825c-edc58fb405bf' where PublicHashedId ='XZYD9Z' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='34946cae-3d5a-4a25-8f0f-77b5cc802e80' where PublicHashedId ='XR7WN6' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='fdd5800c-8f2b-4d7f-9c99-06a880c97742' where PublicHashedId ='5M3J9J' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='3cef2eac-48a9-4f53-9a88-7efebf8aa423' where PublicHashedId ='5WJB6V' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='c10e0331-4dbd-43dd-899b-90124d107158' where PublicHashedId ='5V24DZ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='a2e18557-7946-43b6-8a4b-118636a9cff0' where PublicHashedId ='52VNP9' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='230c6341-c8fa-46db-acfd-5cfcca0e8e0a' where PublicHashedId ='54YWG9' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='7e46feb8-c677-4896-92cd-13aaa57e35e7' where PublicHashedId ='XGD4WG' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='286a3f0f-3450-4f4c-816c-0652a12accaf' where PublicHashedId ='5DN2K9' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='6eef0340-620c-43e7-8ceb-6aa560abe80d' where PublicHashedId ='5WJBMV' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='00b612cc-c596-4020-821d-3ba3de131b3a' where PublicHashedId ='5EJ2KW' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='2f9a4523-e67b-49fc-9484-89cb76f990ee' where PublicHashedId ='XM3JNN' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='12606d62-dd64-43fa-b89d-9ff53f3ed38f' where PublicHashedId ='XGD434' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='6f306111-0257-4efd-b464-2da58cdef393' where PublicHashedId ='52VNR8' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='fa3b4bbc-e368-4a03-9e06-4b9acd54ee33' where PublicHashedId ='5DN2MZ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='886e0f99-b5a3-4420-9718-38e77ded500e' where PublicHashedId ='X9J2N7' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='83916285-28d7-4ddd-b7cb-95170a62cfb8' where PublicHashedId ='XNWYG4' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='3956b2b5-6bd8-4dce-b95e-4b38387c071f' where PublicHashedId ='5R7WJG' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='146f4cee-818d-4a2c-b873-5d65f8d8d21b' where PublicHashedId ='5WJBW3' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='e929af20-c4fd-4469-ae38-11bc45679ded' where PublicHashedId ='X3VREG' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='6cbad402-fda7-4ae2-8fd7-defeb25b2445' where PublicHashedId ='5KJDBW' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='374a8523-32ea-41b1-9e59-bf11220dcb80' where PublicHashedId ='X7NKZP' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='a891a6da-47d6-4d1f-b119-856a861cc93d' where PublicHashedId ='5EJ2W3' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='9d774de8-67b1-44c0-8ce0-1f78a680ee62' where PublicHashedId ='XV24PY' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='647e0951-7556-46fd-bdb6-4c5a075df306' where PublicHashedId ='X8R2MV' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='837be56f-cccb-4e87-8e1d-b347a31c7123' where PublicHashedId ='XDN2YZ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='648950db-4caa-42e1-a96c-a204360f0c4f' where PublicHashedId ='XR7WPG' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='1b2689d5-632d-490e-997c-0828a9e9d9bc' where PublicHashedId ='53VRMG' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='e3873b60-5a98-4b8b-9461-c0d075a7232d' where PublicHashedId ='5KJDZW' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='02dda30f-40e2-4289-b09b-238dc3d3158d' where PublicHashedId ='54YW9G' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='43f6a2fd-7fbc-457b-aada-e36a811b270a' where PublicHashedId ='57NKMP' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='b53be3ca-e58c-4a76-bcae-1b1dd2ab0cf8' where PublicHashedId ='54YW7Y' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='325f71b4-6cda-473b-ab50-828894c4b15d' where PublicHashedId ='XNWYE8' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='8ea13efa-7e95-4765-9d28-17c363e3d747' where PublicHashedId ='5R7WYE' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='09f8c00a-9ce5-443b-bc23-caa0889ed2fd' where PublicHashedId ='5WJB3W' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='e5376a57-16be-46cb-b8a6-ee41121d3317' where PublicHashedId ='XZYD7P' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='ec93f7cc-0887-4d6d-87d4-55db4cc28b8f' where PublicHashedId ='XM3JKD' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='4a4b509d-a636-48dc-af88-ba0ad6eeea28' where PublicHashedId ='5V243D' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='4ace5ef0-6a58-4e57-8ed1-1321e2e566c5' where PublicHashedId ='5ZYD4P' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='5791993a-4723-490e-9a8b-503b4bb26acd' where PublicHashedId ='X7NKRW' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='1420240d-1a38-4515-9605-a974f6458061' where PublicHashedId ='5DNRDP' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='4d0b9705-e0fd-4501-b300-ec9b53e79ffc' where PublicHashedId ='XV2PVD' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='7d2f1a3b-fa1e-4d31-b3af-c6a4ebfa3520' where PublicHashedId ='5JY4B7' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='50934e62-01b7-4906-936f-b68a0a593569' where PublicHashedId ='5Y97V3' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='a8f35c88-f77d-42c2-bdba-acec496aab0f' where PublicHashedId ='X3VNPR' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='bc6442f0-a63c-4dde-bcee-56d216675308' where PublicHashedId ='XZYPJP' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='1aaae2ea-633c-4965-a067-98db25a6e6e6' where PublicHashedId ='XKJBGK' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='0195bbf2-bb5f-4cbb-8262-587d1e7365b5' where PublicHashedId ='57NZEW' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='ed7fff9e-8c31-4ffb-aca0-da26baaa53dc' where PublicHashedId ='5PYJRW' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='ae4ba050-6923-4892-9780-c0502567a1d7' where PublicHashedId ='5GDZJB' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='2bfcc7bd-1e31-4b61-ada8-edb089789f29' where PublicHashedId ='XDNR9P' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='3f8b17d7-4cec-4abd-8eba-5501d70b8685' where PublicHashedId ='XR79RE' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='a5bdf096-259d-4831-9c53-2ef14ae71fa4' where PublicHashedId ='54YR4Y' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='46621bcd-df84-4ac6-b451-a0bf66bc78d9' where PublicHashedId ='56N3NJ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='14e3b813-119a-4815-a130-7823624a4d78' where PublicHashedId ='XJY4NN' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='8e0cc9b6-6c7e-46d2-87fa-fc260aae50bb' where PublicHashedId ='5KJB98' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='8c71cb9a-b5d7-4ef9-b61d-b24ddc38cda9' where PublicHashedId ='54YRN7' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='7efbcc57-25ea-40b8-9f8a-047d7abd4e9f' where PublicHashedId ='XBY9N3' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='22959d27-7c50-4bb0-9ce5-5fefe38cde4b' where PublicHashedId ='XGDZ8P' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='3d7f3eba-013a-41b4-bff3-b71a84f99128' where PublicHashedId ='5DNRPV' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='396adbc8-1836-45d9-bedb-ec334bb50495' where PublicHashedId ='5R7964' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='3c4fe694-616a-476e-99fc-03443955faa3' where PublicHashedId ='5DNRPJ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='6d2bcada-78b3-4e5d-9f2b-030c9fa076b9' where PublicHashedId ='X7NZ6V' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='46082b56-0afc-4121-b658-cf78855d6bce' where PublicHashedId ='5EJWK9' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='273e7fa9-0502-4cfc-a40b-76da6431f7df' where PublicHashedId ='XKJBY2' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='501a8ae5-02a3-4294-929d-8af931e99c9f' where PublicHashedId ='53VN8J' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='ad9b3114-e967-42c6-bbf9-710beca20982' where PublicHashedId ='5DNR7J' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='10616f1a-a57e-4f24-98cd-248bbb3742c3' where PublicHashedId ='XV2PNW' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='7559e48b-a9de-4ae7-a17f-6e7f6e9cde41' where PublicHashedId ='5Y978V' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='bfb6f05f-4598-4863-8e9e-c260b21a0824' where PublicHashedId ='XKJB82' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='bc767510-cdaf-4956-a70e-5837e2098bd7' where PublicHashedId ='5Y9787' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='875a0aef-34cf-4177-99a6-5a5c02da0e6f' where PublicHashedId ='XNWD8P' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='a60e0592-f9a5-4937-b70f-e51399238ad4' where PublicHashedId ='XKJBNE' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='cc248e53-f683-4c65-a113-a9a60fd7f841' where PublicHashedId ='58RK9W' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='20a3e13d-af96-4432-b928-aa20d6e4bc43' where PublicHashedId ='5JY4ZJ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='19f0151f-e79d-48e6-902d-b0435c9132a5' where PublicHashedId ='X9J7ME' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='162babd3-b9a4-4dc8-9ed0-0bf9fca73f33' where PublicHashedId ='X3VNMN' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='1690f7d1-37fa-48be-8586-9d2e40b2550d' where PublicHashedId ='XZYP33' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='16b770bd-fca9-4c77-a309-60d2d7cb56fe' where PublicHashedId ='XKJBKZ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='df7274f1-f90f-4356-9a1e-463800fe8570' where PublicHashedId ='53VNYN' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='3e07aa45-c7cd-445f-9e07-87e613c35a87' where PublicHashedId ='XDNR6W' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='f4ccd6e7-cade-4284-b55d-bfc85c028bb3' where PublicHashedId ='XJY49J' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='c608479d-9bc1-4e1b-909a-0fde17e4a420' where PublicHashedId ='XGDRJJ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='875f39a1-fbf2-4558-a20e-f8847b02a75a' where PublicHashedId ='XV29GE' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='94eb40bf-f4f3-4355-b6fe-d5e46fcc814b' where PublicHashedId ='X9JM43' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='397c5791-5607-48e0-9b60-8aa58196fc33' where PublicHashedId ='XNW4KM' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='7d3a5996-cd83-4361-8c30-31c764d9d1a8' where PublicHashedId ='5WJND2' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='25796bb4-6c5e-4aba-9e28-5f0515b97c88' where PublicHashedId ='XZY3MK' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='593911ab-1a96-42be-9c7a-8082a82024eb' where PublicHashedId ='XKJKWN' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='dfc2ac2f-2e99-4e64-9458-9f95093d9604' where PublicHashedId ='56NMGZ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='25d8a66d-a7b0-4af5-8735-afe563388a92' where PublicHashedId ='X4YMED' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='6d97ef81-4a76-4f4c-8365-31970f90706c' where PublicHashedId ='5M36P6' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='fb68a3d6-9f8b-4332-a99d-f08b6f0b4758' where PublicHashedId ='XY9WPJ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='22eea1cf-48de-4788-a5ae-e43f751f8821' where PublicHashedId ='XGDR2R' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='dd13e8db-546f-4ba9-ae5f-5b37b4d9f329' where PublicHashedId ='XM3642' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='92d190f9-97ed-44ec-99e8-3a4541c7c884' where PublicHashedId ='5PYGEM' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='19e3d403-69e3-4536-bd2b-e13c54b09875' where PublicHashedId ='X4YM8K' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='cfc84d63-2666-48e1-ba8f-d5c41823ceac' where PublicHashedId ='5M36Z2' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='435603db-c5b0-4bb7-a6b5-597378cc46c8' where PublicHashedId ='5JYZ84' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='4cef1435-9480-4c1d-a0ed-ee0bf9b52452' where PublicHashedId ='5WJN9P' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='6eb91222-6b2d-404e-bf55-4dabb3f8ff90' where PublicHashedId ='X3VMW3' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='4ee0c7de-5b38-4abd-b920-cf3f89d5c912' where PublicHashedId ='X8RME7' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='3f62a3fa-732f-4567-88af-309a48ba9146' where PublicHashedId ='XR7PED' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='4e9a2f5f-6855-4156-90f8-133a0a4dfc09' where PublicHashedId ='5ZY36V' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='2d955e1e-8d02-4701-86ab-edad4361c361' where PublicHashedId ='5KJKMJ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='d4e1c67c-0153-4e2d-aefc-2e73ed99a7bd' where PublicHashedId ='X7N2YJ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='39a409db-33b5-4bd4-9ed0-0c08c87544a3' where PublicHashedId ='XNW4GE' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='de12fe46-fdf9-4a75-94cd-2d9448ff3ee4' where PublicHashedId ='5Y9WE8' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='b9cfd1cb-85d4-4b0f-ad66-ed163487a92c' where PublicHashedId ='X9JM2D' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='8333a508-728b-4908-87ca-17f5bc7609d7' where PublicHashedId ='XBYVVN' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='5dd1bc7f-def3-4218-93b8-962922dedd7d' where PublicHashedId ='XEJ9Y6' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='2b76383b-6299-43c2-8649-3608b0ca3abb' where PublicHashedId ='XBYV3G' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='1bbd1c26-67de-4de8-b046-8708abbf122a' where PublicHashedId ='53VYP6' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='472af833-fe97-4ab5-9db5-5199146ff631' where PublicHashedId ='52VJBZ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='24b991e1-ac60-41ba-ad7c-25a964ed038f' where PublicHashedId ='5EJY4J' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='4f92dc37-daec-4150-b21a-d5d2710778bb' where PublicHashedId ='5DNJ9B' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='e55becef-e9c9-416a-9eb6-488c99d565bf' where PublicHashedId ='XV2JGB' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='2909db4b-26bb-4ef7-9a00-52847354f2d7' where PublicHashedId ='5Y9NJP' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='7f7e992c-8831-418d-b2e4-15997ef996ae' where PublicHashedId ='XNWPK7' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='f7d2c69d-cf65-4f6b-94a4-73917ed5e391' where PublicHashedId ='5WJYDR' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='91b3f75d-9164-45c9-b399-f3e7f55e0435' where PublicHashedId ='5PYPR4' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='f490e0f1-389e-4011-a29f-549dc83b8566' where PublicHashedId ='XY9N2P' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='3ec064d7-272b-4b70-8e03-4bdba0712f36' where PublicHashedId ='54Y9YZ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='66c7db2f-5ad2-44eb-8650-0784dc044ac5' where PublicHashedId ='5EJYJJ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='c6272ba5-4d15-4650-92a0-ef60ee154855' where PublicHashedId ='XKJZJM' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='98448a5f-b90f-4928-b405-ba94d058b10f' where PublicHashedId ='XKJZV7' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='7ddecf91-88b0-40db-89a5-78c47303a411' where PublicHashedId ='56NRE2' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='d871c164-e3aa-4bf3-b1ef-576ede44711f' where PublicHashedId ='XV2J7V' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='c1a6b7c3-6f45-43ff-ba35-ae005278419b' where PublicHashedId ='XWJY2D' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='dafa3b4e-6799-4451-95b0-eff28a09451a' where PublicHashedId ='XGDNEV' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='a84be0c4-8589-407d-9c29-3dbb2699e11b' where PublicHashedId ='XV2J6P' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='99d04366-8ee5-412e-b8e9-388844b8d6b5' where PublicHashedId ='5JY3JZ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='d9d4c2fb-1980-4953-b8c6-7e369cba99d4' where PublicHashedId ='59JZGB' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='3cd30d56-654a-404e-bae9-7e180940f0ab' where PublicHashedId ='5NWPB6' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='85d67963-3355-4d5d-ba33-2e8304ed9ccc' where PublicHashedId ='X7NWB8' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='f70fa752-43c4-4b11-944a-a65273d7ef54' where PublicHashedId ='5JY38Z' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='971ae41d-a8af-4d6a-9ff8-6a66931efbd0' where PublicHashedId ='XY9NZR' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='959d4c36-f595-4da8-b8a4-4b176b6ec096' where PublicHashedId ='52VJNY' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='63e64006-e05a-4d33-8ba3-3d0bfed08b3e' where PublicHashedId ='X3VYRY' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='5f3e569b-25f9-465b-a328-a5367b1c307f' where PublicHashedId ='XGDNND' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='baaf2a2f-d6d5-43e5-bbce-4c14e5e0de42' where PublicHashedId ='5PYPVK' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='189048e6-7694-4ab3-abac-4cf3161170eb' where PublicHashedId ='XY9NKY' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='43b63e0b-bd18-4e6d-b581-43643751e6a7' where PublicHashedId ='52VJZ4' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='347e04ee-3870-42d8-8274-f2b20e73bf68' where PublicHashedId ='54Y9DE' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='321efd52-2312-4a15-960b-4fb146fc64aa' where PublicHashedId ='XKJZRD' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='9fd44e36-c3d8-497a-b106-72dfe4964942' where PublicHashedId ='56NR9M' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='ec444bf6-1409-4761-a593-2b2a411755ec' where PublicHashedId ='5BYRJ7' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='73ee756e-a219-4b69-b585-d7963e6406c5' where PublicHashedId ='59JBR8' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='5436d838-0d49-42e9-aecf-a72e4f93ebec' where PublicHashedId ='X3VK3W' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='c5f9f32a-45e9-4f19-b40d-bb07dffd794d' where PublicHashedId ='54Y7YM' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='ee0e29df-6d54-46ff-9ce3-b80934478514' where PublicHashedId ='5V2WBG' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='e54c1ac5-02e8-408a-ad35-659d21625c3e' where PublicHashedId ='5DN38R' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='eecd0780-266c-4a2e-8c00-14771c116aba' where PublicHashedId ='5EJZ62' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='d9b8165b-5976-40cb-bd12-62f2253e8b98' where PublicHashedId ='5DN3WR' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='54169432-aa38-4cf0-89b2-4de6c22aa0fd' where PublicHashedId ='5WJ3ME' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='46410b86-802e-42bb-9441-76491aa89ed8' where PublicHashedId ='XGD7EM' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='b93780f5-2f12-4130-aac9-afc298a8f85d' where PublicHashedId ='5EJZ3B' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='c99c3cc2-f0e9-4f0a-9f47-829b8a7d95b5' where PublicHashedId ='5DN377' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='72eb4e03-56d4-41de-b605-ae19c2bc0ff2' where PublicHashedId ='X4Y76V' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='77b347f9-946e-4085-9d32-245f214334bf' where PublicHashedId ='5KJ4NG' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='7151a0ef-d691-49b2-bb75-7b325e0f330a' where PublicHashedId ='X6N8BY' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='0d847b0f-d2d7-49fc-951c-5dc6389ab8a9' where PublicHashedId ='54Y7WV' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='9a37efc2-938d-4baf-b54b-b1993deccf91' where PublicHashedId ='5Y9KEZ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='9423d674-516f-41e2-8996-a9ae33036d68' where PublicHashedId ='56N83R' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='69375d4e-37d8-416b-8b40-a9a86b44c60d' where PublicHashedId ='X6N88R' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='98e0508f-18cb-4ee5-ba57-097a2fb99212' where PublicHashedId ='X7NRNB' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='fb05d101-afad-4d6b-b1ef-b71cd73edee7' where PublicHashedId ='58R3R9' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='383fe967-097d-4cd3-9366-c775d1b028da' where PublicHashedId ='XZY4EZ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='41846773-3b50-420a-ac05-cb04f36e3cdd' where PublicHashedId ='X9JKWR' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='14394258-9291-4af3-a723-9292793928c7' where PublicHashedId ='5WJK6J' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='f02640b6-4430-44de-991a-1fe9dedc4981' where PublicHashedId ='X9JK87' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='1dbcaad0-7861-4117-9245-91ebef5cbee8' where PublicHashedId ='5Y9MKD' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='e8086438-8c8c-4762-b182-7999216529f2' where PublicHashedId ='5V2332' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='e6f34f80-4657-45b9-8300-54327252d426' where PublicHashedId ='XBEJ72' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='ba088c12-670c-433b-940d-6fca3001f86e' where PublicHashedId ='X4BZYP' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='778df9b5-834f-4684-a99d-f6fe2d8c1b4b' where PublicHashedId ='XDBDNJ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='ff072901-f066-4068-9e60-756213f0dcb5' where PublicHashedId ='X9VR3M' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='2a2587ef-1af7-4145-bbe0-b2699f555600' where PublicHashedId ='5VEVDR' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='4baa2bc7-6558-4b40-a69a-afb185af9ddd' where PublicHashedId ='58VDBW' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='0d9d79c0-aa5b-48b8-9c33-dd856870695b' where PublicHashedId ='5MVD49' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='2bc6b208-81fd-4652-9c17-06309bd291f0' where PublicHashedId ='5W4P8B' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='88d3fffc-b558-4d22-8067-89f8a03da18a' where PublicHashedId ='5EGVWR' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='601dee15-ce10-43d2-813f-2bb67c7335f3' where PublicHashedId ='5DBDRW' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='6abcb6bd-a1b1-4fc0-89e0-ac2c49787e53' where PublicHashedId ='XRZBGM' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='1fbfff2c-abda-4f50-80c0-e8251796ca8b' where PublicHashedId ='5KVGZN' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='30a00e42-a30f-4ab7-a1b1-19442316cceb' where PublicHashedId ='XPZKPV' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='9831ac62-482f-4abf-ad60-1a361b59c44a' where PublicHashedId ='54BZ9D' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='c5f38a21-eef3-4863-934d-fa2f43db61d4' where PublicHashedId ='5MVDK6' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='b5e628c0-68e8-428e-aacf-d643639f2ed3' where PublicHashedId ='5RZRBM' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='6a645a55-ab96-4536-b356-bf058ab30c21' where PublicHashedId ='57JDD6' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='c2bcf5ee-0e19-4d64-979f-427bc24e688a' where PublicHashedId ='XDB993' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='e478dbe8-b47f-498c-a53f-d7c6ffa9c040' where PublicHashedId ='5W4D7P' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='c30e6bc4-fcc7-419c-9708-95ae6d88c5cf' where PublicHashedId ='XZEM2V' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='5a26d819-b4d1-4f22-9a42-63dca3e77cb3' where PublicHashedId ='XKVW9J' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='9ce92c22-287c-4007-82a8-73d5bf594d91' where PublicHashedId ='57JD9J' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='f7ff3bfd-c21a-43bd-939e-b7807b1ea1f0' where PublicHashedId ='56EGPW' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='1a1d25e6-c7d9-4efd-af47-5f5b3165d8a6' where PublicHashedId ='XZEM8V' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='1d50c070-2d1b-4d2f-8b2d-20a134bd2d74' where PublicHashedId ='59V4YZ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='cd2e3bfe-9386-42ce-86ea-d5e6d81d8fa0' where PublicHashedId ='54BE2K' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='fb6d9632-b809-4bfc-a612-564c0bc1c527' where PublicHashedId ='XBEGKP' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='424b4fe4-bbe4-4a07-9bed-87029ba01e36' where PublicHashedId ='5EG4KE' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='c8941fef-3a9d-46c8-9048-0780117a2027' where PublicHashedId ='5DB9KM' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='c3137b23-a339-4295-a4f5-91b9a5a430a8' where PublicHashedId ='XVEGM4' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='abd9ef4f-a60c-4246-b5d6-984a50b69cb7' where PublicHashedId ='5YGJ4W' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='9787895c-eb98-4382-bd58-c66533655f5d' where PublicHashedId ='XKVWYJ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='f91d920b-1f62-464a-badd-fd2678bb5f21' where PublicHashedId ='XVEG86' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='6a94d5e6-f9e1-4822-8850-91d92b6e7cc5' where PublicHashedId ='5GKJV8' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='37aa983d-06f6-496a-97bb-edc24ebf4441' where PublicHashedId ='5W4DWZ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='4b3c2092-becc-4a0c-ad3c-5c10ca4ea400' where PublicHashedId ='XZEMDW' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='ed444166-06c5-4f08-ab01-0b363e7209dd' where PublicHashedId ='XVEG9B' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='2084624d-389c-442f-986e-b572bf956f5b' where PublicHashedId ='5W4DNR' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='1152ddaf-4b21-46b6-9740-20cabea21886' where PublicHashedId ='5GKJGN' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='a24f7b13-258d-4f7a-a336-2d0359d2b0f9' where PublicHashedId ='58VNDG' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='85b10b37-a8b3-47a6-b3b1-ab571a17e2e6' where PublicHashedId ='5DBVD6' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='dc81586b-6e34-4516-a160-5c4dcc4cffab' where PublicHashedId ='XVEZGV' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='761cccb8-21aa-44ad-b8bb-067ff7eb7890' where PublicHashedId ='XKVEW7' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='6ceb1b27-a5ec-4486-a27a-de88941c9616' where PublicHashedId ='XEG84Z' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='5e7e844f-aeb2-44dc-af78-a917877980c4' where PublicHashedId ='X7JPP7' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='e01b11fa-2691-470c-878f-e694d923aab3' where PublicHashedId ='XKVE9V' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='eca5b94b-3ffa-4d61-bfcb-df7a64669ec8' where PublicHashedId ='XGK9EW' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='6d26d05b-4dd5-49bd-9d28-7826847e611a' where PublicHashedId ='5VEZNN' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='f37defaf-b8da-4c04-9e47-bdebdc53cc8a' where PublicHashedId ='XRZ2V9' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='9717fef0-43e6-447c-8b7e-da83072f32d6' where PublicHashedId ='53478Y' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='341f4f4a-ba76-47ad-9220-a7f2615aa1b3' where PublicHashedId ='5RZ289' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='d7a74eb1-65f3-4a7a-8f6a-275fdd5336f0' where PublicHashedId ='XBE7VD' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='eb5d3497-6f49-43e1-8115-4ab6175bbe36' where PublicHashedId ='5YG2N9' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='f92428ca-836d-4393-9806-e1f89907c0c4' where PublicHashedId ='XKVEZY' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='e79b89f8-f2fb-413d-ae5d-8ef2e173930b' where PublicHashedId ='X6ENV4' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='ce96f6a7-5e1c-45bc-92e4-da0d4d9a101b' where PublicHashedId ='XKVJWY' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='bd740a21-9d56-402d-8e9e-2bd79168e827' where PublicHashedId ='56ENE6' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='d3d3e135-17d3-44cb-919c-6914549dee96' where PublicHashedId ='X8VRVJ' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='169a1e05-11a0-445b-976e-dd30d2bb9a9d' where PublicHashedId ='XJNY7P' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='a1a86287-29f9-4617-bfcc-2e3478c18f1c' where PublicHashedId ='534VZK' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='54dba267-b37a-449c-a329-953aa98e8edb' where PublicHashedId ='XVE268' and [LegalEntityId]='' -update [AccountLegalEntities] set [LegalEntityId]='52ab2546-189d-4dd6-b995-22a32ac26d20' where PublicHashedId ='XVE2NK' and [LegalEntityId]='' - -update c -set c.LegalEntityId = ale.LegalEntityId -from Commitment c -join AccountLegalEntities ale on ale.PublicHashedId = c.AccountLegalEntityPublicHashedId -where c.LegalEntityId = '' \ No newline at end of file +-- CV-684: set all accounts to levy initially, so that a manual script can set nonlevy back again +-- This must be removed immediately after release +update [Accounts] set [LevyStatus]=1 diff --git a/src/SFA.DAS.Commitments.Database/SFA.DAS.Commitments.Database.sqlproj b/src/SFA.DAS.Commitments.Database/SFA.DAS.Commitments.Database.sqlproj index bc2d65a507..9868f0bfa3 100644 --- a/src/SFA.DAS.Commitments.Database/SFA.DAS.Commitments.Database.sqlproj +++ b/src/SFA.DAS.Commitments.Database/SFA.DAS.Commitments.Database.sqlproj @@ -150,6 +150,7 @@ + diff --git a/src/SFA.DAS.Commitments.Database/Tables/Accounts.sql b/src/SFA.DAS.Commitments.Database/Tables/Accounts.sql index f4b7108670..a40ddc0462 100644 --- a/src/SFA.DAS.Commitments.Database/Tables/Accounts.sql +++ b/src/SFA.DAS.Commitments.Database/Tables/Accounts.sql @@ -6,5 +6,6 @@ [Name] NVARCHAR(100) NOT NULL, [Created] DATETIME2 NOT NULL, [Updated] DATETIME2 NULL, + [LevyStatus] tinyint NOT NULL DEFAULT 0, CONSTRAINT [PK_Accounts] PRIMARY KEY CLUSTERED ([Id] ASC) ) \ No newline at end of file