feat(templates): add localized push templates and actions
Share template keys across email and push with independent editors and revisions. Render localized actions and preserve version-one delivery. Ref: IT-1627
This commit is contained in:
@@ -4,6 +4,7 @@ namespace HrynCo.NotificationService.DAL.EF.Entities;
|
||||
|
||||
internal sealed class EmailTemplateDefinitionEntity : Entity
|
||||
{
|
||||
public TemplateEntity Template { get; set; } = null!;
|
||||
public Guid ServiceId { get; set; }
|
||||
public ServiceEntity Service { get; set; } = null!;
|
||||
public required string Key { get; set; }
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
using HrynCo.DAL.Abstract.Entities;
|
||||
|
||||
namespace HrynCo.NotificationService.DAL.EF.Entities;
|
||||
|
||||
internal sealed class PushTemplateDefinitionEntity : Entity
|
||||
{
|
||||
public Guid ServiceId { get; set; }
|
||||
public required string Key { get; set; }
|
||||
public TemplateEntity Template { get; set; } = null!;
|
||||
public Guid Revision { get; set; } = Guid.NewGuid();
|
||||
public List<PushTemplateVariableData> Variables { get; set; } = [];
|
||||
public List<PushTemplateEntity> Languages { get; set; } = [];
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using HrynCo.DAL.Abstract.Entities;
|
||||
|
||||
namespace HrynCo.NotificationService.DAL.EF.Entities;
|
||||
|
||||
internal sealed class PushTemplateEntity : Entity
|
||||
{
|
||||
public Guid DefinitionId { get; set; }
|
||||
public PushTemplateDefinitionEntity Definition { get; set; } = null!;
|
||||
public Guid ServiceId { get; set; }
|
||||
public Guid ServiceLanguageId { get; set; }
|
||||
public ServiceLanguageEntity ServiceLanguage { get; set; } = null!;
|
||||
public required string Title { get; set; }
|
||||
public required string Body { get; set; }
|
||||
public string ActionsJson { get; set; } = "{}";
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace HrynCo.NotificationService.DAL.EF.Entities;
|
||||
|
||||
internal sealed class PushTemplateVariableData
|
||||
{
|
||||
public required string Name { get; set; }
|
||||
public bool Required { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using HrynCo.DAL.Abstract.Entities;
|
||||
|
||||
namespace HrynCo.NotificationService.DAL.EF.Entities;
|
||||
|
||||
internal sealed class TemplateEntity : Entity
|
||||
{
|
||||
public Guid ServiceId { get; set; }
|
||||
public ServiceEntity Service { get; set; } = null!;
|
||||
public required string Key { get; set; }
|
||||
public EmailTemplateDefinitionEntity? Email { get; set; }
|
||||
public PushTemplateDefinitionEntity? Push { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user