From e1f0aaf895c5482ac6f9eb3b530b7c938e59330c Mon Sep 17 00:00:00 2001 From: Ben Stone Date: Thu, 15 Oct 2020 14:06:20 +0100 Subject: [PATCH 1/8] [CON-2505] Add change of provider inform page --- ...hangeProviderInformViewModelMapperTests.cs | 88 +++++++++++++++++++ .../Controllers/ApprenticeController.cs | 9 +- .../ChangeProviderInformViewModelMapper.cs | 38 ++++++++ .../Apprentice/ChangeProviderInformRequest.cs | 13 +++ .../ChangeProviderInformViewModel.cs | 12 +++ .../RouteValues/RouteNames.cs | 2 + .../Apprentice/ChangeProviderInform.cshtml | 44 ++++++++++ 7 files changed, 205 insertions(+), 1 deletion(-) create mode 100644 src/SFA.DAS.EmployerCommitmentsV2.Web.UnitTests/Mappers/Apprentice/ChangeProviderInformViewModelMapperTests.cs create mode 100644 src/SFA.DAS.EmployerCommitmentsV2.Web/Mappers/Apprentice/ChangeProviderInformViewModelMapper.cs create mode 100644 src/SFA.DAS.EmployerCommitmentsV2.Web/Models/Apprentice/ChangeProviderInformRequest.cs create mode 100644 src/SFA.DAS.EmployerCommitmentsV2.Web/Models/Apprentice/ChangeProviderInformViewModel.cs create mode 100644 src/SFA.DAS.EmployerCommitmentsV2.Web/Views/Apprentice/ChangeProviderInform.cshtml diff --git a/src/SFA.DAS.EmployerCommitmentsV2.Web.UnitTests/Mappers/Apprentice/ChangeProviderInformViewModelMapperTests.cs b/src/SFA.DAS.EmployerCommitmentsV2.Web.UnitTests/Mappers/Apprentice/ChangeProviderInformViewModelMapperTests.cs new file mode 100644 index 000000000..71710252c --- /dev/null +++ b/src/SFA.DAS.EmployerCommitmentsV2.Web.UnitTests/Mappers/Apprentice/ChangeProviderInformViewModelMapperTests.cs @@ -0,0 +1,88 @@ +using AutoFixture; +using Moq; +using NUnit.Framework; +using SFA.DAS.CommitmentsV2.Api.Client; +using SFA.DAS.CommitmentsV2.Api.Types.Responses; +using SFA.DAS.CommitmentsV2.Types; +using SFA.DAS.EmployerCommitmentsV2.Web.Mappers.Apprentice; +using SFA.DAS.EmployerCommitmentsV2.Web.Models.Apprentice; +using SFA.DAS.Encoding; +using SFA.DAS.Testing.AutoFixture; +using System.Threading; +using System.Threading.Tasks; + +namespace SFA.DAS.EmployerCommitmentsV2.Web.UnitTests.Mappers.Apprentice +{ + public class ChangeProviderInformViewModelMapperTests + { + private Mock _mockCommitmentsApiClient; + private Mock _mockEncodingService; + private GetApprenticeshipResponse _apprenticeshipResponse; + + private ChangeProviderInformViewModelMapper _mapper; + + private const long ApprenticeshipId = 10000000; + + [SetUp] + public void Arrange() + { + var autoFixture = new Fixture(); + + _apprenticeshipResponse = autoFixture.Build() + .With(a => a.Status, ApprenticeshipStatus.Stopped) + .Create(); + + + _mockCommitmentsApiClient = new Mock(); + _mockCommitmentsApiClient.Setup(a => a.GetApprenticeship(It.IsAny(), It.IsAny())) + .ReturnsAsync(_apprenticeshipResponse); + + _mockEncodingService = new Mock(); + _mockEncodingService.Setup(d => d.Decode(It.IsAny(), EncodingType.ApprenticeshipId)) + .Returns(ApprenticeshipId); + + + _mapper = new ChangeProviderInformViewModelMapper(_mockCommitmentsApiClient.Object, _mockEncodingService.Object); + } + + [Test, MoqAutoData] + public async Task ApprenticeshipHashedId_IsMapped(ChangeProviderInformRequest request) + { + var result = await _mapper.Map(request); + + Assert.AreEqual(request.ApprenticeshipHashedId, result.ApprenticeshipHashedId); + } + + [Test, MoqAutoData] + public async Task AccountHashedId_IsMapped(ChangeProviderInformRequest request) + { + var result = await _mapper.Map(request); + + Assert.AreEqual(request.AccountHashedId, result.AccountHashedId); + } + + [Test, MoqAutoData] + public async Task ApprenticeshipStatus_IsMapped(ChangeProviderInformRequest request) + { + var result = await _mapper.Map(request); + + Assert.AreEqual(ApprenticeshipStatus.Stopped, result.ApprenticeshipStatus); + } + + [Test, MoqAutoData] + public async Task WhenRequestingChangeProviderInformPage_ThenHashedApprenticeshipIdIsDecoded(ChangeProviderInformRequest request) + { + var result = await _mapper.Map(request); + + _mockEncodingService.Verify(a => a.Decode(request.ApprenticeshipHashedId, EncodingType.ApprenticeshipId), Times.Once); + } + + [Test, MoqAutoData] + public async Task WhenRequestingChangeProviderInformPage_ThenGetApprenticeshipIsCalled(ChangeProviderInformRequest request) + { + var result = await _mapper.Map(request); + + _mockCommitmentsApiClient.Verify(a => a.GetApprenticeship(ApprenticeshipId, It.IsAny()), Times.Once); + } + } +} diff --git a/src/SFA.DAS.EmployerCommitmentsV2.Web/Controllers/ApprenticeController.cs b/src/SFA.DAS.EmployerCommitmentsV2.Web/Controllers/ApprenticeController.cs index 3ab0731c7..783eb11af 100644 --- a/src/SFA.DAS.EmployerCommitmentsV2.Web/Controllers/ApprenticeController.cs +++ b/src/SFA.DAS.EmployerCommitmentsV2.Web/Controllers/ApprenticeController.cs @@ -5,7 +5,6 @@ using SFA.DAS.Authorization.Mvc.Attributes; using SFA.DAS.CommitmentsV2.Api.Client; using SFA.DAS.CommitmentsV2.Api.Types.Requests; -using SFA.DAS.CommitmentsV2.Shared.ActionResults; using SFA.DAS.CommitmentsV2.Shared.Interfaces; using SFA.DAS.Employer.Shared.UI; using SFA.DAS.Employer.Shared.UI.Attributes; @@ -89,5 +88,13 @@ public async Task EditEndDate(EditEndDateViewModel viewModel) var url = _linkGenerator.ApprenticeDetails(viewModel.AccountHashedId, viewModel.ApprenticeshipHashedId); return Redirect(url); } + + [Route("{apprenticeshipHashedId}/details/changing-training-provider", Name = RouteNames.ChangeProviderInform)] + public async Task ChangeProviderInform(ChangeProviderInformRequest request) + { + var viewModel = await _modelMapper.Map(request); + + return View(viewModel); + } } } \ No newline at end of file diff --git a/src/SFA.DAS.EmployerCommitmentsV2.Web/Mappers/Apprentice/ChangeProviderInformViewModelMapper.cs b/src/SFA.DAS.EmployerCommitmentsV2.Web/Mappers/Apprentice/ChangeProviderInformViewModelMapper.cs new file mode 100644 index 000000000..fa1f4fdd5 --- /dev/null +++ b/src/SFA.DAS.EmployerCommitmentsV2.Web/Mappers/Apprentice/ChangeProviderInformViewModelMapper.cs @@ -0,0 +1,38 @@ +using SFA.DAS.CommitmentsV2.Api.Client; +using SFA.DAS.CommitmentsV2.Shared.Interfaces; +using SFA.DAS.EmployerCommitmentsV2.Web.Models.Apprentice; +using SFA.DAS.Encoding; +using System; +using System.Threading; +using System.Threading.Tasks; + +namespace SFA.DAS.EmployerCommitmentsV2.Web.Mappers.Apprentice +{ + public class ChangeProviderInformViewModelMapper : IMapper + { + private readonly ICommitmentsApiClient _commitmentsApiClient; + private readonly IEncodingService _encodingService; + + public ChangeProviderInformViewModelMapper(ICommitmentsApiClient commitmentsApiClient, IEncodingService encodingService) + { + _commitmentsApiClient = commitmentsApiClient; + _encodingService = encodingService; + } + + public async Task Map(ChangeProviderInformRequest source) + { + var apprenticeshipId = _encodingService.Decode(source.ApprenticeshipHashedId, EncodingType.ApprenticeshipId); + + var apprenticeship = await _commitmentsApiClient.GetApprenticeship(apprenticeshipId, CancellationToken.None); + + var result = new ChangeProviderInformViewModel + { + AccountHashedId = source.AccountHashedId, + ApprenticeshipHashedId = source.ApprenticeshipHashedId, + ApprenticeshipStatus = apprenticeship.Status + }; + + return result; + } + } +} diff --git a/src/SFA.DAS.EmployerCommitmentsV2.Web/Models/Apprentice/ChangeProviderInformRequest.cs b/src/SFA.DAS.EmployerCommitmentsV2.Web/Models/Apprentice/ChangeProviderInformRequest.cs new file mode 100644 index 000000000..57be1f581 --- /dev/null +++ b/src/SFA.DAS.EmployerCommitmentsV2.Web/Models/Apprentice/ChangeProviderInformRequest.cs @@ -0,0 +1,13 @@ +using Microsoft.AspNetCore.Mvc; + +namespace SFA.DAS.EmployerCommitmentsV2.Web.Models.Apprentice +{ + public class ChangeProviderInformRequest + { + [FromRoute] + public string AccountHashedId { get; set; } + + [FromRoute] + public string ApprenticeshipHashedId { get; set; } + } +} diff --git a/src/SFA.DAS.EmployerCommitmentsV2.Web/Models/Apprentice/ChangeProviderInformViewModel.cs b/src/SFA.DAS.EmployerCommitmentsV2.Web/Models/Apprentice/ChangeProviderInformViewModel.cs new file mode 100644 index 000000000..00be709d5 --- /dev/null +++ b/src/SFA.DAS.EmployerCommitmentsV2.Web/Models/Apprentice/ChangeProviderInformViewModel.cs @@ -0,0 +1,12 @@ + +using SFA.DAS.CommitmentsV2.Types; + +namespace SFA.DAS.EmployerCommitmentsV2.Web.Models.Apprentice +{ + public class ChangeProviderInformViewModel + { + public string AccountHashedId { get; set; } + public string ApprenticeshipHashedId { get; set; } + public ApprenticeshipStatus ApprenticeshipStatus { get; set; } + } +} diff --git a/src/SFA.DAS.EmployerCommitmentsV2.Web/RouteValues/RouteNames.cs b/src/SFA.DAS.EmployerCommitmentsV2.Web/RouteValues/RouteNames.cs index d37bcf2f4..3305ea8a6 100644 --- a/src/SFA.DAS.EmployerCommitmentsV2.Web/RouteValues/RouteNames.cs +++ b/src/SFA.DAS.EmployerCommitmentsV2.Web/RouteValues/RouteNames.cs @@ -7,5 +7,7 @@ public static class RouteNames public const string ApprenticesDownload = "apprentices-download"; public const string ApprenticeDetail = "apprentice-details"; public const string ApprenticeEditEndDate = "apprentice-edit-enddate"; + + public const string ChangeProviderInform = "changing-training-provider-inform"; } } diff --git a/src/SFA.DAS.EmployerCommitmentsV2.Web/Views/Apprentice/ChangeProviderInform.cshtml b/src/SFA.DAS.EmployerCommitmentsV2.Web/Views/Apprentice/ChangeProviderInform.cshtml new file mode 100644 index 000000000..eb60dd965 --- /dev/null +++ b/src/SFA.DAS.EmployerCommitmentsV2.Web/Views/Apprentice/ChangeProviderInform.cshtml @@ -0,0 +1,44 @@ +@using SFA.DAS.CommitmentsV2.Types; +@model SFA.DAS.EmployerCommitmentsV2.Web.Models.Apprentice.ChangeProviderInformViewModel; + +@{ + ViewData["Title"] = "Changing training provider - Apprenticeship service - GOV.UK"; +} + +
+
+ +

Changing training provider

+ + @if (Model.ApprenticeshipStatus != ApprenticeshipStatus.Stopped) + { +
+ + + Warning + When you change an apprentice's training provider, their apprenticeship record with the current training provider will be stopped. + +
+ } + +

Before you request this change, you must contact the new training provider to agree the new training dates and price.

+ +

You should only change your apprentice’s training provider if:

+ +
    +
  • you’re not happy with their performance
  • +
  • they’ve stopped delivering the apprentice’s training course
  • +
  • they’re shutting down or have already shut down
  • +
+ + @if (Model.ApprenticeshipStatus != ApprenticeshipStatus.Stopped) + { + + } + else + { + + } + +
+
From 33998e70a79e27a0e00c5414c67a0c803c8bd63d Mon Sep 17 00:00:00 2001 From: Ben Stone Date: Fri, 16 Oct 2020 14:59:44 +0100 Subject: [PATCH 2/8] CON-2502 Add WIP error page and change training provider page --- .../Controllers/ApprenticeController.cs | 19 +++++++++++++++++++ .../Extensions/ILinkGeneratorExtensions.cs | 4 ++++ .../RouteValues/RouteNames.cs | 2 ++ .../ApprenticeNotStoppedError.cshtml | 6 ++++++ .../Apprentice/ChangeProviderInform.cshtml | 10 +++++++--- .../EnterNewTrainingProvider.cshtml | 6 ++++++ 6 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 src/SFA.DAS.EmployerCommitmentsV2.Web/Views/Apprentice/ApprenticeNotStoppedError.cshtml create mode 100644 src/SFA.DAS.EmployerCommitmentsV2.Web/Views/Apprentice/EnterNewTrainingProvider.cshtml diff --git a/src/SFA.DAS.EmployerCommitmentsV2.Web/Controllers/ApprenticeController.cs b/src/SFA.DAS.EmployerCommitmentsV2.Web/Controllers/ApprenticeController.cs index 783eb11af..91c396c75 100644 --- a/src/SFA.DAS.EmployerCommitmentsV2.Web/Controllers/ApprenticeController.cs +++ b/src/SFA.DAS.EmployerCommitmentsV2.Web/Controllers/ApprenticeController.cs @@ -73,6 +73,7 @@ public async Task Download(DownloadRequest request) } [Route("{apprenticeshipHashedId}/details/editenddate", Name = RouteNames.ApprenticeEditEndDate)] + [DasAuthorize(EmployerFeature.ManageApprenticesV2)] public async Task EditEndDate(EditEndDateRequest request) { var viewModel = await _modelMapper.Map(request); @@ -80,6 +81,7 @@ public async Task EditEndDate(EditEndDateRequest request) } [Route("{apprenticeshipHashedId}/details/editenddate", Name = RouteNames.ApprenticeEditEndDate)] + [DasAuthorize(EmployerFeature.ManageApprenticesV2)] [HttpPost] public async Task EditEndDate(EditEndDateViewModel viewModel) { @@ -90,11 +92,28 @@ public async Task EditEndDate(EditEndDateViewModel viewModel) } [Route("{apprenticeshipHashedId}/details/changing-training-provider", Name = RouteNames.ChangeProviderInform)] + [DasAuthorize(EmployerFeature.ManageApprenticesV2)] public async Task ChangeProviderInform(ChangeProviderInformRequest request) { var viewModel = await _modelMapper.Map(request); return View(viewModel); } + + // Placeholder for CON-2516 - url not specified yet + [Route("{apprenticeshipHashedId}/details/stopped-error", Name = RouteNames.ApprenticeNotStoppedError)] + [DasAuthorize(EmployerFeature.ManageApprenticesV2)] + public IActionResult ApprenticeNotStoppedError() + { + return View(); + } + + // Placeholder for CON-2505 + [Route("{apprenticeshipHashedId}/details/enter-new-training-provider-name-or-reference-number", Name = RouteNames.EnterNewTrainingProvider)] + [DasAuthorize(EmployerFeature.ManageApprenticesV2)] + public IActionResult EnterNewTrainingProvider() + { + return View(); + } } } \ No newline at end of file diff --git a/src/SFA.DAS.EmployerCommitmentsV2.Web/Extensions/ILinkGeneratorExtensions.cs b/src/SFA.DAS.EmployerCommitmentsV2.Web/Extensions/ILinkGeneratorExtensions.cs index a6d9179e9..af5a2e818 100644 --- a/src/SFA.DAS.EmployerCommitmentsV2.Web/Extensions/ILinkGeneratorExtensions.cs +++ b/src/SFA.DAS.EmployerCommitmentsV2.Web/Extensions/ILinkGeneratorExtensions.cs @@ -4,6 +4,10 @@ namespace SFA.DAS.EmployerCommitmentsV2.Web.Extensions { public static class ILinkGeneratorExtensions { + public static string AccountHome(this ILinkGenerator linkGenerator, string accountHashedId) + { + return linkGenerator.AccountsLink($"accounts/{accountHashedId}/teams"); + } public static string YourOrganisationsAndAgreements(this ILinkGenerator linkGenerator, string accountHashedId) { return linkGenerator.AccountsLink($"accounts/{accountHashedId}/agreements"); diff --git a/src/SFA.DAS.EmployerCommitmentsV2.Web/RouteValues/RouteNames.cs b/src/SFA.DAS.EmployerCommitmentsV2.Web/RouteValues/RouteNames.cs index 3305ea8a6..f43233bb9 100644 --- a/src/SFA.DAS.EmployerCommitmentsV2.Web/RouteValues/RouteNames.cs +++ b/src/SFA.DAS.EmployerCommitmentsV2.Web/RouteValues/RouteNames.cs @@ -9,5 +9,7 @@ public static class RouteNames public const string ApprenticeEditEndDate = "apprentice-edit-enddate"; public const string ChangeProviderInform = "changing-training-provider-inform"; + public const string ApprenticeNotStoppedError = "aprentice-not-stopped-error"; + public const string EnterNewTrainingProvider = "enter-new-training-provider-name-or-reference-number"; } } diff --git a/src/SFA.DAS.EmployerCommitmentsV2.Web/Views/Apprentice/ApprenticeNotStoppedError.cshtml b/src/SFA.DAS.EmployerCommitmentsV2.Web/Views/Apprentice/ApprenticeNotStoppedError.cshtml new file mode 100644 index 000000000..c240cf590 --- /dev/null +++ b/src/SFA.DAS.EmployerCommitmentsV2.Web/Views/Apprentice/ApprenticeNotStoppedError.cshtml @@ -0,0 +1,6 @@ + +@* + Placeholder for CON-2516 +*@ + +

You need to wait until {apprentice} has stopped training

\ No newline at end of file diff --git a/src/SFA.DAS.EmployerCommitmentsV2.Web/Views/Apprentice/ChangeProviderInform.cshtml b/src/SFA.DAS.EmployerCommitmentsV2.Web/Views/Apprentice/ChangeProviderInform.cshtml index eb60dd965..09d62c36d 100644 --- a/src/SFA.DAS.EmployerCommitmentsV2.Web/Views/Apprentice/ChangeProviderInform.cshtml +++ b/src/SFA.DAS.EmployerCommitmentsV2.Web/Views/Apprentice/ChangeProviderInform.cshtml @@ -1,4 +1,7 @@ -@using SFA.DAS.CommitmentsV2.Types; +@inject ILinkGenerator LinkGenerator; +@using SFA.DAS.EmployerCommitmentsV2.Web.Extensions +@using SFA.DAS.CommitmentsV2.Types +@using SFA.DAS.EmployerCommitmentsV2.Web.RouteValues @model SFA.DAS.EmployerCommitmentsV2.Web.Models.Apprentice.ChangeProviderInformViewModel; @{ @@ -33,12 +36,13 @@ @if (Model.ApprenticeshipStatus != ApprenticeshipStatus.Stopped) { - + Continue } else { - + Continue } + Cancel and return to account home diff --git a/src/SFA.DAS.EmployerCommitmentsV2.Web/Views/Apprentice/EnterNewTrainingProvider.cshtml b/src/SFA.DAS.EmployerCommitmentsV2.Web/Views/Apprentice/EnterNewTrainingProvider.cshtml new file mode 100644 index 000000000..ab4271e86 --- /dev/null +++ b/src/SFA.DAS.EmployerCommitmentsV2.Web/Views/Apprentice/EnterNewTrainingProvider.cshtml @@ -0,0 +1,6 @@ + +@* + Placeholder for CON-2505 +*@ + +

Enter a new training provider

\ No newline at end of file From 0a76acf6841167f057820e3959953d54190fcb70 Mon Sep 17 00:00:00 2001 From: Ben Stone Date: Fri, 16 Oct 2020 16:15:09 +0100 Subject: [PATCH 3/8] CON-2502 Add ChangeOfProviderFeature toggle --- .../Controllers/ApprenticeController.cs | 6 +++--- .../Features/EmployerFeature.cs | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/SFA.DAS.EmployerCommitmentsV2.Web/Controllers/ApprenticeController.cs b/src/SFA.DAS.EmployerCommitmentsV2.Web/Controllers/ApprenticeController.cs index 91c396c75..4cd544363 100644 --- a/src/SFA.DAS.EmployerCommitmentsV2.Web/Controllers/ApprenticeController.cs +++ b/src/SFA.DAS.EmployerCommitmentsV2.Web/Controllers/ApprenticeController.cs @@ -92,7 +92,7 @@ public async Task EditEndDate(EditEndDateViewModel viewModel) } [Route("{apprenticeshipHashedId}/details/changing-training-provider", Name = RouteNames.ChangeProviderInform)] - [DasAuthorize(EmployerFeature.ManageApprenticesV2)] + [DasAuthorize(EmployerFeature.ChangeOfProvider)] public async Task ChangeProviderInform(ChangeProviderInformRequest request) { var viewModel = await _modelMapper.Map(request); @@ -102,7 +102,7 @@ public async Task ChangeProviderInform(ChangeProviderInformReques // Placeholder for CON-2516 - url not specified yet [Route("{apprenticeshipHashedId}/details/stopped-error", Name = RouteNames.ApprenticeNotStoppedError)] - [DasAuthorize(EmployerFeature.ManageApprenticesV2)] + [DasAuthorize(EmployerFeature.ChangeOfProvider)] public IActionResult ApprenticeNotStoppedError() { return View(); @@ -110,7 +110,7 @@ public IActionResult ApprenticeNotStoppedError() // Placeholder for CON-2505 [Route("{apprenticeshipHashedId}/details/enter-new-training-provider-name-or-reference-number", Name = RouteNames.EnterNewTrainingProvider)] - [DasAuthorize(EmployerFeature.ManageApprenticesV2)] + [DasAuthorize(EmployerFeature.ChangeOfProvider)] public IActionResult EnterNewTrainingProvider() { return View(); diff --git a/src/SFA.DAS.EmployerCommitmentsV2/Features/EmployerFeature.cs b/src/SFA.DAS.EmployerCommitmentsV2/Features/EmployerFeature.cs index 5d9aadb80..c9df5fafc 100644 --- a/src/SFA.DAS.EmployerCommitmentsV2/Features/EmployerFeature.cs +++ b/src/SFA.DAS.EmployerCommitmentsV2/Features/EmployerFeature.cs @@ -3,7 +3,9 @@ namespace SFA.DAS.EmployerCommitmentsV2.Features public static class EmployerFeature { private const string Prefix = "EmployerFeature."; + public const string EnhancedApproval = Prefix + "EnhancedApproval"; public const string ManageApprenticesV2 = Prefix + "ManageApprenticesV2"; + public const string ChangeOfProvider = Prefix + "ChangeOfProvider"; } } \ No newline at end of file From 97ca5fce045719f73e7e33d3d9c184c8d9efcff3 Mon Sep 17 00:00:00 2001 From: James King Date: Mon, 19 Oct 2020 09:50:21 +0100 Subject: [PATCH 4/8] Markup change for interruption card --- .../Apprentice/ChangeProviderInform.cshtml | 75 +++++++++++-------- 1 file changed, 43 insertions(+), 32 deletions(-) diff --git a/src/SFA.DAS.EmployerCommitmentsV2.Web/Views/Apprentice/ChangeProviderInform.cshtml b/src/SFA.DAS.EmployerCommitmentsV2.Web/Views/Apprentice/ChangeProviderInform.cshtml index 09d62c36d..9b6ca4bf3 100644 --- a/src/SFA.DAS.EmployerCommitmentsV2.Web/Views/Apprentice/ChangeProviderInform.cshtml +++ b/src/SFA.DAS.EmployerCommitmentsV2.Web/Views/Apprentice/ChangeProviderInform.cshtml @@ -8,41 +8,52 @@ ViewData["Title"] = "Changing training provider - Apprenticeship service - GOV.UK"; } -
-
- -

Changing training provider

- - @if (Model.ApprenticeshipStatus != ApprenticeshipStatus.Stopped) - { -
- - - Warning - When you change an apprentice's training provider, their apprenticeship record with the current training provider will be stopped. - -
- } - -

Before you request this change, you must contact the new training provider to agree the new training dates and price.

- -

You should only change your apprentice’s training provider if:

- -
    -
  • you’re not happy with their performance
  • -
  • they’ve stopped delivering the apprentice’s training course
  • -
  • they’re shutting down or have already shut down
  • -
+ From e9202317ab316ee6ce65fb9dca77c26a16aaea06 Mon Sep 17 00:00:00 2001 From: Ben Stone Date: Wed, 21 Oct 2020 09:30:59 +0100 Subject: [PATCH 5/8] CON-2502 Removes duplicate link generator extension method --- .../Extensions/ILinkGeneratorExtensions.cs | 6 +----- .../Views/Apprentice/ChangeProviderInform.cshtml | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/SFA.DAS.EmployerCommitmentsV2.Web/Extensions/ILinkGeneratorExtensions.cs b/src/SFA.DAS.EmployerCommitmentsV2.Web/Extensions/ILinkGeneratorExtensions.cs index af5a2e818..88f531dd3 100644 --- a/src/SFA.DAS.EmployerCommitmentsV2.Web/Extensions/ILinkGeneratorExtensions.cs +++ b/src/SFA.DAS.EmployerCommitmentsV2.Web/Extensions/ILinkGeneratorExtensions.cs @@ -4,11 +4,7 @@ namespace SFA.DAS.EmployerCommitmentsV2.Web.Extensions { public static class ILinkGeneratorExtensions { - public static string AccountHome(this ILinkGenerator linkGenerator, string accountHashedId) - { - return linkGenerator.AccountsLink($"accounts/{accountHashedId}/teams"); - } - public static string YourOrganisationsAndAgreements(this ILinkGenerator linkGenerator, string accountHashedId) + public static string YourOrganisationsAndAgreements(this ILinkGenerator linkGenerator, string accountHashedId) { return linkGenerator.AccountsLink($"accounts/{accountHashedId}/agreements"); } diff --git a/src/SFA.DAS.EmployerCommitmentsV2.Web/Views/Apprentice/ChangeProviderInform.cshtml b/src/SFA.DAS.EmployerCommitmentsV2.Web/Views/Apprentice/ChangeProviderInform.cshtml index 9b6ca4bf3..bc7df36f9 100644 --- a/src/SFA.DAS.EmployerCommitmentsV2.Web/Views/Apprentice/ChangeProviderInform.cshtml +++ b/src/SFA.DAS.EmployerCommitmentsV2.Web/Views/Apprentice/ChangeProviderInform.cshtml @@ -54,6 +54,6 @@ }

- Cancel and return to account home + Cancel and return to account home

From 86cc44b0e2d1e7cea995aa2c0ba49294f632a22a Mon Sep 17 00:00:00 2001 From: Ben Stone Date: Wed, 21 Oct 2020 09:31:34 +0100 Subject: [PATCH 6/8] CON-2502 Removes ManageApprenticesV2 attribute --- .../Controllers/ApprenticeController.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/SFA.DAS.EmployerCommitmentsV2.Web/Controllers/ApprenticeController.cs b/src/SFA.DAS.EmployerCommitmentsV2.Web/Controllers/ApprenticeController.cs index 4cd544363..9e51475c2 100644 --- a/src/SFA.DAS.EmployerCommitmentsV2.Web/Controllers/ApprenticeController.cs +++ b/src/SFA.DAS.EmployerCommitmentsV2.Web/Controllers/ApprenticeController.cs @@ -37,7 +37,6 @@ public ApprenticeController(IModelMapper modelMapper, ICookieStorageService Index(IndexRequest request) { IndexRequest savedRequest = null; @@ -64,7 +63,6 @@ public async Task Index(IndexRequest request) } [Route("download", Name = RouteNames.ApprenticesDownload)] - [DasAuthorize(EmployerFeature.ManageApprenticesV2)] public async Task Download(DownloadRequest request) { var downloadViewModel = await _modelMapper.Map(request); @@ -73,7 +71,6 @@ public async Task Download(DownloadRequest request) } [Route("{apprenticeshipHashedId}/details/editenddate", Name = RouteNames.ApprenticeEditEndDate)] - [DasAuthorize(EmployerFeature.ManageApprenticesV2)] public async Task EditEndDate(EditEndDateRequest request) { var viewModel = await _modelMapper.Map(request); @@ -81,7 +78,6 @@ public async Task EditEndDate(EditEndDateRequest request) } [Route("{apprenticeshipHashedId}/details/editenddate", Name = RouteNames.ApprenticeEditEndDate)] - [DasAuthorize(EmployerFeature.ManageApprenticesV2)] [HttpPost] public async Task EditEndDate(EditEndDateViewModel viewModel) { From 94ce5b6a216d1488e04a73108c391f2ef873c727 Mon Sep 17 00:00:00 2001 From: Ben Stone Date: Mon, 26 Oct 2020 14:01:00 +0000 Subject: [PATCH 7/8] CON-2505 Direct EmployerHome extension method to accounts home --- .../Extensions/ILinkGeneratorExtensionsTests.cs | 2 +- .../Extensions/ILinkGeneratorExtensions.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SFA.DAS.EmployerCommitmentsV2.Web.UnitTests/Extensions/ILinkGeneratorExtensionsTests.cs b/src/SFA.DAS.EmployerCommitmentsV2.Web.UnitTests/Extensions/ILinkGeneratorExtensionsTests.cs index a55402857..32cdc87c7 100644 --- a/src/SFA.DAS.EmployerCommitmentsV2.Web.UnitTests/Extensions/ILinkGeneratorExtensionsTests.cs +++ b/src/SFA.DAS.EmployerCommitmentsV2.Web.UnitTests/Extensions/ILinkGeneratorExtensionsTests.cs @@ -53,7 +53,7 @@ public void DeleteApprentice_BuildsPathCorrectly(string accountHashedId, string public void EmployerHome_BuildsPathCorrectly(string accountHashedId) { var url = _fixture.Sut.EmployerHome(accountHashedId); - Assert.AreEqual($"{_fixture.UsersLink}accounts/{accountHashedId}/teams", url); + Assert.AreEqual($"{_fixture.AccountsLink}accounts/{accountHashedId}/teams", url); } [Test, AutoData] diff --git a/src/SFA.DAS.EmployerCommitmentsV2.Web/Extensions/ILinkGeneratorExtensions.cs b/src/SFA.DAS.EmployerCommitmentsV2.Web/Extensions/ILinkGeneratorExtensions.cs index 88f531dd3..2c33022c4 100644 --- a/src/SFA.DAS.EmployerCommitmentsV2.Web/Extensions/ILinkGeneratorExtensions.cs +++ b/src/SFA.DAS.EmployerCommitmentsV2.Web/Extensions/ILinkGeneratorExtensions.cs @@ -40,7 +40,7 @@ public static string DeleteApprentice(this ILinkGenerator linkGenerator, public static string EmployerHome(this ILinkGenerator linkGenerator, string accountHashedId) { - return linkGenerator.UsersLink($"accounts/{accountHashedId}/teams"); + return linkGenerator.AccountsLink($"accounts/{accountHashedId}/teams"); } } } \ No newline at end of file From 1219fcb4203700697c85e902f4d1d24e01808d7a Mon Sep 17 00:00:00 2001 From: Ben Stone Date: Mon, 26 Oct 2020 14:48:25 +0000 Subject: [PATCH 8/8] CON-2505 Adds back button --- .../Apprentice/ChangeProviderInform.cshtml | 59 ++++++++++--------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/src/SFA.DAS.EmployerCommitmentsV2.Web/Views/Apprentice/ChangeProviderInform.cshtml b/src/SFA.DAS.EmployerCommitmentsV2.Web/Views/Apprentice/ChangeProviderInform.cshtml index bc7df36f9..d877f49bc 100644 --- a/src/SFA.DAS.EmployerCommitmentsV2.Web/Views/Apprentice/ChangeProviderInform.cshtml +++ b/src/SFA.DAS.EmployerCommitmentsV2.Web/Views/Apprentice/ChangeProviderInform.cshtml @@ -9,39 +9,39 @@ } + +@section Back +{ + +} \ No newline at end of file