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:
2026-10-17 22:51:01 +03:00
parent 81654c0d33
commit 8e81572386
80 changed files with 2253 additions and 54 deletions
@@ -0,0 +1,19 @@
using HrynCo.NotificationService.DAL.Abstract.Templates;
namespace HrynCo.NotificationService.Web.Controllers.Api.Services;
internal static class NotificationServiceRequestMapping
{
public static NotificationServiceInfo Map(Guid? id, string name, IReadOnlyList<ServiceLanguageRequest>? languages, Guid revision)
{
if (languages is null || languages.Any(l => l is null))
throw new EmailTemplateWriteException("languages must be a JSON array without null elements.", false);
if (id is null && languages.Any(l => l.Id != Guid.Empty))
throw new EmailTemplateWriteException("New services cannot reference persisted language IDs.", false);
return new NotificationServiceInfo
{
Id = id ?? Guid.Empty, Name = name, Revision = revision,
Languages = languages.Select(l => new ServiceLanguageInfo { Id = l.Id, Code = l.Code }).ToList()
};
}
}