-
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.
CON-1654 - Users to see version history of accepted agreements - WIP
- Loading branch information
1 parent
6979851
commit ad74481
Showing
21 changed files
with
649 additions
and
5 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
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
27 changes: 27 additions & 0 deletions
27
src/SFA.DAS.EmployerAccounts.Web/ViewModels/EmployerAgreementViewModelV1.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,27 @@ | ||
using System; | ||
using SFA.DAS.EmployerAccounts.Models.Account; | ||
using SFA.DAS.EmployerAccounts.Models.EmployerAgreement; | ||
namespace SFA.DAS.EmployerAccounts.Web.ViewModels | ||
{ | ||
public class EmployerAgreementViewModelV1 | ||
{ | ||
public long Id { get; set; } | ||
public DateTime? ExpiredDate { get; set; } | ||
public long? SignedById { get; set; } | ||
public string SignedByName { get; set; } | ||
public DateTime? SignedDate { get; set; } | ||
public long AccountLegalEntityId { get; set; } | ||
public AccountLegalEntity AccountLegalEntity { get; set; } | ||
public EmployerAgreementStatus StatusId { get; set; } | ||
public AgreementTemplate Template { get; set; } | ||
public int TemplateId { get; set; } | ||
public bool OrganisationLookupPossible { get; set; } | ||
public string HashedAccountId { get; set; } | ||
public string HashedLegalEntityId { get; set; } | ||
public string HashedAgreementId { get; set; } | ||
|
||
public string AccountLegalEntityPublicHashedId => AccountLegalEntity.PublicHashedId; | ||
|
||
public string SignedDateText { get; set; } | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
src/SFA.DAS.EmployerAccounts.Web/ViewModels/OrganisationAgreementViewModel.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,49 @@ | ||
using System; | ||
using System.Linq; | ||
using System.Collections.Generic; | ||
using SFA.DAS.EmployerAccounts.Models.Account; | ||
|
||
namespace SFA.DAS.EmployerAccounts.Web.ViewModels | ||
{ | ||
public class OrganisationAgreementViewModel | ||
{ | ||
public long Id { get; set; } | ||
public string Name { get; set; } | ||
public string Address { get; set; } | ||
public long AccountId { get; set; } | ||
public long LegalEntityId { get; set; } | ||
public DateTime Created { get; set; } | ||
public long? SignedAgreementId { get; set; } | ||
public int? SignedAgreementVersion { get; set; } | ||
public long? PendingAgreementId { get; set; } | ||
public int? PendingAgreementVersion { get; set; } | ||
public string AccountLegalEntityPublicHashedId { get; set; } | ||
public DateTime? Deleted { get; set; } | ||
|
||
public ICollection<EmployerAgreement> Agreements { get; set; } = new List<EmployerAgreement>(); | ||
|
||
public bool AgreementV1Signed => DoCheck(Agreements.Where(x => x.Template.PartialViewName == "_Agreement_V1").FirstOrDefault()); | ||
public bool AgreementV2Signed => DoCheck(Agreements.Where(x => x.Template.PartialViewName == "_Agreement_V2").FirstOrDefault()); | ||
public bool AgreementV3Signed => DoCheck(Agreements.Where(x => x.Template.PartialViewName == "_Agreement_V3").FirstOrDefault()); | ||
|
||
public DateTime? AgreementV1SignedDate => Agreements.Where(x => x.Template.PartialViewName == "_Agreement_V1").FirstOrDefault().SignedDate; | ||
public DateTime? AgreementV2SignedDate => Agreements.Where(x => x.Template.PartialViewName == "_Agreement_V2").FirstOrDefault().SignedDate; | ||
public DateTime? AgreementV3SignedDate => Agreements.Where(x => x.Template.PartialViewName == "_Agreement_V3").FirstOrDefault().SignedDate; | ||
|
||
public EmployerAgreementViewModelV1 EmployerAgreementV1 { get; set; } | ||
public EmployerAgreementViewModelV1 EmployerAgreementV2 { get; set; } | ||
public EmployerAgreementViewModelV1 EmployerAgreementV3 { get; set; } | ||
|
||
public LegalEntity LegalEntity { get; set; } | ||
|
||
public string HashedAccountId { get; set; } | ||
public string HashedLegalEntityId { get; set; } | ||
|
||
private bool DoCheck(EmployerAgreement employerAgreement) | ||
{ | ||
return employerAgreement != null ? employerAgreement.SignedDate.HasValue : false; | ||
} | ||
|
||
|
||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/SFA.DAS.EmployerAccounts.Web/ViewModels/OrganisationEmployerAgreementViewModel.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,17 @@ | ||
using SFA.DAS.EmployerAccounts.Models.EmployerAgreement; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Web; | ||
|
||
|
||
namespace SFA.DAS.EmployerAccounts.Web.ViewModels | ||
{ | ||
|
||
public class OrganisationAgreementViewModelV1 | ||
{ | ||
public OrganisationAgreementViewModel OrganisationAgreementViewModel { get; set; } | ||
|
||
public bool OrganisationLookupPossible { get; set; } | ||
} | ||
} |
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
122 changes: 122 additions & 0 deletions
122
src/SFA.DAS.EmployerAccounts.Web/Views/EmployerAgreement/ViewAllAgreements.cshtml
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,122 @@ | ||
@using SFA.DAS.EmployerAccounts.Web.Extensions | ||
@using SFA.DAS.EmployerAccounts.Web.Helpers | ||
@{Layout = "~/Views/Shared/_Layout_CDN.cshtml"; } | ||
@model OrchestratorResponse<OrganisationAgreementViewModelV1> | ||
@{ | ||
ViewBag.PageID = "organisations-agreements-details"; | ||
ViewBag.Title = "ViewAllAgreements"; | ||
ViewBag.Section = "organisations"; | ||
ViewBag.ZenDeskLabel = "eas-your-esfa-agreement"; | ||
} | ||
|
||
@{ | ||
ViewBag.GaData.Vpv = "/accounts/agreements/view-your-agreement/agreement-details"; | ||
} | ||
|
||
|
||
<h1>Your agreements with the Education and Skills Funding Agency (ESFA)</h1> | ||
|
||
<div class="govuk-tabs" data-module="govuk-tabs"> | ||
<h2 class="govuk-tabs__title"> | ||
Contents | ||
</h2> | ||
<ul class="govuk-tabs__list"> | ||
<li class="govuk-tabs__list-item govuk-tabs__list-item--selected"> | ||
<a class="govuk-tabs__tab" href="#v3-agreement"> | ||
Published 9 January 2020 | ||
</a> | ||
</li> | ||
@if (@Model.Data.OrganisationAgreementViewModel.AgreementV2Signed) | ||
{ | ||
<li class="govuk-tabs__list-item"> | ||
<a class="govuk-tabs__tab" href="#v2-agreement"> | ||
Published 1 May 2018 | ||
</a> | ||
</li> | ||
} | ||
@if (@Model.Data.OrganisationAgreementViewModel.AgreementV1Signed) | ||
{ | ||
<li class="govuk-tabs__list-item"> | ||
<a class="govuk-tabs__tab" href="#v1-agreement"> | ||
Published 1 May 2017 | ||
</a> | ||
</li> | ||
} | ||
</ul> | ||
<div class="govuk-tabs__panel" id="v3-agreement"> | ||
V3 Agreement | ||
|
||
@if (@Model.Data.OrganisationAgreementViewModel.AgreementV3Signed) | ||
{ | ||
<h2>Accepted on @Model.Data.OrganisationAgreementViewModel.AgreementV3SignedDate</h2> | ||
|
||
<h2>Agreement between @Model.Data.OrganisationAgreementViewModel.Name and ESFA </h2> | ||
<Subheading> | ||
Published 9 January 2020 | ||
</Subheading> | ||
|
||
<Insettext> | ||
This is a new agreement. | ||
</Insettext> | ||
|
||
@Html.Partial("_AcceptedAgreement", @Model.Data.OrganisationAgreementViewModel.EmployerAgreementV3) | ||
} | ||
else | ||
{ | ||
<h2>NOT ACCEPTED YET</h2> | ||
|
||
<h2>Agreement between @Model.Data.OrganisationAgreementViewModel.Name and ESFA </h2> | ||
|
||
<subheading> | ||
Published 9 January 2020 | ||
</subheading> | ||
|
||
@Html.Partial("_NotAcceptedAgreement", @Model.Data.OrganisationAgreementViewModel) | ||
} | ||
</div> | ||
<div class="govuk-tabs__panel govuk-tabs__panel--hidden" id="v2-agreement"> | ||
|
||
V2 Agreement | ||
|
||
@if (@Model.Data.OrganisationAgreementViewModel.AgreementV2Signed) | ||
{ | ||
<h2>Accepted on @Model.Data.OrganisationAgreementViewModel.AgreementV2SignedDate</h2> | ||
|
||
<h2>Agreement between @Model.Data.OrganisationAgreementViewModel.Name and ESFA </h2> | ||
<Subheading> | ||
Published 1 May 2018 | ||
</Subheading> | ||
|
||
<Insettext> | ||
This is a variation of the agreement that we published 1 May 2017. We updated it to add clause 7 (transfer of funding). | ||
</Insettext> | ||
|
||
@Html.Partial("_AcceptedAgreement", @Model.Data.OrganisationAgreementViewModel.EmployerAgreementV2) | ||
} | ||
else | ||
{ | ||
<p> Not Required </p> | ||
} | ||
|
||
</div> | ||
|
||
<div class="govuk-tabs__panel govuk-tabs__panel--hidden" id="v1-agreement"> | ||
V1 Agreement | ||
@if (@Model.Data.OrganisationAgreementViewModel.AgreementV1Signed) | ||
{ | ||
<h2>Accepted on @Model.Data.OrganisationAgreementViewModel.AgreementV1SignedDate</h2> | ||
|
||
<h2>Agreement between @Model.Data.OrganisationAgreementViewModel.Name and ESFA </h2> | ||
<Subheading> | ||
Published 1 May 2017 | ||
</Subheading> | ||
|
||
@Html.Partial("_AcceptedAgreement", @Model.Data.OrganisationAgreementViewModel.EmployerAgreementV1) | ||
} | ||
else | ||
{ | ||
<p> Not Required </p> | ||
} | ||
|
||
</div> | ||
</div> |
Oops, something went wrong.