using e_suite.Messaging.Common; using eSuite.API.security; using eSuite.API.Utilities; using eSuite.Core.Security; using Microsoft.AspNetCore.Mvc; namespace eSuite.API.Controllers; /// /// Internal API used to trigger messages that the scheduler sends. /// [Route("api/[controller]")] public class InternalMessagingController : ESuiteControllerBase { private readonly ISigmaImportMessageSender _sigmaImportMessageSender; private readonly IDatabaseMessageSender _databaseMessageSender; private readonly IEFlowSyncMessageSender _eFlowSyncMessageSender; /// /// /// /// /// /// public InternalMessagingController(ISigmaImportMessageSender sigmaImportMessageSender, IDatabaseMessageSender databaseMessageSender, IEFlowSyncMessageSender eFlowSyncMessageSender) { _sigmaImportMessageSender = sigmaImportMessageSender; _databaseMessageSender = databaseMessageSender; _eFlowSyncMessageSender = eFlowSyncMessageSender; } /// /// /// /// [Route("PostImportGMGProfiles")] [HttpPost] [ProducesResponseType(StatusCodes.Status200OK)] [AccessKey(SecurityAccess.ImportGMGProfiles)] #pragma warning disable IDE0060 // Remove unused parameter public Task PostImportGmgProfiles(CancellationToken cancellationToken) #pragma warning restore IDE0060 // Remove unused parameter { _sigmaImportMessageSender.PostImportGMGProfiles(); return Task.CompletedTask; } /// /// /// /// [Route("PostImportPrintSpecifications")] [HttpPost] [ProducesResponseType(StatusCodes.Status200OK)] [AccessKey(SecurityAccess.ImportPrintSpecifications)] #pragma warning disable IDE0060 // Remove unused parameter public Task PostImportPrintSpecifications(CancellationToken cancellationToken) #pragma warning restore IDE0060 // Remove unused parameter { _sigmaImportMessageSender.PostImportPrintSpecifications(); return Task.CompletedTask; } /// /// /// /// [Route("PostClearOldEmailActions")] [HttpPost] [ProducesResponseType(StatusCodes.Status200OK)] [AccessKey(SecurityAccess.ClearOldEmailActions)] #pragma warning disable IDE0060 // Remove unused parameter public Task PostClearOldEmailActions(CancellationToken cancellationToken) #pragma warning restore IDE0060 // Remove unused parameter { _databaseMessageSender.PostClearOldEmailActions(); return Task.CompletedTask; } /// /// /// /// [Route("PostClearOldPerformanceData")] [HttpPost] [ProducesResponseType(StatusCodes.Status200OK)] [AccessKey(SecurityAccess.ClearOldPerformanceData)] #pragma warning disable IDE0060 // Remove unused parameter public Task PostClearOldPerformanceData(CancellationToken cancellationToken) #pragma warning restore IDE0060 // Remove unused parameter { _databaseMessageSender.PostClearOldPerformanceData(); return Task.CompletedTask; } /// /// /// /// [Route("PostClearOldSentinelData")] [HttpPost] [ProducesResponseType(StatusCodes.Status200OK)] [AccessKey(SecurityAccess.ClearOldSentinelData)] #pragma warning disable IDE0060 // Remove unused parameter public Task PostClearOldSentinelData(CancellationToken cancellationToken) #pragma warning restore IDE0060 // Remove unused parameter { _databaseMessageSender.PostClearOldSentinelData(); return Task.CompletedTask; } /// /// /// /// [Route("PostClearOldSingleUserGuids")] [HttpPost] [ProducesResponseType(StatusCodes.Status200OK)] [AccessKey(SecurityAccess.ClearOldSingleUserGuids)] #pragma warning disable IDE0060 // Remove unused parameter public Task PostClearOldSingleUserGuids(CancellationToken cancellationToken) #pragma warning restore IDE0060 // Remove unused parameter { _databaseMessageSender.PostClearOldSingleUserGuids(); return Task.CompletedTask; } /// /// /// /// /// [Route("PostSyncEFlowPrinterCategories")] [HttpPost] [ProducesResponseType(StatusCodes.Status200OK)] [AccessKey(SecurityAccess.SyncEFlowPrinterCategories)] #pragma warning disable IDE0060 // Remove unused parameter public Task SyncEFlowPrinterCategories(CancellationToken cancellationToken) #pragma warning restore IDE0060 // Remove unused parameter { _eFlowSyncMessageSender.SyncEFlowPrinterCategories(); return Task.CompletedTask; } }