Skip to content

Commit 1a86b09

Browse files
authored
Merge pull request #1168 from TechnologyEnhancedLearning/Develop/Fixes/Open-API-fixes
Merge Develop/Fixes/Open-API-fixes to RC -LH EnglishlIvy 1.3.1-Open API Changes
2 parents 58a456d + a9ec81e commit 1a86b09

File tree

68 files changed

+3642
-175
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+3642
-175
lines changed

OpenAPI/LearningHub.Nhs.OpenApi.Models/Configuration/LearningHubConfig.cs

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,75 @@ public class LearningHubConfig
5555
/// </summary>
5656
public string ResourcePublishQueueRouteName { get; set; } = null!;
5757

58+
/// <summary>
59+
/// Gets or sets <see cref="Notifications"/>.
60+
/// </summary>
61+
public NotificationSetting Notifications { get; set; } = null!;
62+
63+
/// <summary>
64+
/// Gets or sets <see cref="MyContributionsUrl"/>.
65+
/// </summary>
66+
public string MyContributionsUrl { get; set; } = null!;
67+
68+
/// <summary>
69+
/// Gets or sets <see cref="MyLearningUrl"/>.
70+
/// </summary>
71+
public string MyLearningUrl { get; set; } = null!;
72+
73+
/// <summary>
74+
/// Gets or sets <see cref="MyBookmarksUrl"/>.
75+
/// </summary>
76+
public string MyBookmarksUrl { get; set; } = null!;
77+
78+
/// <summary>
79+
/// Gets or sets <see cref="SearchUrl"/>.
80+
/// </summary>
81+
public string SearchUrl { get; set; } = null!;
82+
83+
/// <summary>
84+
/// Gets or sets <see cref="AdminUrl"/>.
85+
/// </summary>
86+
public string AdminUrl { get; set; } = null!;
87+
88+
/// <summary>
89+
/// Gets or sets <see cref="ForumsUrl"/>.
90+
/// </summary>
91+
public string ForumsUrl { get; set; } = null!;
92+
93+
/// <summary>
94+
/// Gets or sets <see cref="HelpUrl"/>.
95+
/// </summary>
96+
public string HelpUrl { get; set; } = null!;
97+
98+
/// <summary>
99+
/// Gets or sets <see cref="MyRecordsUrl"/>.
100+
/// </summary>
101+
public string MyRecordsUrl { get; set; } = null!;
102+
103+
/// <summary>
104+
/// Gets or sets <see cref="NotificationsUrl"/>.
105+
/// </summary>
106+
public string NotificationsUrl { get; set; } = null!;
107+
108+
/// <summary>
109+
/// Gets or sets <see cref="RegisterUrl"/>.
110+
/// </summary>
111+
public string RegisterUrl { get; set; } = null!;
112+
113+
/// <summary>
114+
/// Gets or sets <see cref="SignOutUrl"/>.
115+
/// </summary>
116+
public string SignOutUrl { get; set; } = null!;
117+
118+
/// <summary>
119+
/// Gets or sets <see cref="MyAccountUrl"/>.
120+
/// </summary>
121+
public string MyAccountUrl { get; set; } = null!;
122+
123+
/// <summary>
124+
/// Gets or sets <see cref="BrowseCataloguesUrl"/>.
125+
/// </summary>
126+
public string BrowseCataloguesUrl { get; set; } = null!;
127+
58128
}
59129
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace LearningHub.Nhs.OpenApi.Models.Configuration
8+
{
9+
/// <summary>
10+
/// Gets or sets NotificationSetting.
11+
/// </summary>
12+
public class NotificationSetting
13+
{
14+
/// <summary>
15+
/// Gets or sets the PublishResourceTimeToProcessInSec.
16+
/// </summary>
17+
public int PublishResourceTimeToProcessInSec { get; set; }
18+
19+
/// <summary>
20+
/// Gets or sets the ResourcePublishedTitle.
21+
/// </summary>
22+
public string ResourcePublishedTitle { get; set; } = null!;
23+
24+
/// <summary>
25+
/// Gets or sets the ResourcePublished.
26+
/// </summary>
27+
public string ResourcePublished { get; set; } = null!;
28+
29+
/// <summary>
30+
/// Gets or sets the ResourcePublishFailedTitle.
31+
/// </summary>
32+
public string ResourcePublishFailedTitle { get; set; } = null!;
33+
34+
/// <summary>
35+
/// Gets or sets the ResourcePublishFailed.
36+
/// </summary>
37+
public string ResourcePublishFailed { get; set; } = null!;
38+
39+
/// <summary>
40+
/// Gets or sets the ResourcePublishFailedWithReason.
41+
/// </summary>
42+
public string ResourcePublishFailedWithReason { get; set; } = null!;
43+
44+
/// <summary>
45+
/// Gets or sets the ResourceAccessTitle.
46+
/// </summary>
47+
public string ResourceAccessTitle { get; set; } = null!;
48+
49+
/// <summary>
50+
/// Gets or sets the ResourceReadonlyAccess.
51+
/// </summary>
52+
public string ResourceReadonlyAccess { get; set; } = null!;
53+
54+
/// <summary>
55+
/// Gets or sets the ResourceContributeAccess.
56+
/// </summary>
57+
public string ResourceContributeAccess { get; set; } = null!;
58+
}
59+
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
namespace LearningHub.Nhs.OpenApi.Models.ViewModels
2+
{
3+
/// <summary>
4+
/// Defines the <see cref="NavigationModel" />.
5+
/// </summary>
6+
public class NavigationModel
7+
{
8+
/// <summary>
9+
/// Gets or sets the NotificationCount.
10+
/// </summary>
11+
public int NotificationCount { get; set; }
12+
13+
/// <summary>
14+
/// Gets or sets a value indicating whether ShowAdmin.
15+
/// </summary>
16+
public bool ShowAdmin { get; set; }
17+
18+
/// <summary>
19+
/// Gets or sets a value indicating whether ShowForums.
20+
/// </summary>
21+
public bool ShowForums { get; set; }
22+
23+
/// <summary>
24+
/// Gets or sets a value indicating whether ShowHelp.
25+
/// </summary>
26+
public bool ShowHelp { get; set; }
27+
28+
/// <summary>
29+
/// Gets or sets a value indicating whether ShowMyContributions.
30+
/// </summary>
31+
public bool ShowMyContributions { get; set; }
32+
33+
/// <summary>
34+
/// Gets or sets a value indicating whether ShowMyLearning.
35+
/// </summary>
36+
public bool ShowMyLearning { get; set; }
37+
38+
/// <summary>
39+
/// Gets or sets a value indicating whether ShowMyBookmarks.
40+
/// </summary>
41+
public bool ShowMyBookmarks { get; set; }
42+
43+
/// <summary>
44+
/// Gets or sets a value indicating whether ShowSearch.
45+
/// </summary>
46+
public bool ShowSearch { get; set; }
47+
48+
/// <summary>
49+
/// Gets or sets a value indicating whether ShowMyRecords.
50+
/// </summary>
51+
public bool ShowMyRecords { get; set; }
52+
53+
/// <summary>
54+
/// Gets or sets a value indicating whether ShowNotifications.
55+
/// </summary>
56+
public bool ShowNotifications { get; set; }
57+
58+
/// <summary>
59+
/// Gets or sets a value indicating whether ShowRegister.
60+
/// </summary>
61+
public bool ShowRegister { get; set; }
62+
63+
/// <summary>
64+
/// Gets or sets a value indicating whether ShowSignOut.
65+
/// </summary>
66+
public bool ShowSignOut { get; set; }
67+
68+
/// <summary>
69+
/// Gets or sets a value indicating whether to show my account.
70+
/// </summary>
71+
public bool ShowMyAccount { get; set; }
72+
73+
/// <summary>
74+
/// Gets or sets a value indicating whether to show Browse Catalogues.
75+
/// </summary>
76+
public bool ShowBrowseCatalogues { get; set; }
77+
}
78+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
namespace LearningHub.Nhs.OpenApi.Repositories.Interface.Repositories
2+
{
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using LearningHub.Nhs.Models.Entities;
6+
7+
/// <summary>
8+
/// The NotificationRepository interface.
9+
/// </summary>
10+
public interface INotificationRepository : IGenericRepository<Notification>
11+
{
12+
/// <summary>
13+
/// The get by id async.
14+
/// </summary>
15+
/// <param name="id">The id.</param>
16+
/// <returns>The <see cref="Task"/>.</returns>
17+
Task<Notification> GetByIdAsync(int id);
18+
19+
/// <summary>
20+
/// The get all full.
21+
/// </summary>
22+
/// <returns>The <see cref="IQueryable"/>.</returns>
23+
IQueryable<Notification> GetAllFull();
24+
}
25+
}

OpenAPI/LearningHub.Nhs.OpenApi.Repositories.Interface/Repositories/IResourceRepository.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,12 @@ Task<IEnumerable<ResourceReference>> GetResourceReferencesByOriginalResourceRefe
7272
/// <returns>The <see cref="Task"/>.</returns>
7373
Task<Resource> GetByResourceVersionIdAsync(int resourceVersionId);
7474

75+
/// <summary>
76+
/// Returns a bool to indicate if the resourceVersionId corresponds to a current version of a resource.
77+
/// </summary>
78+
/// <param name="resourceVersionId">The resourceVersionId.</param>
79+
/// <returns>The <see cref="Task"/>.</returns>
80+
Task<bool> IsCurrentVersionAsync(int resourceVersionId);
81+
7582
}
7683
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
namespace LearningHub.Nhs.OpenApi.Repositories.Interface.Repositories
2+
{
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using LearningHub.Nhs.Models.Entities;
6+
using LearningHub.Nhs.Models.Enums;
7+
8+
/// <summary>
9+
/// The UserNotificationRepository interface.
10+
/// </summary>
11+
public interface IUserNotificationRepository : IGenericRepository<UserNotification>
12+
{
13+
/// <summary>
14+
/// The get by id async.
15+
/// </summary>
16+
/// <param name="id">The id.</param>
17+
/// <returns>The <see cref="Task"/>.</returns>
18+
Task<UserNotification> GetByIdAsync(int id);
19+
20+
/// <summary>
21+
/// The get by notification and user id async.
22+
/// </summary>
23+
/// <param name="userId">The user id.</param>
24+
/// <param name="notificationId">The notification id.</param>
25+
/// <returns>The <see cref="Task"/>.</returns>
26+
Task<UserNotification> GetByNotificationAndUserIdAsync(int userId, int notificationId);
27+
28+
/// <summary>
29+
/// The get user unread notification count async.
30+
/// </summary>
31+
/// <param name="userid">The userid.</param>
32+
/// <returns>The <see cref="Task"/>.</returns>
33+
Task<int> GetUserUnreadNotificationCountAsync(int userid);
34+
35+
/// <summary>
36+
/// The get all non dismissed.
37+
/// </summary>
38+
/// <param name="userId">The user id.</param>
39+
/// <param name="priorityType">Notification priority type.</param>
40+
/// <param name="sortColumn">The sort column.</param>
41+
/// <param name="sortDirection">The sort direction.</param>
42+
/// <returns>The <see cref="IQueryable"/>.</returns>
43+
IQueryable<UserSpecificNotification> GetAllNonDismissed(int userId, NotificationPriorityEnum priorityType, string sortColumn = "", string sortDirection = "");
44+
}
45+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
namespace LearningHub.Nhs.OpenApi.Repositories.Interface.Repositories.Resources
2+
{
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using System.Threading.Tasks;
6+
using LearningHub.Nhs.Models.Entities.Resource;
7+
8+
/// <summary>
9+
/// The IResourceSyncRepository.
10+
/// </summary>
11+
public interface IResourceSyncRepository
12+
{
13+
/// <summary>
14+
/// The GetSyncListForUser.
15+
/// </summary>
16+
/// <param name="userId">The userid.</param>
17+
/// <param name="includeResources">If the resource property should be populated.</param>
18+
/// <returns>The sync list for the user.</returns>
19+
IQueryable<ResourceSync> GetSyncListForUser(int userId, bool includeResources);
20+
21+
/// <summary>
22+
/// The AddToSyncListAsync.
23+
/// </summary>
24+
/// <param name="userId">The userId.</param>
25+
/// <param name="resourceIds">The resourceIds.</param>
26+
/// <returns>The task.</returns>
27+
Task AddToSyncListAsync(int userId, List<int> resourceIds);
28+
29+
/// <summary>
30+
/// The RemoveFromSyncListAsync.
31+
/// </summary>
32+
/// <param name="userId">The userId.</param>
33+
/// <param name="resourceIds">The resourceIds.</param>
34+
/// <returns>The task.</returns>
35+
Task RemoveFromSyncListAsync(int userId, List<int> resourceIds);
36+
37+
/// <summary>
38+
/// The SetSyncedForUserAsync.
39+
/// </summary>
40+
/// <param name="userId">The userId.</param>
41+
/// <returns>The task.</returns>
42+
Task SetSyncedForUserAsync(int userId);
43+
}
44+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
namespace LearningHub.Nhs.OpenApi.Repositories.Interface.Repositories.Resources
2+
{
3+
using System.Threading.Tasks;
4+
using LearningHub.Nhs.Models.Entities.Resource;
5+
6+
/// <summary>
7+
/// The ResourceVersionEventRepository interface.
8+
/// </summary>
9+
public interface IResourceVersionRatingRepository : IGenericRepository<ResourceVersionRating>
10+
{
11+
/// <summary>
12+
/// Gets a user's previous rating for any minor version of the current major resource version.
13+
/// </summary>
14+
/// <param name="resourceVersionId">The resourceVersionId.</param>
15+
/// <param name="userId">The userId.</param>
16+
/// <returns>The <see cref="Task"/>.</returns>
17+
Task<ResourceVersionRating> GetUsersPreviousRatingForSameMajorVersionAsync(int resourceVersionId, int userId);
18+
19+
/// <summary>
20+
/// Gets the total rating counts for a particular resource version PLUS all other minor versions of the same major version.
21+
/// </summary>
22+
/// <param name="resourceVersionId">The resourceVersionId.</param>
23+
/// <returns>An array of integers, which are the count for each star value, starting at 1 star and ending with 5 stars.</returns>
24+
Task<int[]> GetRatingCountsForResourceVersionAsync(int resourceVersionId);
25+
}
26+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
namespace LearningHub.Nhs.OpenApi.Repositories.Interface.Repositories.Resources
2+
{
3+
using System.Threading.Tasks;
4+
using LearningHub.Nhs.Models.Entities.Resource;
5+
6+
/// <summary>
7+
/// The ResourceVersionEventRepository interface.
8+
/// </summary>
9+
public interface IResourceVersionRatingSummaryRepository : IGenericRepository<ResourceVersionRatingSummary>
10+
{
11+
/// <summary>
12+
/// The get by resource version id async.
13+
/// </summary>
14+
/// <param name="resourceVersionId">The resource version id.</param>
15+
/// <returns>The <see cref="Task"/>.</returns>
16+
Task<ResourceVersionRatingSummary> GetByResourceVersionIdAsync(int resourceVersionId);
17+
}
18+
}

0 commit comments

Comments
 (0)