Skip to content

Commit d05af01

Browse files
authored
Merge branch 'DLS-Release-v1.3.0' into Develop/Feature/TD-6277-Remove-NHSE-TEL-FRONTEND-and-replace-with-NHSUK-FRONTEND
2 parents d8a2dac + 5de5a2a commit d05af01

File tree

30 files changed

+806
-400
lines changed

30 files changed

+806
-400
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
namespace DigitalLearningSolutions.Data.Migrations
2+
{
3+
using FluentMigrator;
4+
[Migration(202508191440)]
5+
public class CreateSendRetiringSelfAssessmentNotificationSP : Migration
6+
{
7+
public override void Up()
8+
{
9+
string generalTELTeam =
10+
@"[
11+
{ ""FirstName"":"""", ""LastName"":"""", ""Email"":""[email protected]"" },
12+
{ ""FirstName"":""Anna"", ""LastName"":""Athanasopoulou"", ""Email"":""[email protected]"" },
13+
{ ""FirstName"":""Benjamin"", ""LastName"":""Witton"", ""Email"":""[email protected]"" }
14+
]";
15+
16+
Execute.Sql(@$"IF NOT EXISTS (SELECT ConfigID FROM Config WHERE ConfigName = 'GeneralTELTeam')
17+
BEGIN
18+
INSERT INTO Config VALUES ('GeneralTELTeam', '{generalTELTeam}', 0,GETDATE(), GETDATE())
19+
END"
20+
);
21+
22+
Execute.Sql(Properties.Resources.TD_5552_SendRetiringNotification);
23+
}
24+
public override void Down()
25+
{
26+
Execute.Sql(@"DELETE FROM Config WHERE ConfigName = N'GeneralTELTeam'");
27+
28+
Execute.Sql("DROP PROCEDURE [dbo].[SendRetiringSelfAssessmentNotification]");
29+
}
30+
}
31+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+

2+
3+
namespace DigitalLearningSolutions.Data.Migrations
4+
{
5+
using FluentMigrator;
6+
7+
[Migration(202509180915)]
8+
public class Alter_SendRetiringSelfAssessmentNotification : Migration
9+
{
10+
public override void Up()
11+
{
12+
Execute.Sql(Properties.Resources.TD_5552_Alter_SendRetiringSelfAssessmentNotification_Up);
13+
}
14+
public override void Down()
15+
{
16+
Execute.Sql(Properties.Resources.TD_5552_Alter_SendRetiringSelfAssessmentNotification_Down);
17+
}
18+
}
19+
}

DigitalLearningSolutions.Data.Migrations/Properties/Resources.Designer.cs

Lines changed: 72 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DigitalLearningSolutions.Data.Migrations/Properties/Resources.resx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,4 +511,13 @@
511511
<data name="TD_5535_Alter_GetActivitiesForDelegateEnrolment_Up" type="System.Resources.ResXFileRef, System.Windows.Forms">
512512
<value>..\Scripts\TD-5535-Alter_GetActivitiesForDelegateEnrolment_Up.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
513513
</data>
514+
<data name="TD_5552_SendRetiringNotification" type="System.Resources.ResXFileRef, System.Windows.Forms">
515+
<value>..\Scripts\TD-5552-SendRetiringNotification.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
516+
</data>
517+
<data name="TD_5552_Alter_SendRetiringSelfAssessmentNotification_Down" type="System.Resources.ResXFileRef, System.Windows.Forms">
518+
<value>..\Scripts\TD-5552-Alter_SendRetiringSelfAssessmentNotification_Down.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
519+
</data>
520+
<data name="TD_5552_Alter_SendRetiringSelfAssessmentNotification_Up" type="System.Resources.ResXFileRef, System.Windows.Forms">
521+
<value>..\Scripts\TD-5552-Alter_SendRetiringSelfAssessmentNotification_Up.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
522+
</data>
514523
</root>
Binary file not shown.

DigitalLearningSolutions.Data/DataServices/CompetencyAssessmentDataService.cs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -766,11 +766,11 @@ public bool UpdateCompetencyAssessmentFeaturesTaskStatus(int id, bool descriptio
766766
@"IF EXISTS (SELECT 1 FROM SelfAssessmentTaskStatus WHERE SelfAssessmentId = @id)
767767
BEGIN
768768
UPDATE SelfAssessmentTaskStatus
769-
SET IntroductoryTextTaskStatus = CASE WHEN @descriptionStatus = 1 THEN 1 ELSE NULL END,
770-
BrandingTaskStatus = CASE WHEN @providerandCategoryStatus = 1 THEN 1 ELSE NULL END,
771-
VocabularyTaskStatus = CASE WHEN @vocabularyStatus = 1 THEN 1 ELSE NULL END,
772-
WorkingGroupTaskStatus = CASE WHEN @workingGroupStatus = 1 THEN 1 ELSE NULL END,
773-
FrameworkLinksTaskStatus = CASE WHEN @AllframeworkCompetenciesStatus = 1 THEN 1 ELSE NULL END
769+
SET IntroductoryTextTaskStatus = CASE WHEN @descriptionStatus = 1 THEN 0 ELSE NULL END,
770+
BrandingTaskStatus = CASE WHEN @providerandCategoryStatus = 1 THEN 0 ELSE NULL END,
771+
VocabularyTaskStatus = CASE WHEN @vocabularyStatus = 1 THEN 0 ELSE NULL END,
772+
WorkingGroupTaskStatus = CASE WHEN @workingGroupStatus = 1 THEN 0 ELSE NULL END,
773+
FrameworkLinksTaskStatus = CASE WHEN @AllframeworkCompetenciesStatus = 1 THEN 0 ELSE NULL END
774774
WHERE SelfAssessmentId = @id;
775775
END
776776
ELSE
@@ -780,11 +780,11 @@ INSERT INTO SelfAssessmentTaskStatus
780780
VALUES
781781
(
782782
@id,
783-
CASE WHEN @descriptionStatus = 1 THEN 1 ELSE NULL END,
784-
CASE WHEN @providerandCategoryStatus = 1 THEN 1 ELSE NULL END,
785-
CASE WHEN @vocabularyStatus = 1 THEN 1 ELSE NULL END,
786-
CASE WHEN @workingGroupStatus = 1 THEN 1 ELSE NULL END,
787-
CASE WHEN @AllframeworkCompetenciesStatus = 1 THEN 1 ELSE NULL END
783+
CASE WHEN @descriptionStatus = 1 THEN 0 ELSE NULL END,
784+
CASE WHEN @providerandCategoryStatus = 1 THEN 0 ELSE NULL END,
785+
CASE WHEN @vocabularyStatus = 1 THEN 0 ELSE NULL END,
786+
CASE WHEN @workingGroupStatus = 1 THEN 0 ELSE NULL END,
787+
CASE WHEN @AllframeworkCompetenciesStatus = 1 THEN 0 ELSE NULL END
788788
);
789789
END",
790790
new { id, descriptionStatus, providerandCategoryStatus, vocabularyStatus, workingGroupStatus, AllframeworkCompetenciesStatus }
@@ -822,9 +822,7 @@ public void UpdateSelfAssessmentFromFramework( int selfAssessmentId, int? framew
822822
SET
823823
[Description] = COALESCE(F.[Description], 'No description provided'),
824824
BrandID = F.BrandID,
825-
CategoryID = F.CategoryID,
826-
CreatedByCentreID = AU.CentreID,
827-
CreatedByAdminID = F.OwnerAdminID
825+
CategoryID = F.CategoryID
828826
FROM SelfAssessments s
829827
INNER JOIN Frameworks F ON F.ID = @frameworkId
830828
INNER JOIN AdminUsers AU ON F.OwnerAdminID = AU.AdminID

DigitalLearningSolutions.Data/DataServices/SelfAssessmentDataService/CandidateAssessmentsDataService.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,11 +513,13 @@ public IEnumerable<Accessor> GetAccessor(int selfAssessmentId, int delegateUserI
513513
{
514514
return connection.Query<Accessor>(
515515
@"SELECT CASE WHEN AccessorPRN IS NOT NULL THEN AccessorName+', '+AccessorPRN ELSE AccessorName END AS AccessorList,AccessorName,AccessorPRN
516-
FROM (SELECT COALESCE(au.Forename + ' ' + au.Surname + (CASE WHEN au.Active = 1 THEN '' ELSE ' (Inactive)' END), sd.SupervisorEmail) AS AccessorName,
516+
FROM (SELECT DISTINCT COALESCE(au.Forename + ' ' + au.Surname + (CASE WHEN au.Active = 1 THEN '' ELSE ' (Inactive)' END), sd.SupervisorEmail) AS AccessorName,
517517
u.ProfessionalRegistrationNumber AS AccessorPRN
518518
FROM SupervisorDelegates AS sd
519519
INNER JOIN CandidateAssessmentSupervisors AS cas
520520
ON sd.ID = cas.SupervisorDelegateId
521+
INNER JOIN SelfAssessmentResultSupervisorVerifications AS srsv
522+
ON cas.ID = srsv.CandidateAssessmentSupervisorID
521523
INNER JOIN CandidateAssessments AS ca
522524
ON cas.CandidateAssessmentID = ca.ID
523525
LEFT OUTER JOIN AdminUsers AS au
@@ -527,7 +529,8 @@ LEFT OUTER JOIN SelfAssessmentSupervisorRoles AS sasr
527529
ON cas.SelfAssessmentSupervisorRoleID = sasr.ID
528530
INNER JOIN Users AS u ON U.PrimaryEmail = au.Email
529531
WHERE
530-
(sd.Removed IS NULL) AND (cas.Removed IS NULL) AND (ca.DelegateUserID = @DelegateUserID) AND (ca.SelfAssessmentID = @selfAssessmentId)) Accessor
532+
(ca.DelegateUserID = @DelegateUserID) AND (ca.SelfAssessmentID = @selfAssessmentId)
533+
AND (srsv.Verified IS NOT NULL)) Accessor
531534
ORDER BY AccessorName, AccessorPRN DESC",
532535
new { selfAssessmentId, delegateUserID }
533536
);

DigitalLearningSolutions.Data/Models/SessionData/Supervisor/SessionEnrolOnCompetencyAssessment.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ public class SessionEnrolOnCompetencyAssessment
66
public int? SelfAssessmentID { get; set; }
77
public DateTime? CompleteByDate { get; set; }
88
public int? SelfAssessmentSupervisorRoleId { get; set; }
9+
public bool ActionConfirmed { get; set; }
910
}
1011
}

0 commit comments

Comments
 (0)