From d23682bf66791b3351772708db7ca0317259b878 Mon Sep 17 00:00:00 2001 From: Auldrin-Possa Date: Thu, 25 Sep 2025 16:16:20 +0100 Subject: [PATCH] TD-6106- SelfAssessmentProcessAgreed set to null upon removal of candidate assessment. --- .../CandidateAssessmentsDataService.cs | 2 +- .../SelfAssessmentDataService/SelfAssessmentDataService.cs | 3 ++- .../DataServices/SupervisorDataService.cs | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/DigitalLearningSolutions.Data/DataServices/SelfAssessmentDataService/CandidateAssessmentsDataService.cs b/DigitalLearningSolutions.Data/DataServices/SelfAssessmentDataService/CandidateAssessmentsDataService.cs index aae3988660..4f3677edca 100644 --- a/DigitalLearningSolutions.Data/DataServices/SelfAssessmentDataService/CandidateAssessmentsDataService.cs +++ b/DigitalLearningSolutions.Data/DataServices/SelfAssessmentDataService/CandidateAssessmentsDataService.cs @@ -423,7 +423,7 @@ public void SetSubmittedDateNow(int selfAssessmentId, int delegateUserId) public void RemoveEnrolment(int selfAssessmentId, int delegateUserId) { connection.Execute( - @"UPDATE CandidateAssessments SET RemovedDate = GETDATE() + @"UPDATE CandidateAssessments SET RemovedDate = GETDATE(), SelfAssessmentProcessAgreed = NULL WHERE SelfAssessmentID = @selfAssessmentId AND DelegateUserID = @delegateUserId", new { selfAssessmentId, delegateUserId } ); diff --git a/DigitalLearningSolutions.Data/DataServices/SelfAssessmentDataService/SelfAssessmentDataService.cs b/DigitalLearningSolutions.Data/DataServices/SelfAssessmentDataService/SelfAssessmentDataService.cs index ad32f35ba2..bc47f8eb21 100644 --- a/DigitalLearningSolutions.Data/DataServices/SelfAssessmentDataService/SelfAssessmentDataService.cs +++ b/DigitalLearningSolutions.Data/DataServices/SelfAssessmentDataService/SelfAssessmentDataService.cs @@ -745,7 +745,8 @@ public void RemoveDelegateSelfAssessment(int candidateAssessmentsId) connection.Execute( @"BEGIN TRY BEGIN TRANSACTION - UPDATE CandidateAssessments SET RemovedDate = GETUTCDATE(), RemovalMethodID = 2 + UPDATE CandidateAssessments SET RemovedDate = GETUTCDATE(), RemovalMethodID = 2, + SelfAssessmentProcessAgreed = NULL WHERE ID = @candidateAssessmentsId AND RemovedDate IS NULL COMMIT TRANSACTION diff --git a/DigitalLearningSolutions.Data/DataServices/SupervisorDataService.cs b/DigitalLearningSolutions.Data/DataServices/SupervisorDataService.cs index dd435aa1e8..0abb090205 100644 --- a/DigitalLearningSolutions.Data/DataServices/SupervisorDataService.cs +++ b/DigitalLearningSolutions.Data/DataServices/SupervisorDataService.cs @@ -1000,7 +1000,8 @@ public bool RemoveCandidateAssessment(int candidateAssessmentId) @" BEGIN TRY BEGIN TRANSACTION - UPDATE CandidateAssessments SET RemovedDate = getUTCDate(), RemovalMethodID = 2 + UPDATE CandidateAssessments SET RemovedDate = getUTCDate(), RemovalMethodID = 2, + SelfAssessmentProcessAgreed = NULL WHERE ID = @candidateAssessmentId AND RemovedDate IS NULL COMMIT TRANSACTION