diff --git a/DigitalLearningSolutions.Data/DataServices/FrameworkDataService.cs b/DigitalLearningSolutions.Data/DataServices/FrameworkDataService.cs index 206a0581a1..c5ff0af01f 100644 --- a/DigitalLearningSolutions.Data/DataServices/FrameworkDataService.cs +++ b/DigitalLearningSolutions.Data/DataServices/FrameworkDataService.cs @@ -80,13 +80,13 @@ int adminId IEnumerable GetAssessmentQuestions(int frameworkId, int adminId); - FrameworkDefaultQuestionUsage? GetFrameworkDefaultQuestionUsage(int frameworkId, int assessmentQuestionId); + FrameworkDefaultQuestionUsage GetFrameworkDefaultQuestionUsage(int frameworkId, int assessmentQuestionId); IEnumerable GetAssessmentQuestionsForCompetency(int frameworkCompetencyId, int adminId); - AssessmentQuestionDetail? GetAssessmentQuestionDetailById(int assessmentQuestionId, int adminId); + AssessmentQuestionDetail GetAssessmentQuestionDetailById(int assessmentQuestionId, int adminId); - LevelDescriptor? GetLevelDescriptorForAssessmentQuestionId(int assessmentQuestionId, int adminId, int level); + LevelDescriptor GetLevelDescriptorForAssessmentQuestionId(int assessmentQuestionId, int adminId, int level); IEnumerable GetSignpostingResourceParametersByFrameworkAndCompetencyId(int frameworkId, int competencyId); @@ -122,7 +122,7 @@ bool zeroBased FrameworkReviewOutcomeNotification? GetFrameworkReviewNotification(int reviewId); //INSERT DATA - BrandedFramework? CreateFramework(DetailFramework detailFramework, int adminId); + BrandedFramework CreateFramework(DetailFramework detailFramework, int adminId); int InsertCompetencyGroup(string groupName, string? groupDescription, int adminId, int? frameworkId); @@ -367,7 +367,7 @@ public FrameworkDataService(IDbConnection connection, ILogger( $@"SELECT {BaseFrameworkFields} @@ -377,7 +377,7 @@ public FrameworkDataService(IDbConnection connection, ILogger( $@"SELECT {BaseFrameworkFields} {BrandedFrameworkFields} @@ -484,7 +484,7 @@ public IEnumerable GetAllCompetenciesForAdminId(string name ); } - public BrandedFramework? CreateFramework(DetailFramework detailFramework, int adminId) + public BrandedFramework CreateFramework(DetailFramework detailFramework, int adminId) { string frameworkName = detailFramework.FrameworkName; var description = detailFramework.Description; @@ -532,7 +532,7 @@ public IEnumerable GetAllCompetenciesForAdminId(string name return new BrandedFramework(); } - return connection.QueryFirstOrDefault( + return connection.QueryFirstOrDefault( $@"SELECT {BaseFrameworkFields} FROM {FrameworkTables} WHERE FrameworkName = @frameworkName AND OwnerAdminID = @adminId", @@ -867,7 +867,7 @@ public IEnumerable GetFrameworkCompetencyGroups(int fr @"SELECT fcg.ID, fcg.CompetencyGroupID, cg.Name, cg.Description, fcg.Ordering, fc.ID, c.ID AS CompetencyID, c.Name, c.Description, fc.Ordering, COUNT(caq.AssessmentQuestionID) AS AssessmentQuestions ,(SELECT COUNT(*) FROM CompetencyLearningResources clr WHERE clr.CompetencyID = c.ID AND clr.RemovedDate IS NULL) AS CompetencyLearningResourcesCount FROM FrameworkCompetencyGroups AS fcg INNER JOIN - CompetencyGroups AS cg ON fcg.CompetencyGroupID = cg.ID INNER JOIN + CompetencyGroups AS cg ON fcg.CompetencyGroupID = cg.ID LEFT OUTER JOIN FrameworkCompetencies AS fc ON fcg.ID = fc.FrameworkCompetencyGroupID LEFT OUTER JOIN Competencies AS c ON fc.CompetencyID = c.ID LEFT OUTER JOIN CompetencyAssessmentQuestions AS caq ON c.ID = caq.CompetencyID @@ -1519,7 +1519,7 @@ FROM AssessmentQuestionInputTypes" ); } - public FrameworkDefaultQuestionUsage? GetFrameworkDefaultQuestionUsage(int frameworkId, int assessmentQuestionId) + public FrameworkDefaultQuestionUsage GetFrameworkDefaultQuestionUsage(int frameworkId, int assessmentQuestionId) { return connection.QueryFirstOrDefault( @"SELECT @assessmentQuestionId AS ID, @@ -1620,7 +1620,7 @@ FROM CompetencyAssessmentQuestions INNER JOIN } } - public AssessmentQuestionDetail? GetAssessmentQuestionDetailById(int assessmentQuestionId, int adminId) + public AssessmentQuestionDetail GetAssessmentQuestionDetailById(int assessmentQuestionId, int adminId) { return connection.QueryFirstOrDefault( $@"{AssessmentQuestionFields}{AssessmentQuestionDetailFields} @@ -1630,7 +1630,7 @@ FROM CompetencyAssessmentQuestions INNER JOIN ); } - public LevelDescriptor? GetLevelDescriptorForAssessmentQuestionId( + public LevelDescriptor GetLevelDescriptorForAssessmentQuestionId( int assessmentQuestionId, int adminId, int level @@ -2501,7 +2501,7 @@ FROM Flags AS f FOR XML PATH(''), TYPE).value('.', 'NVARCHAR(MAX)'), 1, 2, '') AS FlagsCsv FROM Competencies AS c INNER JOIN - FrameworkCompetencies AS fc ON c.ID = fc.CompetencyID INNER JOIN + FrameworkCompetencies AS fc ON c.ID = fc.CompetencyID LEFT JOIN FrameworkCompetencyGroups AS fcg ON fc.FrameworkCompetencyGroupID = fcg.ID LEFT JOIN CompetencyGroups AS cg ON fcg.CompetencyGroupID = cg.ID WHERE (fc.FrameworkID = @frameworkId)