Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using SFA.DAS.Apprenticeships.Types;
using SFA.DAS.CommitmentsV2.Api.Client;
using SFA.DAS.CommitmentsV2.Api.Types.Responses;
using SFA.DAS.CommitmentsV2.Shared.Interfaces;
using SFA.DAS.CommitmentsV2.Types;
using SFA.DAS.Encoding;
using SFA.DAS.ProviderCommitments.Infrastructure.OuterApi;
Expand Down Expand Up @@ -42,6 +41,13 @@ public async Task ThenFullNameIsMappedCorrectly()
_fixture.Result.ApprenticeName.Should().Be(_fixture.ApiResponse.Apprenticeship.FirstName + " " + _fixture.ApiResponse.Apprenticeship.LastName);
}

[Test]
public async Task ThenApprenticeshipTypeMappedCorrectly()
{
await _fixture.Map();
_fixture.Result.LearningType.Should().Be(_fixture.ApiResponse.Apprenticeship.LearningType);
}

[Test]
public async Task ThenEmployerIsMappedCorrectly()
{
Expand Down Expand Up @@ -98,7 +104,7 @@ public async Task ThenAgreementIdIsMappedCorrectly()
await _fixture.Map();
_fixture.Result.AgreementId.Should().Be(_fixture.AgreementId);
}

[Test]
public async Task ThenDateOfBirthIsMappedCorrectly()
{
Expand Down Expand Up @@ -430,7 +436,6 @@ public async Task With_Single_Datalock_Then_AvailableTriageOption_Is_Mapped_Corr
_fixture.Result.AvailableTriageOption.Should().Be(expectedTriageOption);
}


[TestCase(false, DataLockErrorCode.Dlock04, DataLockErrorCode.Dlock07, DetailsViewModel.TriageOption.Update)]
[TestCase(true, DataLockErrorCode.Dlock04, DataLockErrorCode.Dlock07, DetailsViewModel.TriageOption.Both)]
[TestCase(true, DataLockErrorCode.Dlock03, DataLockErrorCode.Dlock03 | DataLockErrorCode.Dlock07, DetailsViewModel.TriageOption.Restart)]
Expand Down Expand Up @@ -498,7 +503,7 @@ public async Task ThenAPendingChangeOfPartyOriginatingFromEmployerDoesNotSetHasP

_fixture.Result.HasPendingChangeOfPartyRequest.Should().BeFalse();
}

[TestCase(null, false)]
[TestCase(OverlappingTrainingDateRequestStatus.Resolved, false)]
[TestCase(OverlappingTrainingDateRequestStatus.Rejected, false)]
Expand Down Expand Up @@ -670,7 +675,7 @@ public async Task And_PriceChangeDetailsArePopulated_Then_PriceChangeDetailsRetu
public async Task ThenPaymentStatusIsMappedCorrectly(bool paymentsFrozen, bool waitingToStart, string expectedStatus)
{
_fixture.WithPaymentsFrozenSetTo(paymentsFrozen);
_fixture.WithLearnerStatusDetailsSetTo(waitingToStart ? new LearnerStatusDetails{ LearnerStatus = LearnerStatus.WaitingToStart } : new LearnerStatusDetails { LearnerStatus = LearnerStatus.InLearning });
_fixture.WithLearnerStatusDetailsSetTo(waitingToStart ? new LearnerStatusDetails { LearnerStatus = LearnerStatus.WaitingToStart } : new LearnerStatusDetails { LearnerStatus = LearnerStatus.InLearning });

await _fixture.Map();

Expand Down Expand Up @@ -742,7 +747,7 @@ public class DetailsViewModelMapperFixture
public IEnumerable<GetManageApprenticeshipDetailsResponse.ApprenticeshipUpdate> ApprenticeshipUpdates { get; private set; }
public IEnumerable<GetManageApprenticeshipDetailsResponse.DataLock> DataLocks { get; private set; }
public IEnumerable<GetManageApprenticeshipDetailsResponse.ChangeOfPartyRequest> ChangeOfPartyRequests { get; private set; }
public IEnumerable<ApprenticeshipOverlappingTrainingDateRequest> OverlappingTrainingDateRequests{ get; private set; }
public IEnumerable<ApprenticeshipOverlappingTrainingDateRequest> OverlappingTrainingDateRequests { get; private set; }
public IEnumerable<GetManageApprenticeshipDetailsResponse.ChangeOfEmployerLink> ChangeOfEmployerChain { get; private set; }
public GetNewerTrainingProgrammeVersionsResponse GetNewerTrainingProgrammeVersionsResponse { get; private set; }
public GetTrainingProgrammeResponse GetTrainingProgrammeByStandardUIdResponse { get; private set; }
Expand Down Expand Up @@ -1005,7 +1010,7 @@ public DetailsViewModelMapperFixture WithChangeOfPartyRequest(ChangeOfPartyReque

return this;
}

public DetailsViewModelMapperFixture WithOverlappingTrainingDateRequests(OverlappingTrainingDateRequestStatus status)
{
var draftApprenticeshipId = Fixture.Create<long>();
Expand All @@ -1023,7 +1028,7 @@ public DetailsViewModelMapperFixture WithOverlappingTrainingDateRequests(Overlap
ActionedOn = null
}
};

return this;
}

Expand Down Expand Up @@ -1111,7 +1116,7 @@ public DetailsViewModelMapperFixture WithPendingPriceChangePopulated()
TrainingPrice = 3248,
Initiator = "Provider"
};

return this;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using SFA.DAS.CommitmentsV2.Api.Client;
using SFA.DAS.Apprenticeships.Types;
using SFA.DAS.CommitmentsV2.Api.Client;
using SFA.DAS.CommitmentsV2.Shared.Interfaces;
using SFA.DAS.CommitmentsV2.Types;
using SFA.DAS.Encoding;
Expand All @@ -7,9 +8,6 @@
using SFA.DAS.ProviderCommitments.Infrastructure.OuterApi.Requests.Apprentices;
using SFA.DAS.ProviderCommitments.Web.Extensions;
using SFA.DAS.ProviderCommitments.Web.Models.Apprentice;
using SFA.DAS.CommitmentsV2.Shared.Extensions;
using Azure;
using SFA.DAS.Apprenticeships.Types;

namespace SFA.DAS.ProviderCommitments.Web.Mappers.Apprentice
{
Expand Down Expand Up @@ -125,7 +123,8 @@ public async Task<DetailsViewModel> Map(DetailsRequest source)
LearnerStatus = data.LearnerStatusDetails.LearnerStatus,
WithdrawalChangedDate = data.LearnerStatusDetails.WithdrawalChangedDate,
LastCensusDateOfLearning = data.LearnerStatusDetails.LastCensusDateOfLearning,
LastDayOfLearning = data.LearnerStatusDetails.LastDayOfLearning
LastDayOfLearning = data.LearnerStatusDetails.LastDayOfLearning,
LearningType = data.Apprenticeship.LearningType,
};
}
catch (Exception e)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using SFA.DAS.ProviderCommitments.Web.ModelBinding;
using SFA.DAS.Apprenticeships.Types;
using SFA.DAS.CommitmentsV2.Shared.Extensions;
using SFA.DAS.CommitmentsV2.Types;
using SFA.DAS.ProviderCommitments.Enums;
using SFA.DAS.ProviderCommitments.Infrastructure.OuterApi.Requests.Apprentices;
using SFA.DAS.Apprenticeships.Types;
using SFA.DAS.ProviderCommitments.Web.ModelBinding;

namespace SFA.DAS.ProviderCommitments.Web.Models.Apprentice
{
Expand Down Expand Up @@ -96,6 +95,7 @@ public class DetailsViewModel : IAuthorizationContextModel
public DateTime? WithdrawalChangedDate { get; set; }
public DateTime? LastCensusDateOfLearning { get; set; }
public DateTime? LastDayOfLearning { get; set; }
public LearningType? LearningType { get; set; }

public enum DataLockSummaryStatus
{
Expand Down
Loading
Loading