feat(notification): add admin rest management and deletion
Add revision-safe service and template APIs, channel mapping, and validated admin controls. Ref: IT-1601
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
||||
using HrynCo.NotificationService.DAL.Abstract.Repositories;
|
||||
using HrynCo.NotificationService.Services.Core;
|
||||
using HrynCo.NotificationService.Services.Logging;
|
||||
using static HrynCo.NotificationService.Services.Core.ServiceResultHelper;
|
||||
|
||||
namespace HrynCo.NotificationService.Services.TemplateDefinitions;
|
||||
|
||||
internal sealed class GetAllNotificationServicesHandler(
|
||||
IContextualSerilogLogger<GetAllNotificationServicesQuery> logger, INotificationServiceRepository services)
|
||||
: RequestHandler<GetAllNotificationServicesQuery, ServiceResult<IReadOnlyList<NotificationServiceDto>>>(logger)
|
||||
{
|
||||
protected override async Task<ServiceResult<IReadOnlyList<NotificationServiceDto>>> DoOnHandle(GetAllNotificationServicesQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
var all = await services.GetAllAsync(cancellationToken);
|
||||
return Success<IReadOnlyList<NotificationServiceDto>>(all.Select(NotificationServiceMapping.Map).ToList());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user