From 1761847fc670cd3da4d0eef4c67db6cef38db1a0 Mon Sep 17 00:00:00 2001 From: Binon Date: Thu, 16 Apr 2026 11:50:38 +0100 Subject: [PATCH] Need to remosve some more dependency in openAPI project. --- .../Services/IFindwiseApiFacade.cs | 37 ----- .../LearningHub.Nhs.OpenApi.Services.csproj | 4 + .../Services/CatalogueService.cs | 76 +--------- .../Services/Findwise/FindwiseApiFacade.cs | 132 ------------------ .../Findwise/NullFindwiseApiFacade.cs | 59 -------- .../Services/ResourceSyncService.cs | 65 --------- .../Startup.cs | 11 -- .../Services/CatalogueServiceTests.cs | 4 +- 8 files changed, 6 insertions(+), 382 deletions(-) delete mode 100644 OpenAPI/LearningHub.Nhs.OpenApi.Services.Interface/Services/IFindwiseApiFacade.cs delete mode 100644 OpenAPI/LearningHub.Nhs.OpenApi.Services/Services/Findwise/FindwiseApiFacade.cs delete mode 100644 OpenAPI/LearningHub.Nhs.OpenApi.Services/Services/Findwise/NullFindwiseApiFacade.cs diff --git a/OpenAPI/LearningHub.Nhs.OpenApi.Services.Interface/Services/IFindwiseApiFacade.cs b/OpenAPI/LearningHub.Nhs.OpenApi.Services.Interface/Services/IFindwiseApiFacade.cs deleted file mode 100644 index dddf22fc1..000000000 --- a/OpenAPI/LearningHub.Nhs.OpenApi.Services.Interface/Services/IFindwiseApiFacade.cs +++ /dev/null @@ -1,37 +0,0 @@ -namespace LearningHub.Nhs.OpenApi.Services.Interface.Services -{ - using System.Collections.Generic; - using System.Threading.Tasks; - using LearningHub.Nhs.Models.Search; - - /// - /// The IFindwiseApiFacade. - /// - public interface IFindwiseApiFacade - { - /// - /// Modifies the information Findwise has for the catalogues provided. - /// Documents not in Findwise will be added. - /// Documents that already exist in Findwise will be replaced. - /// - /// The catalogues to add/replace in the index. - /// The task. - Task AddOrReplaceAsync(List catalogues); - - /// - /// Modifies the information Findwise has for the resources provided. - /// Documents not in Findwise will be added. - /// Documents that already exist in Findwise will be replaced. - /// - /// The resources to add/replace in the index. - /// The task. - Task AddOrReplaceAsync(List resources); - - /// - /// Removes the documents from Findwise. - /// - /// The resources to remove from Findwise. - /// The task. - Task RemoveAsync(List resources); - } -} diff --git a/OpenAPI/LearningHub.Nhs.OpenApi.Services/LearningHub.Nhs.OpenApi.Services.csproj b/OpenAPI/LearningHub.Nhs.OpenApi.Services/LearningHub.Nhs.OpenApi.Services.csproj index 291dbe784..64b868475 100644 --- a/OpenAPI/LearningHub.Nhs.OpenApi.Services/LearningHub.Nhs.OpenApi.Services.csproj +++ b/OpenAPI/LearningHub.Nhs.OpenApi.Services/LearningHub.Nhs.OpenApi.Services.csproj @@ -39,4 +39,8 @@ + + + + diff --git a/OpenAPI/LearningHub.Nhs.OpenApi.Services/Services/CatalogueService.cs b/OpenAPI/LearningHub.Nhs.OpenApi.Services/Services/CatalogueService.cs index 0dfb757e7..71696c3dd 100644 --- a/OpenAPI/LearningHub.Nhs.OpenApi.Services/Services/CatalogueService.cs +++ b/OpenAPI/LearningHub.Nhs.OpenApi.Services/Services/CatalogueService.cs @@ -51,7 +51,6 @@ public class CatalogueService : ICatalogueService private readonly IBookmarkRepository bookmarkRepository; private readonly INodeRepository nodeRepository; private readonly INodeActivityRepository nodeActivityRepository; - private readonly IFindwiseApiFacade findwiseApiFacade; private readonly LearningHubConfig learningHubConfig; private readonly FindwiseConfig findwiseConfig; private readonly INotificationSenderService notificationSenderService; @@ -78,8 +77,7 @@ public class CatalogueService : ICatalogueService /// /// /// - /// - public CatalogueService(ICatalogueRepository catalogueRepository, ICategoryService categoryService, INodeRepository nodeRepository, IUserUserGroupRepository userUserGroupRepository, IMapper mapper, IOptions findwiseConfig, IOptions learningHubConfig, ICatalogueNodeVersionRepository catalogueNodeVersionRepository, INodeResourceRepository nodeResourceRepository, IResourceVersionRepository resourceVersionRepository, IRoleUserGroupRepository roleUserGroupRepository, IProviderService providerService, ICatalogueAccessRequestRepository catalogueAccessRequestRepository, IUserRepository userRepository, IUserProfileRepository userProfileRepository, IEmailSenderService emailSenderService, IBookmarkRepository bookmarkRepository,INodeActivityRepository nodeActivityRepository, IFindwiseApiFacade findwiseApiFacade, INotificationSenderService notificationSenderService, ITimezoneOffsetManager timezoneOffsetManager) + public CatalogueService(ICatalogueRepository catalogueRepository, ICategoryService categoryService, INodeRepository nodeRepository, IUserUserGroupRepository userUserGroupRepository, IMapper mapper, IOptions findwiseConfig, IOptions learningHubConfig, ICatalogueNodeVersionRepository catalogueNodeVersionRepository, INodeResourceRepository nodeResourceRepository, IResourceVersionRepository resourceVersionRepository, IRoleUserGroupRepository roleUserGroupRepository, IProviderService providerService, ICatalogueAccessRequestRepository catalogueAccessRequestRepository, IUserRepository userRepository, IUserProfileRepository userProfileRepository, IEmailSenderService emailSenderService, IBookmarkRepository bookmarkRepository,INodeActivityRepository nodeActivityRepository, INotificationSenderService notificationSenderService, ITimezoneOffsetManager timezoneOffsetManager) { this.catalogueRepository = catalogueRepository; this.categoryService = categoryService; @@ -97,7 +95,6 @@ public CatalogueService(ICatalogueRepository catalogueRepository, ICategoryServi this.emailSenderService = emailSenderService; this.bookmarkRepository = bookmarkRepository; this.nodeActivityRepository = nodeActivityRepository; - this.findwiseApiFacade = findwiseApiFacade; this.learningHubConfig = learningHubConfig.Value; this.findwiseConfig = findwiseConfig.Value; this.timezoneOffsetManager = timezoneOffsetManager; @@ -575,24 +572,6 @@ public async Task CreateCatalogueAsync(int userId, var catalogueNodeVersionId = await this.catalogueNodeVersionRepository.CreateCatalogueAsync(userId, catalogue); - // Catalogue is in database, push to findwise - var cnv = this.catalogueNodeVersionRepository.GetAll() - .Include(x => x.NodeVersion).ThenInclude(x => x.Node) - .Include(x => x.Keywords) - .Include(x => x.CatalogueNodeVersionProvider) - .SingleOrDefault(x => x.Id == catalogueNodeVersionId); - - if (cnv != null) - { - var searchModel = this.mapper.Map(cnv); - if (searchModel.Description.Length > this.findwiseConfig.DescriptionLengthLimit) - { - searchModel.Description = searchModel.Description.Substring(0, this.findwiseConfig.DescriptionLengthLimit - 4) + "

"; - } - - await this.findwiseApiFacade.AddOrReplaceAsync(new List { searchModel }); - } - return new LearningHubValidationResult(true) { CreatedId = catalogueNodeVersionId, @@ -809,24 +788,6 @@ public async Task UpdateCatalogueAsync(int userId, await this.catalogueNodeVersionRepository.UpdateCatalogueAsync(userId, catalogue); - // Update catalogue in findwise - var cnv = this.catalogueNodeVersionRepository.GetAll() - .Include(x => x.NodeVersion).ThenInclude(x => x.Node) - .Include(x => x.Keywords) - .Include(x => x.CatalogueNodeVersionProvider) - .SingleOrDefault(x => x.Id == catalogue.CatalogueNodeVersionId); - - if (cnv != null) - { - var searchModel = this.mapper.Map(cnv); - if (searchModel.Description.Length > this.findwiseConfig.DescriptionLengthLimit) - { - searchModel.Description = searchModel.Description.Substring(0, this.findwiseConfig.DescriptionLengthLimit - 4) + "

"; - } - - await this.findwiseApiFacade.AddOrReplaceAsync(new List { searchModel }); - } - return new LearningHubValidationResult(true); } @@ -853,24 +814,6 @@ public async Task ShowCatalogueAsync(int userId, in await this.catalogueNodeVersionRepository.ShowCatalogue(userId, nodeId); - var cnv = this.catalogueNodeVersionRepository.GetAll() - .Include(x => x.NodeVersion).ThenInclude(x => x.Node) - .Include(x => x.Keywords) - .Include(x => x.CatalogueNodeVersionProvider) - .SingleOrDefault(x => x.NodeVersion.NodeId == nodeId); - - // update findwise - if (cnv != null) - { - var searchModel = this.mapper.Map(cnv); - if (searchModel.Description.Length > this.findwiseConfig.DescriptionLengthLimit) - { - searchModel.Description = searchModel.Description.Substring(0, this.findwiseConfig.DescriptionLengthLimit - 4) + "

"; - } - - await this.findwiseApiFacade.AddOrReplaceAsync(new List { searchModel }); - } - return new LearningHubValidationResult(true); } @@ -927,23 +870,6 @@ public async Task HideCatalogueAsync(int userId, int nodeId) node.Hidden = true; await this.nodeRepository.UpdateAsync(userId, node); - - // update findwise - var cnv = this.catalogueNodeVersionRepository.GetAll() - .Include(x => x.NodeVersion).ThenInclude(x => x.Node) - .Include(x => x.Keywords) - .Include(x => x.CatalogueNodeVersionProvider) - .SingleOrDefault(x => x.NodeVersion.NodeId == nodeId); - if (cnv != null) - { - var searchModel = this.mapper.Map(cnv); - if (searchModel.Description.Length > this.findwiseConfig.DescriptionLengthLimit) - { - searchModel.Description = searchModel.Description.Substring(0, this.findwiseConfig.DescriptionLengthLimit - 4) + "

"; - } - - await this.findwiseApiFacade.AddOrReplaceAsync(new List { searchModel }); - } } diff --git a/OpenAPI/LearningHub.Nhs.OpenApi.Services/Services/Findwise/FindwiseApiFacade.cs b/OpenAPI/LearningHub.Nhs.OpenApi.Services/Services/Findwise/FindwiseApiFacade.cs deleted file mode 100644 index 139c9e41c..000000000 --- a/OpenAPI/LearningHub.Nhs.OpenApi.Services/Services/Findwise/FindwiseApiFacade.cs +++ /dev/null @@ -1,132 +0,0 @@ -namespace LearningHub.Nhs.OpenApi.Services.Services.Findwise -{ - using System; - using System.Collections.Generic; - using System.Linq; - using System.Net.Http; - using System.Text; - using System.Threading.Tasks; - using LearningHub.Nhs.Models.Search; - using LearningHub.Nhs.OpenApi.Models.Configuration; - using LearningHub.Nhs.OpenApi.Services.Interface.HttpClients; - using LearningHub.Nhs.OpenApi.Services.Interface.Services; - using Microsoft.Extensions.Logging; - using Microsoft.Extensions.Options; - using Newtonsoft.Json; - - /// - /// The FindwiseApiFacade. - /// - public class FindwiseApiFacade : IFindwiseApiFacade - { - private readonly IFindwiseClient findWiseHttpClient; - private readonly FindwiseConfig findwiseConfig; - private readonly ILogger logger; - - /// - /// Initializes a new instance of the class. - /// - /// The findWiseHttpClient. - /// The options. - /// The logger. - public FindwiseApiFacade( - IFindwiseClient findWiseHttpClient, - IOptions findwiseConfig, - ILogger logger) - { - this.findWiseHttpClient = findWiseHttpClient; - this.findwiseConfig = findwiseConfig.Value; - this.logger = logger; - } - - /// - /// Modifies the information Findwise has for the catalogues provided. - /// Documents not in Findwise will be added. - /// Documents that already exist in Findwise will be replaced. - /// - /// The catalogues to add/replace in the index. - /// The task. - public async Task AddOrReplaceAsync(List catalogues) - { - var request = string.Format(this.findwiseConfig.IndexMethod, this.findwiseConfig.CollectionIds.Catalogue) - + $"?token={this.findwiseConfig.Token}"; - var response = await this.PostAsync(request, catalogues); - this.ValidateResponse(response, $"catalogues: {string.Join(',', catalogues.Select(x => x.Id))}"); - } - - /// - /// Modifies the information Findwise has for the resources provided. - /// Documents not in Findwise will be added. - /// Documents that already exist in Findwise will be replaced. - /// - /// The resources to add/replace in the index. - /// The task. - public async Task AddOrReplaceAsync(List resources) - { - var request = string.Format(this.findwiseConfig.IndexMethod, this.findwiseConfig.CollectionIds.Resource) - + $"?token={this.findwiseConfig.Token}"; - var response = await this.PostAsync(request, resources); - this.ValidateResponse(response, $"resources: {string.Join(',', resources.Select(x => x.Id))}"); - } - - /// - /// Removes the documents from Findwise. - /// - /// The resources to remove from Findwise. - /// The task. - public async Task RemoveAsync(List resources) - { - var resourceIds = resources.Select(x => x.Id); - var idQueryString = string.Join( - '&', - resourceIds.Select(x => $"id={x}")); - var request = string.Format( - this.findwiseConfig.IndexMethod, - this.findwiseConfig.CollectionIds.Resource) - + $"?{idQueryString}&token={this.findwiseConfig.Token}"; - var response = await this.DeleteAsync(request); - this.ValidateResponse(response, $"resources: {string.Join(',', resourceIds)}"); - } - - private void ValidateResponse(HttpResponseMessage response, string dataForError) - { - if (response.StatusCode == System.Net.HttpStatusCode.Unauthorized || response.StatusCode == System.Net.HttpStatusCode.Forbidden) - { - logger.LogError($"Updating FindWise failed for {dataForError} HTTP Status Code:" + response.StatusCode.ToString()); - throw new Exception("AccessDenied"); - } - else if (!response.IsSuccessStatusCode) - { - logger.LogError($"Updating FindWise failed for {dataForError} HTTP Status Code:" + response.StatusCode.ToString()); - throw new Exception("Posting of resource to search failed: " + dataForError); - } - } - - private async Task PostAsync(string request, T obj) - where T : class, new() - { - var content = GetContent(obj); - var client = await GetClientAsync(); - return await client.PostAsync(request, content).ConfigureAwait(false); - } - - private async Task DeleteAsync(string request) - { - var client = await GetClientAsync(); - return await client.DeleteAsync(request).ConfigureAwait(false); - } - - private async Task GetClientAsync() - { - return await this.findWiseHttpClient.GetClient(this.findwiseConfig.IndexUrl); - } - - private StringContent GetContent(T obj) - where T : class, new() - { - var json = JsonConvert.SerializeObject(obj, new JsonSerializerSettings() { DateFormatString = "yyyy-MM-dd" }); - - return new StringContent(json, Encoding.UTF8, "application/json"); - } - } -} diff --git a/OpenAPI/LearningHub.Nhs.OpenApi.Services/Services/Findwise/NullFindwiseApiFacade.cs b/OpenAPI/LearningHub.Nhs.OpenApi.Services/Services/Findwise/NullFindwiseApiFacade.cs deleted file mode 100644 index ef5f8d974..000000000 --- a/OpenAPI/LearningHub.Nhs.OpenApi.Services/Services/Findwise/NullFindwiseApiFacade.cs +++ /dev/null @@ -1,59 +0,0 @@ -namespace LearningHub.Nhs.OpenApi.Services.Services.Findwise -{ - using System.Collections.Generic; - using System.Threading.Tasks; - using LearningHub.Nhs.Models.Search; - using LearningHub.Nhs.OpenApi.Services.Interface.Services; - using Microsoft.Extensions.Logging; - - /// - /// Null implementation of IFindwiseApiFacade for use when Azure Search is enabled. - /// This implementation performs no operations and is used to avoid Findwise calls when using Azure Search. - /// - public class NullFindwiseApiFacade : IFindwiseApiFacade - { - private readonly ILogger logger; - - /// - /// Initializes a new instance of the class. - /// - /// The logger. - public NullFindwiseApiFacade(ILogger logger) - { - this.logger = logger; - } - - /// - /// No-op implementation. Does not add or replace catalogues in Findwise. - /// - /// The catalogues to add/replace in the index. - /// The task. - public Task AddOrReplaceAsync(List catalogues) - { - this.logger.LogDebug("NullFindwiseApiFacade: Skipping AddOrReplaceAsync for {Count} catalogues (Azure Search is enabled)", catalogues?.Count ?? 0); - return Task.CompletedTask; - } - - /// - /// No-op implementation. Does not add or replace resources in Findwise. - /// - /// The resources to add/replace in the index. - /// The task. - public Task AddOrReplaceAsync(List resources) - { - this.logger.LogDebug("NullFindwiseApiFacade: Skipping AddOrReplaceAsync for {Count} resources (Azure Search is enabled)", resources?.Count ?? 0); - return Task.CompletedTask; - } - - /// - /// No-op implementation. Does not remove resources from Findwise. - /// - /// The resources to remove from Findwise. - /// The task. - public Task RemoveAsync(List resources) - { - this.logger.LogDebug("NullFindwiseApiFacade: Skipping RemoveAsync for {Count} resources (Azure Search is enabled)", resources?.Count ?? 0); - return Task.CompletedTask; - } - } -} diff --git a/OpenAPI/LearningHub.Nhs.OpenApi.Services/Services/ResourceSyncService.cs b/OpenAPI/LearningHub.Nhs.OpenApi.Services/Services/ResourceSyncService.cs index ba6e4b243..921f04d7b 100644 --- a/OpenAPI/LearningHub.Nhs.OpenApi.Services/Services/ResourceSyncService.cs +++ b/OpenAPI/LearningHub.Nhs.OpenApi.Services/Services/ResourceSyncService.cs @@ -24,7 +24,6 @@ public class ResourceSyncService : IResourceSyncService private readonly IResourceVersionRepository resourceVersionRepository; private readonly ICatalogueNodeVersionRepository catalogueNodeVersionRepository; private readonly IGenericFileResourceVersionRepository genericFileResourceVersionRepository; - private readonly IFindwiseApiFacade findwiseApiFacade; private readonly IMapper mapper; /// @@ -34,21 +33,18 @@ public class ResourceSyncService : IResourceSyncService /// The resourceVersionRepository. /// The catalogueNodeVersionRepository. /// The genericFileResourceVersionRepository. - /// The findwiseApiFacade. /// The mapper. public ResourceSyncService( IResourceSyncRepository resourceSyncRepository, IResourceVersionRepository resourceVersionRepository, ICatalogueNodeVersionRepository catalogueNodeVersionRepository, IGenericFileResourceVersionRepository genericFileResourceVersionRepository, - IFindwiseApiFacade findwiseApiFacade, IMapper mapper) { this.resourceSyncRepository = resourceSyncRepository; this.resourceVersionRepository = resourceVersionRepository; this.catalogueNodeVersionRepository = catalogueNodeVersionRepository; this.genericFileResourceVersionRepository = genericFileResourceVersionRepository; - this.findwiseApiFacade = findwiseApiFacade; this.mapper = mapper; } @@ -104,46 +100,6 @@ public List GetSyncListResourcesForUser(int /// The task. public async Task SyncForUserAsync(int userId) { - // Obtain Resource Version dataset related to the sync list for the supplied User Id. - var syncList = resourceSyncRepository.GetSyncListForUser(userId, true).ToList(); - - var resources = syncList.Select(x => x.Resource).ToList(); - - // Sync Updates - var resourcesToUpdate = resources.Where(x => !this.ResourceIsUnpublished(x)).ToList(); - var resourceVersionIdList = resourcesToUpdate.Select(x => x.Id).ToList(); - var mappedResourcesToUpdate = await this.BuildSearchResourceRequestModelList(resourceVersionIdList); - - // Validate Findwise submission - var invalidResourceDetails = new List(); - foreach (var r in mappedResourcesToUpdate) - { - if (!r.IsValidForSubmission()) - { - invalidResourceDetails.Add(r.Title); - } - } - - if (invalidResourceDetails.Count > 0) - { - return new LearningHubValidationResult(false, $"The following Resources are not valid for submission: {string.Join(", ", invalidResourceDetails)}"); - } - - // Send update to Findwise - if (mappedResourcesToUpdate.Any()) - { - await findwiseApiFacade.AddOrReplaceAsync(mappedResourcesToUpdate.ToList()); - } - - // Synce Deletes - var resourcesToDelete = resources.Where(x => this.ResourceIsUnpublished(x)).ToList(); - var mappedResourcesToDelete = resourcesToDelete.Select(x => mapper.Map(x)).ToList(); - - if (mappedResourcesToDelete.Any()) - { - await findwiseApiFacade.RemoveAsync(mappedResourcesToDelete.ToList()); - } - await resourceSyncRepository.SetSyncedForUserAsync(userId); return new LearningHubValidationResult(true); @@ -243,27 +199,6 @@ public async Task BuildSearchResourceRequestModel(in /// The task. public async Task SyncSingleAsync(int resourceVersionId) { - var resourceVersion = GetResourcesWithIncludes().SingleOrDefault(x => x.Id == resourceVersionId); - if (resourceVersion == null) - { - throw new Exception($"No resource version found for id '{resourceVersionId}'"); - } - - var searchResourceRequestModel = await BuildSearchResourceRequestModel(resourceVersionId); - if (ResourceIsUnpublished(resourceVersion)) - { - await findwiseApiFacade.RemoveAsync(new List { searchResourceRequestModel }); - } - else - { - if (!searchResourceRequestModel.IsValidForSubmission()) - { - return new LearningHubValidationResult(false, $"Resource '{resourceVersion.Title}' is not valid for submission to Findwise"); - } - - await findwiseApiFacade.AddOrReplaceAsync(new List { searchResourceRequestModel }); - } - return new LearningHubValidationResult(true); } diff --git a/OpenAPI/LearningHub.Nhs.OpenApi.Services/Startup.cs b/OpenAPI/LearningHub.Nhs.OpenApi.Services/Startup.cs index 1670bc090..c2e0ae594 100644 --- a/OpenAPI/LearningHub.Nhs.OpenApi.Services/Startup.cs +++ b/OpenAPI/LearningHub.Nhs.OpenApi.Services/Startup.cs @@ -7,7 +7,6 @@ namespace LearningHub.Nhs.OpenApi.Services using LearningHub.Nhs.OpenApi.Services.Interface.Services.Messaging; using LearningHub.Nhs.OpenApi.Services.Services; using LearningHub.Nhs.OpenApi.Services.Services.AzureSearch; - using LearningHub.Nhs.OpenApi.Services.Services.Findwise; using LearningHub.Nhs.OpenApi.Services.Services.Messaging; using LearningHub.Nhs.Services; using Microsoft.Extensions.Configuration; @@ -93,16 +92,6 @@ public static void AddServices(this IServiceCollection services, IConfiguration services.AddScoped(); services.AddScoped(); services.AddScoped(); - - // Register IFindwiseApiFacade based on feature flag - if (useAzureSearch) - { - services.AddScoped(); - } - else - { - services.AddScoped(); - } } } } \ No newline at end of file diff --git a/OpenAPI/LearningHub.Nhs.OpenApi.Tests/Services/Services/CatalogueServiceTests.cs b/OpenAPI/LearningHub.Nhs.OpenApi.Tests/Services/Services/CatalogueServiceTests.cs index 29e37935a..8eec10b9d 100644 --- a/OpenAPI/LearningHub.Nhs.OpenApi.Tests/Services/Services/CatalogueServiceTests.cs +++ b/OpenAPI/LearningHub.Nhs.OpenApi.Tests/Services/Services/CatalogueServiceTests.cs @@ -38,7 +38,6 @@ public class CatalogueServiceTests private readonly Mock bookmarkRepository; private readonly Mock nodeRepository; private readonly Mock nodeActivityRepository; - private readonly Mock findwiseApiFacade; private readonly Mock> learningHubConfig; private readonly Mock> findwiseConfig; private readonly Mock notificationSenderService; @@ -65,13 +64,12 @@ public CatalogueServiceTests() this.bookmarkRepository = new Mock(); this.nodeRepository = new Mock(); this.nodeActivityRepository = new Mock(); - this.findwiseApiFacade = new Mock(); this.learningHubConfig = new Mock>(); this.findwiseConfig = new Mock>(); this.notificationSenderService = new Mock(); this.timezoneOffsetManager = new Mock(); this.categoryService = new Mock(); - this.catalogueService = new CatalogueService(this.catalogueRepository.Object, this.categoryService.Object, this.nodeRepository.Object, this.userUserGroupRepository.Object, this.mapper.Object, this.findwiseConfig.Object, this.learningHubConfig.Object, this.catalogueNodeVersionRepository.Object, this.nodeResourceRepository.Object, this.resourceVersionRepository.Object, this.roleUserGroupRepository.Object, this.providerService.Object, this.catalogueAccessRequestRepository.Object, this.userRepository.Object, this.userProfileRepository.Object, this.emailSenderService.Object, this.bookmarkRepository.Object, this.nodeActivityRepository.Object, this.findwiseApiFacade.Object,this.notificationSenderService.Object,this.timezoneOffsetManager.Object); + this.catalogueService = new CatalogueService(this.catalogueRepository.Object, this.categoryService.Object, this.nodeRepository.Object, this.userUserGroupRepository.Object, this.mapper.Object, this.findwiseConfig.Object, this.learningHubConfig.Object, this.catalogueNodeVersionRepository.Object, this.nodeResourceRepository.Object, this.resourceVersionRepository.Object, this.roleUserGroupRepository.Object, this.providerService.Object, this.catalogueAccessRequestRepository.Object, this.userRepository.Object, this.userProfileRepository.Object, this.emailSenderService.Object, this.bookmarkRepository.Object, this.nodeActivityRepository.Object, this.notificationSenderService.Object,this.timezoneOffsetManager.Object); } private static IEnumerable CatalogueNodeVersionList => new List()