Skip to content

Commit

Permalink
merged from master
Browse files Browse the repository at this point in the history
  • Loading branch information
VasanthaKasirajan3008 committed Apr 27, 2020
2 parents c75de62 + 6399809 commit e44aab5
Show file tree
Hide file tree
Showing 216 changed files with 4,218 additions and 2,220 deletions.
100 changes: 100 additions & 0 deletions src/.cr/personal/Navigation/RecentFilesHistory.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<?xml version="1.0" encoding="utf-8"?>
<Root Type="DevExpress.CodeRush.Foundation.Navigation.QuickFileNav.SolutionFileInfosContainer">
<Options Language="Neutral">
<Items>
<Item Id="{8a02d3a3-2b65-4c3b-b255-20e60303a11e}">
<Filename>EmployerTeamController.cs</Filename>
<FilePath>c:\esfa\das-employerapprenticeshipsservice\src\sfa.das.employeraccounts.web\controllers\employerteamcontroller.cs</FilePath>
<Folders>
<Item>Controllers</Item>
</Folders>
<ProjectFileName>C:\ESFA\das-employerapprenticeshipsservice\src\SFA.DAS.EmployerAccounts.Web\SFA.DAS.EmployerAccounts.Web.csproj</ProjectFileName>
<ProjectName>SFA.DAS.EmployerAccounts.Web</ProjectName>
</Item>
<Item Id="{94894b8d-c8da-4361-a132-fbf3ed6eae94}">
<Filename>EmployerTeamController.cs</Filename>
<FilePath>c:\esfa\das-employerapprenticeshipsservice\src\sfa.das.employeraccounts.web\controllers\employerteamcontroller.cs</FilePath>
<Folders>
<Item>Controllers</Item>
</Folders>
<ProjectFileName>C:\ESFA\das-employerapprenticeshipsservice\src\SFA.DAS.EmployerAccounts.Web\SFA.DAS.EmployerAccounts.Web.csproj</ProjectFileName>
<ProjectName>SFA.DAS.EmployerAccounts.Web</ProjectName>
</Item>
<Item Id="{d300401c-1b37-4cc1-8d68-e727c2ccba80}">
<Filename>UrlHelperExtensions.cs</Filename>
<FilePath>c:\esfa\das-employerapprenticeshipsservice\src\sfa.das.employeraccounts.web\extensions\urlhelperextensions.cs</FilePath>
<Folders>
<Item>Extensions</Item>
</Folders>
<ProjectFileName>C:\ESFA\das-employerapprenticeshipsservice\src\SFA.DAS.EmployerAccounts.Web\SFA.DAS.EmployerAccounts.Web.csproj</ProjectFileName>
<ProjectName>SFA.DAS.EmployerAccounts.Web</ProjectName>
</Item>
<Item Id="{6b7660f7-c583-4ef0-8f67-9faaa29e950c}">
<Filename>UrlHelperExtensions.cs</Filename>
<FilePath>c:\esfa\das-employerapprenticeshipsservice\src\sfa.das.eas.support.web\extensions\urlhelperextensions.cs</FilePath>
<Folders>
<Item>Extensions</Item>
</Folders>
<ProjectFileName>C:\ESFA\das-employerapprenticeshipsservice\src\SFA.DAS.EAS.Support.Web\SFA.DAS.EAS.Support.Web.csproj</ProjectFileName>
<ProjectName>SFA.DAS.EAS.Support.Web</ProjectName>
</Item>
<Item Id="{92d9e756-5f0e-45a3-8820-7b3103628e2a}">
<Filename>EmployerTeamOrchestrator.cs</Filename>
<FilePath>c:\esfa\das-employerapprenticeshipsservice\src\sfa.das.employeraccounts.web\orchestrators\employerteamorchestrator.cs</FilePath>
<Folders>
<Item>Orchestrators</Item>
</Folders>
<ProjectFileName>C:\ESFA\das-employerapprenticeshipsservice\src\SFA.DAS.EmployerAccounts.Web\SFA.DAS.EmployerAccounts.Web.csproj</ProjectFileName>
<ProjectName>SFA.DAS.EmployerAccounts.Web</ProjectName>
</Item>
<Item Id="{36f1e025-c645-4f6a-95ac-8c2bb7e72efc}">
<Filename>EmployerTeamController.cs</Filename>
<FilePath>c:\esfa\das-employerapprenticeshipsservice\src\sfa.das.employeraccounts.web\controllers\employerteamcontroller.cs</FilePath>
<Folders>
<Item>Controllers</Item>
</Folders>
<ProjectFileName>C:\ESFA\das-employerapprenticeshipsservice\src\SFA.DAS.EmployerAccounts.Web\SFA.DAS.EmployerAccounts.Web.csproj</ProjectFileName>
<ProjectName>SFA.DAS.EmployerAccounts.Web</ProjectName>
</Item>
<Item Id="{c2e527d6-e2b9-4f3d-b526-160c267e3386}">
<Filename>EmployerTeam</Filename>
<FilePath>c:\esfa\das-employerapprenticeshipsservice\src\sfa.das.employeraccounts.web\views\employerteam\</FilePath>
<Folders>
<Item>Views</Item>
</Folders>
<LocationType>Folder</LocationType>
<ProjectFileName>C:\ESFA\das-employerapprenticeshipsservice\src\SFA.DAS.EmployerAccounts.Web\SFA.DAS.EmployerAccounts.Web.csproj</ProjectFileName>
<ProjectName>SFA.DAS.EmployerAccounts.Web</ProjectName>
</Item>
<Item Id="{892a4756-3f8f-4434-acef-51f7367a7bd8}">
<Filename>EmployerTeamController.cs</Filename>
<FilePath>c:\esfa\das-employerapprenticeshipsservice\src\sfa.das.employeraccounts.web\controllers\employerteamcontroller.cs</FilePath>
<Folders>
<Item>Controllers</Item>
</Folders>
<ProjectFileName>C:\ESFA\das-employerapprenticeshipsservice\src\SFA.DAS.EmployerAccounts.Web\SFA.DAS.EmployerAccounts.Web.csproj</ProjectFileName>
<ProjectName>SFA.DAS.EmployerAccounts.Web</ProjectName>
</Item>
<Item Id="{86a9c0a5-db6c-4a6e-8308-862537d621c5}">
<Filename>GetReservationsRequestHandler.cs</Filename>
<FilePath>c:\esfa\das-employerapprenticeshipsservice\src\sfa.das.employeraccounts\queries\getreservations\getreservationsrequesthandler.cs</FilePath>
<Folders>
<Item>Queries</Item>
<Item>GetReservations</Item>
</Folders>
<ProjectFileName>C:\ESFA\das-employerapprenticeshipsservice\src\SFA.DAS.EmployerAccounts\SFA.DAS.EmployerAccounts.csproj</ProjectFileName>
<ProjectName>SFA.DAS.EmployerAccounts</ProjectName>
</Item>
<Item Id="{af3cefe5-28eb-4a50-8565-af435bf961de}">
<Filename>WhenGettingAccount.cs</Filename>
<FilePath>c:\esfa\das-employerapprenticeshipsservice\src\sfa.das.employeraccounts.web.unittests\orchestrators\employerteamorchestratortests\whengettingaccount.cs</FilePath>
<Folders>
<Item>Orchestrators</Item>
<Item>EmployerTeamOrchestratorTests</Item>
</Folders>
<ProjectFileName>C:\ESFA\das-employerapprenticeshipsservice\src\SFA.DAS.EmployerAccounts.Web.UnitTests\SFA.DAS.EmployerAccounts.Web.UnitTests.csproj</ProjectFileName>
<ProjectName>SFA.DAS.EmployerAccounts.Web.UnitTests</ProjectName>
</Item>
</Items>
</Options>
</Root>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="SFA.DAS.Common.Domain" Version="1.4.278" />
<PackageReference Include="SFA.DAS.Common.Domain" Version="1.4.283" />
</ItemGroup>
<PropertyGroup>
<PackageId>SFA.DAS.Account.Api.Types</PackageId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
<Version>6.0.51</Version>
</PackageReference>
<PackageReference Include="SFA.DAS.Common.Domain">
<Version>1.4.278</Version>
<Version>1.4.283</Version>
</PackageReference>
<PackageReference Include="SFA.DAS.EmployerAccounts.Api.Types">
<Version>1.6.1852</Version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@
<Build Include="StoredProcedures\GetPaye_ByRef.sql" />
<Build Include="StoredProcedures\UpdatePayeName_ByRef.sql" />
<Build Include="StoredProcedures\RemoveLegalEntityFromAccount.sql" />
<Build Include="StoredProcedures\GetEmployerAgreementsToRemove_ByAccountId.sql" />
<Build Include="Tables\UserAccountSettings.sql" />
<Build Include="StoredProcedures\RemoveMembership.sql" />
<Build Include="StoredProcedures\GetUserAccountSettings.sql" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@
@sector NVARCHAR(100),
@aorn VARCHAR(50),
@agreementType TINYINT,
@apprenticeshipEmployerType TINYINT,
@agreementVersion INT OUTPUT
)
AS
BEGIN
SET NOCOUNT ON;

INSERT INTO [employer_account].[Account](Name, CreatedDate) VALUES (@employerName, @addedDate);
INSERT INTO [employer_account].[Account](Name, CreatedDate, ApprenticeshipEmployerType) VALUES (@employerName, @addedDate, @apprenticeshipEmployerType);
SELECT @accountId = SCOPE_IDENTITY();

DECLARE @accountLegalEntityCreated AS BIT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
(
@userId BIGINT,
@employerName NVARCHAR(100),
@apprenticeshipEmployerType TINYINT,
@accountId BIGINT OUTPUT,
@addedDate DATETIME
)
AS
BEGIN
SET NOCOUNT ON;

INSERT INTO [employer_account].[Account](Name, CreatedDate) VALUES (@employerName, @addedDate);
INSERT INTO [employer_account].[Account](Name, CreatedDate, ApprenticeshipEmployerType) VALUES (@employerName, @addedDate, @apprenticeshipEmployerType);
SELECT @accountId = SCOPE_IDENTITY();

INSERT INTO [employer_account].[Membership](UserId, AccountId, [Role]) VALUES (@userId, @accountId, 1);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[CreatedDate] DATETIME NOT NULL,
[ModifiedDate] DATETIME NULL,
[PublicHashedId] NVARCHAR(100) NULL,
[ApprenticeshipEmployerType] TINYINT NOT NULL DEFAULT 0
[ApprenticeshipEmployerType] TINYINT NOT NULL
)
GO

Expand Down
2 changes: 1 addition & 1 deletion src/SFA.DAS.EAS.sln
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SFA.DAS.EmployerAccounts.Ap
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SFA.DAS.EmployerAccounts.Api.IntegrationTests", "SFA.DAS.EmployerAccounts.Api.IntegrationTests\SFA.DAS.EmployerAccounts.Api.IntegrationTests.csproj", "{BD68EB2C-A486-42B2-8685-776B164FD860}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SFA.DAS.EmployerFinance.MessageHandlers.TestHarness", "SFA.DAS.EmployerFinance.MessageHandlers.TestHarness\SFA.DAS.EmployerFinance.MessageHandlers.TestHarness.csproj", "{73080F2E-1875-4DBC-BE84-381E2FD603D2}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SFA.DAS.EmployerFinance.MessageHandlers.TestHarness", "SFA.DAS.EmployerFinance.MessageHandlers.TestHarness\SFA.DAS.EmployerFinance.MessageHandlers.TestHarness.csproj", "{73080F2E-1875-4DBC-BE84-381E2FD603D2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
<Version>6.0.52</Version>
</PackageReference>
<PackageReference Include="SFA.DAS.Common.Domain">
<Version>1.4.278</Version>
<Version>1.4.283</Version>
</PackageReference>
<PackageReference Include="SFA.DAS.Configuration.AzureTableStorage">
<Version>3.0.75</Version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="SFA.DAS.Common.Domain" Version="1.4.278" />
<PackageReference Include="SFA.DAS.Common.Domain" Version="1.4.283" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<PackageReference Include="SFA.DAS.Authorization.WebApi">
<Version>6.0.52</Version>
</PackageReference>
<PackageReference Include="SFA.DAS.Common.Domain" Version="1.4.278" />
<PackageReference Include="SFA.DAS.Common.Domain" Version="1.4.283" />
<PackageReference Include="SFA.DAS.EmployerUsers.WebClientComponents" Version="1.0.0.4388" />
<PackageReference Include="SFA.DAS.HashingService" Version="1.0.183" />
<PackageReference Include="SFA.DAS.Logging">
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
using System;
using System.Threading.Tasks;
using MediatR;
using Moq;
using NUnit.Framework;
using SFA.DAS.Common.Domain.Types;
using SFA.DAS.EmployerAccounts.Commands.AccountLevyStatus;
using SFA.DAS.EmployerAccounts.Events.Messages;
using SFA.DAS.EmployerAccounts.MessageHandlers.EventHandlers.EmployerFinance;
using SFA.DAS.EmployerFinance.Messages.Events;
Expand All @@ -23,7 +26,6 @@ public Task WhenMessageIsHandled_RefreshEmployerLevyDataCompletedMessageIsPublis
const short periodMonth = 7;
const string periodYear = "2018";


return TestAsync(f => f.Handle(new RefreshEmployerLevyDataCompletedEvent
{
AccountId = accountId,
Expand All @@ -37,18 +39,45 @@ public Task WhenMessageIsHandled_RefreshEmployerLevyDataCompletedMessageIsPublis
f.VerifyRefreshEmployerLevyDataCompletedMessageIsPublished(accountId, levyImported, periodMonth, periodYear, timestamp);
});
}

[TestCase(0, ApprenticeshipEmployerType.NonLevy)]
[TestCase(100, ApprenticeshipEmployerType.Levy)]
public Task WhenMessageIsHandled_AccountLevyStatusCommandIsSent(decimal levyValue, ApprenticeshipEmployerType apprenticeshipEmployerType)
{
var timestamp = DateTime.UtcNow;
const long accountId = 666;
const bool levyImported = true;
const short periodMonth = 7;
const string periodYear = "2018";

return TestAsync(f => f.Handle(new RefreshEmployerLevyDataCompletedEvent
{
AccountId = accountId,
LevyImported = levyImported,
PeriodMonth = periodMonth,
PeriodYear = periodYear,
LevyTransactionValue = levyValue,
Created = timestamp
})
, (f) =>
{
f.VerifyAccountLevyStatusCommandIsSent(accountId, apprenticeshipEmployerType);
});
}
}

public class RefreshEmployerLevyDataCompletedEventHandlerTestsFixture
{
private readonly RefreshEmployerLevyDataCompletedEventHandler _handler;
private readonly Mock<IMessagePublisher> _mockMessagePublisher;
private readonly Mock<IMediator> _mediator;

public RefreshEmployerLevyDataCompletedEventHandlerTestsFixture()
{
_mockMessagePublisher = new Mock<IMessagePublisher>();
_mediator = new Mock<IMediator>();

_handler = new RefreshEmployerLevyDataCompletedEventHandler(_mockMessagePublisher.Object);
_handler = new RefreshEmployerLevyDataCompletedEventHandler(_mockMessagePublisher.Object, _mediator.Object);
}

public Task Handle(RefreshEmployerLevyDataCompletedEvent refreshEmployerLevyDataCompletedEvent)
Expand All @@ -66,5 +95,13 @@ public void VerifyRefreshEmployerLevyDataCompletedMessageIsPublished(long accoun
&& m.PeriodYear.Equals(periodYear)
&& m.CreatedAt.Equals(timestamp))));
}

public void VerifyAccountLevyStatusCommandIsSent(long accountId, ApprenticeshipEmployerType apprenticeshipEmployerType)
{
_mediator.Verify(e => e.SendAsync(It.Is<AccountLevyStatusCommand>(m =>
m.AccountId.Equals(accountId) &&
m.ApprenticeshipEmployerType.Equals(apprenticeshipEmployerType))),
Times.Once);
}
}
}
Loading

0 comments on commit e44aab5

Please sign in to comment.