Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…mployerapprenticeshipsservice into MAC-80-content-terms-of-use
reachash committed Jun 27, 2022
2 parents 6ef545b + 17bca3d commit d42458e
Showing 7 changed files with 70 additions and 7 deletions.
17 changes: 14 additions & 3 deletions src/SFA.DAS.EAS.Web/Controllers/EmployerCommitmentsController.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using System.Configuration;
using System.Web.Mvc;
using System.Web.Mvc;
using SFA.DAS.Authorization.Mvc.Attributes;
using SFA.DAS.EAS.Domain.Configuration;
using SFA.DAS.EAS.Web.Helpers;
using SFA.DAS.EAS.Infrastructure.Attributes;
using SFA.DAS.EAS.Web.ViewModels;

namespace SFA.DAS.EAS.Web.Controllers
@@ -24,6 +23,7 @@ public EmployerCommitmentsController(EmployerApprenticeshipsServiceConfiguration
[Route("cohorts/provider")]
[Route("Inform")]
[Route("confirmProvider/create")]
[Deprecated]
public ActionResult Index(string hashedAccountId)
{
return RedirectPermanentCommitmentsUrl();
@@ -33,27 +33,31 @@ public ActionResult Index(string hashedAccountId)
[OutputCache(CacheProfile = "NoCache")]
[Route("cohorts")]
[Route("cohorts/draft")]
[Deprecated]
public ActionResult YourCohorts(string hashedAccountId)
{
return RedirectPermanentCommitmentsUrl();
}

[HttpGet]
[Route("legalEntity/create")]
[Deprecated]
public ActionResult SelectLegalEntity(string hashedAccountId, string cohortRef = "")
{
return RedirectPermanentCommitmentsUrl();
}

[HttpGet]
[Route("provider/create")]
[Deprecated]
public ActionResult SearchProvider(string hashedAccountId, string legalEntityCode, string cohortRef)
{
return RedirectPermanentCommitmentsUrl();
}

[HttpGet]
[Route("choosePath/create")]
[Deprecated]
public ActionResult ChoosePath(string hashedAccountId, string legalEntityCode, string providerId, string cohortRef)
{
return RedirectPermanentCommitmentsUrl();
@@ -66,13 +70,15 @@ public ActionResult ChoosePath(string hashedAccountId, string legalEntityCode, s
[Route("{hashedCommitmentId}/apprenticeships/create")]
[Route("{hashedCommitmentId}/finished")]
[Route("{hashedCommitmentId}/CohortApproved")]
[Deprecated]
public ActionResult Details(string hashedAccountId, string hashedCommitmentId)
{
return RedirectPermanentCommitmentsUrl();
}

[HttpGet]
[Route("{legalEntityCode}/AgreementNotSigned")]
[Deprecated]
public ActionResult AgreementNotSigned(LegalEntitySignedAgreementViewModel viewModel)
{
return RedirectPermanentCommitmentsUrl();
@@ -83,6 +89,7 @@ public ActionResult AgreementNotSigned(LegalEntitySignedAgreementViewModel viewM
[Route("{hashedCommitmentId}/apprenticeships/{hashedApprenticeshipId}/edit")]
[Route("{hashedCommitmentId}/apprenticeships/{hashedApprenticeshipId}/view")]
[Route("{hashedCommitmentId}/Apprenticeships/{hashedApprenticeshipId}/Delete")]
[Deprecated]
public ActionResult EditApprenticeship(string hashedAccountId, string hashedCommitmentId, string hashedApprenticeshipId)
{
return RedirectPermanentCommitmentsUrl();
@@ -91,6 +98,7 @@ public ActionResult EditApprenticeship(string hashedAccountId, string hashedComm
[HttpGet]
[OutputCache(CacheProfile = "NoCache")]
[Route("{hashedCommitmentId}/submit")]
[Deprecated]
public ActionResult SubmitExistingCommitment(string hashedAccountId, string hashedCommitmentId)
{
return RedirectPermanentCommitmentsUrl();
@@ -99,20 +107,23 @@ public ActionResult SubmitExistingCommitment(string hashedAccountId, string hash
[HttpGet]
[OutputCache(CacheProfile = "NoCache")]
[Route("Submit")]
[Deprecated]
public ActionResult SubmitNewCommitment(string hashedAccountId, string legalEntityCode, string legalEntityName, string legalEntityAddress, short legalEntitySource, string providerId, string providerName, string cohortRef)
{
return RedirectPermanentCommitmentsUrl();
}

[HttpGet]
[Route("{hashedCommitmentId}/NewCohortAcknowledgement")]
[Deprecated]
public ActionResult AcknowledgementNew(string hashedAccountId, string hashedCommitmentId)
{
return RedirectPermanentCommitmentsUrl();
}

[HttpGet]
[Route("{hashedCommitmentId}/Acknowledgement")]
[Deprecated]
public ActionResult AcknowledgementExisting(string hashedAccountId, string hashedCommitmentId)
{
return RedirectPermanentCommitmentsUrl();
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using System.Configuration;
using System.Web.Mvc;
using System.Web.Mvc;
using SFA.DAS.Authorization.Mvc.Attributes;
using SFA.DAS.EAS.Domain.Configuration;
using SFA.DAS.EAS.Web.Helpers;
using SFA.DAS.EAS.Infrastructure.Attributes;
using SFA.DAS.NLog.Logger;

namespace SFA.DAS.EAS.Web.Controllers
@@ -23,6 +22,7 @@ public EmployerManageApprenticesController(EmployerApprenticeshipsServiceConfigu
[HttpGet]
[Route("all")]
[OutputCache(CacheProfile = "NoCache")]
[Deprecated]
public ActionResult ListAll(string hashedAccountId)
{
return RedirectPermanentCommitmentsUrl();
@@ -33,6 +33,7 @@ public ActionResult ListAll(string hashedAccountId)
[Route("{hashedApprenticeshipId}/details", Name = "OnProgrammeApprenticeshipDetails")]
[Route("{hashedApprenticeshipId}/details/statuschange", Name = "ChangeStatusSelectOption")]
[Route("{hashedApprenticeshipId}/edit", Name = "EditApprenticeship")]
[Deprecated]
public ActionResult Details(string hashedAccountId, string hashedApprenticeshipId)
{
_logger.Info($"To track Apprentice V1 details UrlReferrer Request: {HttpContext.Request.UrlReferrer}");
@@ -43,6 +44,7 @@ public ActionResult Details(string hashedAccountId, string hashedApprenticeshipI
[HttpGet]
[Route("{hashedApprenticeshipId}/details/statuschange/{changeType}/whentoapply", Name = "WhenToApplyChange")]
[OutputCache(CacheProfile = "NoCache")]
[Deprecated]
public ActionResult WhenToApplyChange(string hashedAccountId, string hashedApprenticeshipId)
{
return RedirectPermanentCommitmentsUrl();
@@ -51,6 +53,7 @@ public ActionResult WhenToApplyChange(string hashedAccountId, string hashedAppre
[HttpGet]
[Route("{hashedApprenticeshipId}/details/statuschange/{changeType}/confirm", Name = "StatusChangeConfirmation")]
[OutputCache(CacheProfile = "NoCache")]
[Deprecated]
public ActionResult StatusChangeConfirmation(string hashedAccountId, string hashedApprenticeshipId)
{
return RedirectPermanentCommitmentsUrl();
@@ -62,13 +65,15 @@ public ActionResult StatusChangeConfirmation(string hashedAccountId, string hash
[Route("{hashedApprenticeshipId}/changes/review", Name = "ReviewChanges")]
[Route("{hashedApprenticeshipId}/datalock/restart", Name = "RequestRestart")]
[Route("{hashedApprenticeshipId}/datalock/changes", Name = "RequestChanges")]
[Deprecated]
public ActionResult ConfirmChanges(string hashedAccountId, string hashedApprenticeshipId)
{
return RedirectPermanentCommitmentsUrl();
}

[HttpGet]
[Route("paymentorder", Name = "PaymentOrder")]
[Deprecated]
public ActionResult PaymentOrder(string hashedAccountId)
{
return RedirectPermanentCommitmentsUrl();
2 changes: 1 addition & 1 deletion src/SFA.DAS.EAS.Web/SFA.DAS.EAS.Web.csproj
Original file line number Diff line number Diff line change
@@ -690,4 +690,4 @@
</Target>
<Target Name="AfterBuild">
</Target> -->
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Web.Mvc;
using SFA.DAS.Authorization.Mvc.Attributes;
using SFA.DAS.EAS.Infrastructure.Attributes;
using SFA.DAS.EmployerAccounts.Configuration;
using SFA.DAS.EmployerAccounts.Web.ViewModels;

@@ -22,6 +23,7 @@ public EmployerCommitmentsController(EmployerAccountsConfiguration employerAccou
[Route("cohorts/provider")]
[Route("Inform")]
[Route("confirmProvider/create")]
[Deprecated]
public ActionResult Index(string hashedAccountId)
{
return RedirectPermanentCommitmentsUrl();
@@ -31,27 +33,31 @@ public ActionResult Index(string hashedAccountId)
[OutputCache(CacheProfile = "NoCache")]
[Route("cohorts")]
[Route("cohorts/draft")]
[Deprecated]
public ActionResult YourCohorts(string hashedAccountId)
{
return RedirectPermanentCommitmentsUrl();
}

[HttpGet]
[Route("legalEntity/create")]
[Deprecated]
public ActionResult SelectLegalEntity(string hashedAccountId, string cohortRef = "")
{
return RedirectPermanentCommitmentsUrl();
}

[HttpGet]
[Route("provider/create")]
[Deprecated]
public ActionResult SearchProvider(string hashedAccountId, string legalEntityCode, string cohortRef)
{
return RedirectPermanentCommitmentsUrl();
}

[HttpGet]
[Route("choosePath/create")]
[Deprecated]
public ActionResult ChoosePath(string hashedAccountId, string legalEntityCode, string providerId, string cohortRef)
{
return RedirectPermanentCommitmentsUrl();
@@ -64,13 +70,15 @@ public ActionResult ChoosePath(string hashedAccountId, string legalEntityCode, s
[Route("{hashedCommitmentId}/apprenticeships/create")]
[Route("{hashedCommitmentId}/finished")]
[Route("{hashedCommitmentId}/CohortApproved")]
[Deprecated]
public ActionResult Details(string hashedAccountId, string hashedCommitmentId)
{
return RedirectPermanentCommitmentsUrl();
}

[HttpGet]
[Route("{legalEntityCode}/AgreementNotSigned")]
[Deprecated]
public ActionResult AgreementNotSigned(LegalEntitySignedAgreementViewModel viewModel)
{
return RedirectPermanentCommitmentsUrl();
@@ -81,6 +89,7 @@ public ActionResult AgreementNotSigned(LegalEntitySignedAgreementViewModel viewM
[Route("{hashedCommitmentId}/apprenticeships/{hashedApprenticeshipId}/edit")]
[Route("{hashedCommitmentId}/apprenticeships/{hashedApprenticeshipId}/view")]
[Route("{hashedCommitmentId}/Apprenticeships/{hashedApprenticeshipId}/Delete")]
[Deprecated]
public ActionResult EditApprenticeship(string hashedAccountId, string hashedCommitmentId, string hashedApprenticeshipId)
{
return RedirectPermanentCommitmentsUrl();
@@ -89,6 +98,7 @@ public ActionResult EditApprenticeship(string hashedAccountId, string hashedComm
[HttpGet]
[OutputCache(CacheProfile = "NoCache")]
[Route("{hashedCommitmentId}/submit")]
[Deprecated]
public ActionResult SubmitExistingCommitment(string hashedAccountId, string hashedCommitmentId)
{
return RedirectPermanentCommitmentsUrl();
@@ -97,20 +107,23 @@ public ActionResult SubmitExistingCommitment(string hashedAccountId, string hash
[HttpGet]
[OutputCache(CacheProfile = "NoCache")]
[Route("Submit")]
[Deprecated]
public ActionResult SubmitNewCommitment(string hashedAccountId, string legalEntityCode, string legalEntityName, string legalEntityAddress, short legalEntitySource, string providerId, string providerName, string cohortRef)
{
return RedirectPermanentCommitmentsUrl();
}

[HttpGet]
[Route("{hashedCommitmentId}/NewCohortAcknowledgement")]
[Deprecated]
public ActionResult AcknowledgementNew(string hashedAccountId, string hashedCommitmentId)
{
return RedirectPermanentCommitmentsUrl();
}

[HttpGet]
[Route("{hashedCommitmentId}/Acknowledgement")]
[Deprecated]
public ActionResult AcknowledgementExisting(string hashedAccountId, string hashedCommitmentId)
{
return RedirectPermanentCommitmentsUrl();
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Web.Mvc;
using SFA.DAS.Authorization.Mvc.Attributes;
using SFA.DAS.EAS.Infrastructure.Attributes;
using SFA.DAS.EmployerAccounts.Configuration;
using SFA.DAS.NLog.Logger;

@@ -21,6 +22,7 @@ public EmployerManageApprenticesController(EmployerAccountsConfiguration employe
[HttpGet]
[Route("all")]
[OutputCache(CacheProfile = "NoCache")]
[Deprecated]
public ActionResult ListAll(string hashedAccountId)
{
return RedirectPermanentCommitmentsUrl();
@@ -31,6 +33,7 @@ public ActionResult ListAll(string hashedAccountId)
[Route("{hashedApprenticeshipId}/details", Name = "OnProgrammeApprenticeshipDetails")]
[Route("{hashedApprenticeshipId}/details/statuschange", Name = "ChangeStatusSelectOption")]
[Route("{hashedApprenticeshipId}/edit", Name = "EditApprenticeship")]
[Deprecated]
public ActionResult Details(string hashedAccountId, string hashedApprenticeshipId)
{
_logger.Info($"To track Apprentice V1 details UrlReferrer Request: {HttpContext.Request.UrlReferrer}");
@@ -41,6 +44,7 @@ public ActionResult Details(string hashedAccountId, string hashedApprenticeshipI
[HttpGet]
[Route("{hashedApprenticeshipId}/details/statuschange/{changeType}/whentoapply", Name = "WhenToApplyChange")]
[OutputCache(CacheProfile = "NoCache")]
[Deprecated]
public ActionResult WhenToApplyChange(string hashedAccountId, string hashedApprenticeshipId)
{
return RedirectPermanentCommitmentsUrl();
@@ -49,6 +53,7 @@ public ActionResult WhenToApplyChange(string hashedAccountId, string hashedAppre
[HttpGet]
[Route("{hashedApprenticeshipId}/details/statuschange/{changeType}/confirm", Name = "StatusChangeConfirmation")]
[OutputCache(CacheProfile = "NoCache")]
[Deprecated]
public ActionResult StatusChangeConfirmation(string hashedAccountId, string hashedApprenticeshipId)
{
return RedirectPermanentCommitmentsUrl();
@@ -60,13 +65,15 @@ public ActionResult StatusChangeConfirmation(string hashedAccountId, string hash
[Route("{hashedApprenticeshipId}/changes/review", Name = "ReviewChanges")]
[Route("{hashedApprenticeshipId}/datalock/restart", Name = "RequestRestart")]
[Route("{hashedApprenticeshipId}/datalock/changes", Name = "RequestChanges")]
[Deprecated]
public ActionResult ConfirmChanges(string hashedAccountId, string hashedApprenticeshipId)
{
return RedirectPermanentCommitmentsUrl();
}

[HttpGet]
[Route("paymentorder", Name = "PaymentOrder")]
[Deprecated]
public ActionResult PaymentOrder(string hashedAccountId)
{
return RedirectPermanentCommitmentsUrl();
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using NLog;
using System;
using System.Web.Mvc;

namespace SFA.DAS.EAS.Infrastructure.Attributes
{
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
public class DeprecatedAttribute : ActionFilterAttribute
{
private static readonly ILogger Logger = LogManager.GetCurrentClassLogger();

public override void OnActionExecuting(ActionExecutingContext filterContext)
{
var urlReferrer = filterContext.RequestContext.HttpContext.Request.UrlReferrer;
var referrer = urlReferrer == null ? "unknown" : urlReferrer.ToString();

var rawUrl = filterContext.RequestContext.HttpContext.Request.RawUrl;

var controllerName = filterContext.ActionDescriptor.ControllerDescriptor.ControllerName;
var actionName = filterContext.ActionDescriptor.ActionName;

Logger.Info($"To track Apprentice V1 details landing on EAS: UrlReferrer Request: {referrer} Request to Page: {rawUrl} Handled At: {controllerName}.{actionName}");
base.OnActionExecuting(filterContext);
}
}
}
Original file line number Diff line number Diff line change
@@ -58,6 +58,7 @@
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="Attributes\DeprecatedAttribute.cs" />
<Compile Include="Data\AccountIdUserTableParam.cs" />
<Compile Include="Data\SqlAzureDbConfiguration.cs" />
<Compile Include="Data\EmployerFinanceDbContext.cs" />

0 comments on commit d42458e

Please sign in to comment.