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
@@ -2,32 +2,20 @@ using System.ComponentModel.DataAnnotations;
namespace HrynCo.NotificationService.Web.Controllers.Admin.ViewModels;
public class EmailTemplateEditViewModel
public sealed class EmailTemplateEditViewModel
{
public Guid? Id { get; set; }
[Required]
public Guid ServiceId { get; set; }
public Guid Revision { get; set; }
[Required, StringLength(100)]
public string ServiceName { get; set; } = "";
[Required]
[Required, StringLength(100)]
public string Key { get; set; } = "";
[Required]
public string LanguageCode { get; set; } = "";
[Required]
public string Subject { get; set; } = "";
[Required]
public string HtmlBody { get; set; } = "";
public string TextBody { get; set; } = "";
// JSON array: [{"name":"UserName","required":true}, ...]
public string VariablesJson { get; set; } = "[]";
public string? ServiceNameFilter { get; set; }
public List<EmailTemplateLanguageEditViewModel> Languages { get; set; } = [];
public int ActiveLanguageIndex { get; set; }
public string? KeyFilter { get; set; }
public bool IsNew => Id == null;
public string PageTitle => IsNew ? "Create Email Template" : "Edit Email Template";
}