-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into ASINTEL-1357-error-summary
- 1.6.3166
- 1.6.3155
- 1.6.3152
- 1.6.3147
- 1.6.3145
- 1.6.3143
- 1.6.3141
- 1.6.3139
- 1.6.3135
- 1.6.3131
- 1.6.3130
- 1.6.3128
- 1.6.3127
- 1.6.3124
- 1.6.3121
- 1.6.3120
- 1.6.3117
- 1.6.3116
- 1.6.3114
- 1.6.3111
- 1.6.3110
- 1.6.3108
- 1.6.3107
- 1.6.3105
- 1.6.3104
- 1.6.3102
- 1.6.3100
- 1.6.3098
- 1.6.3097
- 1.6.3095-HotFix-FinanceMH-StopQueueResize.1
- 1.6.3092
- 1.6.3090
- 1.6.3089
- 1.6.3088
- 1.6.3086
- 1.6.3084
- 1.6.3079
- 1.6.3078
- 1.6.3075
- 1.6.3074
- 1.6.3073
- 1.6.3072
- 1.6.3069
- 1.6.3067
- 1.6.3066
- 1.6.3064
- 1.6.3062
- 1.6.3061
- 1.6.3059
- 1.6.3057
- 1.6.3055
- 1.6.3052
- 1.6.3051
- 1.6.3050
- 1.6.3049
- 1.6.3048
- 1.6.3047
- 1.6.3045
- 1.6.3043
- 1.6.3042
- 1.6.3040
- 1.6.3037
- 1.6.3036
- 1.6.3035
- 1.6.3034
- 1.6.3033
- 1.6.3032
- 1.6.3029
- 1.6.3028
- 1.6.3027
- 1.6.3026
- 1.6.3023
- 1.6.3022
- 1.6.3021
Showing
20 changed files
with
2,033 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
....Employer_Account.Database/Scripts/Manual/CON-2796 Migrate And Add v5 Legal Agreement.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
-- Replace all pending v3 / v4 agreements with pending v5 agreement | ||
UPDATE [employer_account].[EmployerAgreement] | ||
SET TemplateId = 6 | ||
WHERE TemplateId IN (4, 5) AND StatusId = 1 | ||
|
||
UPDATE [employer_account].[AccountLegalEntity] | ||
SET PendingAgreementVersion = 5 | ||
WHERE PendingAgreementVersion IN (3, 4) | ||
|
||
-- Create a pending v5 agreement for all account legal entities (except those that have them) | ||
INSERT INTO [employer_account].[EmployerAgreement] (TemplateId, StatusId, AccountLegalEntityId) | ||
SELECT 6, 1, Id | ||
FROM [employer_account].[AccountLegalEntity] | ||
WHERE PendingAgreementVersion IS NULL AND PendingAgreementId IS NULL AND Deleted IS NULL AND SignedAgreementVersion != 5 | ||
|
||
UPDATE ale | ||
SET PendingAgreementVersion = 5, PendingAgreementId = ea.Id | ||
FROM [employer_account].[AccountLegalEntity] ale | ||
JOIN [employer_account].[EmployerAgreement] ea ON ea.AccountLegalEntityId = ale.Id AND ea.TemplateId = 6 AND ea.StatusId = 1 | ||
WHERE PendingAgreementVersion IS NULL AND PendingAgreementId IS NULL AND Deleted IS NULL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
138 changes: 138 additions & 0 deletions
138
src/SFA.DAS.EmployerAccounts.Web.UnitTests/Extensions/AgreementTemplateExtensionsTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using NUnit.Framework; | ||
using SFA.DAS.EmployerAccounts.Web.Extensions; | ||
using SFA.DAS.EmployerAccounts.Web.ViewModels; | ||
|
||
namespace SFA.DAS.EmployerAccounts.Web.UnitTests.Extensions | ||
{ | ||
[TestFixture] | ||
public class AgreementTemplateExtensionsTests | ||
{ | ||
[TestCase(1, "")] | ||
[TestCase(2, "This is a variation of the agreement that we published 1 May 2017. We updated it to add clause 7 (transfer of funding).")] | ||
[TestCase(3, "This is a new agreement.")] | ||
[TestCase(4, "This is a new agreement.")] | ||
[TestCase(5, "This is a new agreement.")] | ||
public void InsetTextSetCorrectlyForNoPreviouslySignedAgreements(int agreementVersion, string expectedResult) | ||
{ | ||
var model = new AgreementTemplateViewModel | ||
{ | ||
VersionNumber = agreementVersion | ||
}; | ||
|
||
Assert.AreEqual(expectedResult, model.InsetText(new List<OrganisationAgreementViewModel>())); | ||
} | ||
|
||
[TestCase(1, "")] | ||
[TestCase(2, "This is a variation of the agreement that we published 1 May 2017. We updated it to add clause 7 (transfer of funding).")] | ||
[TestCase(3, "This is a new agreement.")] | ||
[TestCase(4, "This is a new agreement.")] | ||
[TestCase(5, "This is a new agreement.")] | ||
public void InsetTextSetCorrectlyForPreviouslySignedv1Agreements(int agreementVersion, string expectedResult) | ||
{ | ||
var model = new AgreementTemplateViewModel | ||
{ | ||
VersionNumber = agreementVersion | ||
}; | ||
|
||
var agreements = new List<OrganisationAgreementViewModel> | ||
{ | ||
new OrganisationAgreementViewModel | ||
{ | ||
SignedDate = DateTime.Today, | ||
Template = new AgreementTemplateViewModel | ||
{ | ||
VersionNumber = 1 | ||
} | ||
} | ||
}; | ||
|
||
Assert.AreEqual(expectedResult, model.InsetText(agreements)); | ||
} | ||
|
||
[TestCase(1, "")] | ||
[TestCase(2, "This is a variation of the agreement that we published 1 May 2017. We updated it to add clause 7 (transfer of funding).")] | ||
[TestCase(3, "This is a new agreement.")] | ||
[TestCase(4, "This is a new agreement.")] | ||
[TestCase(5, "This is a new agreement.")] | ||
public void InsetTextSetCorrectlyForPreviouslySignedv2Agreements(int agreementVersion, string expectedResult) | ||
{ | ||
var model = new AgreementTemplateViewModel | ||
{ | ||
VersionNumber = agreementVersion | ||
}; | ||
|
||
var agreements = new List<OrganisationAgreementViewModel> | ||
{ | ||
new OrganisationAgreementViewModel | ||
{ | ||
SignedDate = DateTime.Today, | ||
Template = new AgreementTemplateViewModel | ||
{ | ||
VersionNumber = 2 | ||
} | ||
} | ||
}; | ||
|
||
Assert.AreEqual(expectedResult, model.InsetText(agreements)); | ||
} | ||
|
||
[TestCase(1, "")] | ||
[TestCase(2, "This is a variation of the agreement that we published 1 May 2017. We updated it to add clause 7 (transfer of funding).")] | ||
[TestCase(3, "This is a new agreement.")] | ||
[TestCase(4, "This is a variation to the agreement we published 9 January 2020. You only need to accept it if you want to access incentive payments for hiring a new apprentice.")] | ||
[TestCase(5, "This is a variation to the agreement we published 9 January 2020.")] | ||
public void InsetTextSetCorrectlyForPreviouslySignedv3Agreements(int agreementVersion, string expectedResult) | ||
{ | ||
var model = new AgreementTemplateViewModel | ||
{ | ||
VersionNumber = agreementVersion | ||
}; | ||
|
||
var agreements = new List<OrganisationAgreementViewModel> | ||
{ | ||
new OrganisationAgreementViewModel | ||
{ | ||
SignedDate = DateTime.Today, | ||
Template = new AgreementTemplateViewModel | ||
{ | ||
VersionNumber = 3 | ||
} | ||
} | ||
}; | ||
|
||
Assert.AreEqual(expectedResult, model.InsetText(agreements)); | ||
} | ||
|
||
[TestCase(1, "")] | ||
[TestCase(2, "This is a variation of the agreement that we published 1 May 2017. We updated it to add clause 7 (transfer of funding).")] | ||
[TestCase(3, "This is a new agreement.")] | ||
[TestCase(4, "This is a variation to the agreement we published 9 January 2020. You only need to accept it if you want to access incentive payments for hiring a new apprentice.")] | ||
[TestCase(5, "This is a variation to the agreement we published 9 January 2020.")] | ||
public void InsetTextSetCorrectlyForPreviouslySignedv4Agreements(int agreementVersion, string expectedResult) | ||
{ | ||
var model = new AgreementTemplateViewModel | ||
{ | ||
VersionNumber = agreementVersion | ||
}; | ||
|
||
var agreements = new List<OrganisationAgreementViewModel> | ||
{ | ||
new OrganisationAgreementViewModel | ||
{ | ||
SignedDate = DateTime.Today, | ||
Template = new AgreementTemplateViewModel | ||
{ | ||
VersionNumber = 4 | ||
} | ||
} | ||
}; | ||
|
||
Assert.AreEqual(expectedResult, model.InsetText(agreements)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.