feat(templates): add service language template management

Add normalized service and template catalogs, scoped administration, migration, validation, and regression coverage.

Ref: IT-1601
This commit is contained in:
2026-10-17 22:02:43 +03:00
parent 36810dc5f1
commit 81654c0d33
73 changed files with 4061 additions and 820 deletions
@@ -1,3 +1,4 @@
using HrynCo.NotificationService.DAL.Abstract.Templates;
using HrynCo.DAL.Abstract;
using HrynCo.NotificationService.DAL.Abstract.Repositories;
using HrynCo.NotificationService.Services.Core;
@@ -34,7 +35,14 @@ internal sealed class UpdateEmailTemplateHandler
template.Variables = request.Variables;
template.Updated = DateTimeOffset.UtcNow;
await _templates.UpdateAsync(template, cancellationToken);
try
{
await _templates.UpdateAsync(template, cancellationToken);
}
catch (EmailTemplateWriteException error)
{
return Failure<Unit>(error.Message, error.IsConflict ? ServiceErrorCode.Conflict : ServiceErrorCode.InvalidRequest);
}
return Success(Unit.Value);
}