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
@@ -58,7 +58,7 @@ public sealed class TemplateCatalogPresentationTests(TemplateDatabaseFixture fix
var miss = await client.GetStringAsync(baseUrl + "?key=Absent");
Assert.Matches("(?s)<th[^>]*>\\s*<form[^>]*method=\"get\"[^>]*class=\"template-key-filter\"", miss);
Assert.Contains("value=\"Absent\"", miss);
Assert.Contains("No email templates found", miss);
Assert.Contains("No templates match this key.", miss);
Assert.Contains("class=\"template-actions\">Action</th>", miss);
Assert.Contains($"href=\"{baseUrl}\" class=\"btn btn-outline-secondary btn-sm\">Clear</a>", miss);
var filtered = await client.GetStringAsync(baseUrl + "?key=Welcome");
@@ -85,13 +85,13 @@ public sealed class TemplateCatalogPresentationTests(TemplateDatabaseFixture fix
var empty = await client.GetStringAsync(baseUrl);
Assert.Contains("No languages configured for this service.", empty);
Assert.Contains("template-key-filter", empty);
Assert.Contains("No email templates found", empty);
Assert.Contains("No email templates for this service yet.", empty);
await scope.ServiceProvider.GetRequiredService<IEmailTemplateDefinitionRepository>()
.SaveDefinitionAsync(new EmailTemplateDefinition { ServiceName = service.Name, Key = "Empty" }, true);
var withDefinition = await client.GetStringAsync(baseUrl);
Assert.Contains("No configured languages", TemplateRow(withDefinition, "Empty"));
Assert.DoesNotContain("data-state=", withDefinition);
Assert.DoesNotContain("No email templates found", withDefinition);
Assert.DoesNotContain("No templates match this key.", withDefinition);
}
private static string TemplateRow(string html, string key)