Skip to content
Open
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
@@ -1,4 +1,4 @@
using SFA.DAS.CommitmentsV2.Api.Types.Responses;
using SFA.DAS.CommitmentsV2.Api.Types.Responses;
using SFA.DAS.CommitmentsV2.Shared.Interfaces;
using SFA.DAS.CommitmentsV2.Types;
using SFA.DAS.Encoding;
Expand Down Expand Up @@ -139,7 +139,16 @@ public async Task ApplyLearnerDataSyncUpdates(EditDraftApprenticeshipViewModel e
editModel.Cost = updatedDraftApprenticeship.Cost;
editModel.HasLearnerDataChanges = false;
editModel.LastLearnerDataSync = DateTime.UtcNow;

editModel.DeliveryModel = (DeliveryModel?)updatedDraftApprenticeship.DeliveryModel;

if (!string.IsNullOrEmpty(updatedDraftApprenticeship.CourseCode))
{
editModel.CourseCode = updatedDraftApprenticeship.CourseCode;
editModel.CourseName = updatedDraftApprenticeship.TrainingCourseName;
editModel.TrainingCourseOption = updatedDraftApprenticeship.TrainingCourseOption == string.Empty ? "-1" : updatedDraftApprenticeship.TrainingCourseOption;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a course changes then the TrainingOption would be automatically cleared would it not? But we can see this in testing. The same goes for RPL, but we can leave this issue for testing. It's rare that a course will change after RPL is added.

MaxFundingBand may also need to be updated, but that field is not correctly populated in master and is awaiting a bug fix

editModel.TrainingCourseVersion = updatedDraftApprenticeship.TrainingCourseVersion;
}

await cacheStorageService.DeleteFromCache(learnerDataSyncKey);
}
}
Loading