feat: add EF Core layer with entities, configurations and DbContext

- Directory.Packages.props and Directory.Build.props for central package management
- TemplateEntity, ProviderEntity, ProviderUsageEntity (internal to DAL.EF)
- TemplateEntityConfiguration: composite unique index (service_name, key, language_code), Variables as JSON column
- ProviderEntityConfiguration: settings stored as jsonb, index on (service_name, priority)
- ProviderUsageEntityConfiguration: composite unique index (provider_id, date)
- All entities map Id column explicitly as 'id' (snake_case)
- NotificationDbContext with ApplyConfigurationsFromAssembly

Ref: IT-628

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Anatolii Grynchuk
2026-05-01 19:50:33 +03:00
parent 7cb691db14
commit 26b29d169e
14 changed files with 257 additions and 12 deletions
@@ -0,0 +1,21 @@
namespace HrynCo.NotificationService.DAL.EF.Entities;
internal class TemplateEntity
{
public Guid Id { get; set; }
public required string ServiceName { get; set; }
public required string Key { get; set; }
public required string LanguageCode { get; set; }
public required string Subject { get; set; }
public required string HtmlBody { get; set; }
public required string TextBody { get; set; }
public List<TemplateVariableData> Variables { get; set; } = [];
public DateTimeOffset Created { get; set; }
public DateTimeOffset? Updated { get; set; }
}
internal class TemplateVariableData
{
public required string Name { get; set; }
public bool Required { get; set; }
}