feat(notification): add typed payloads for non-link email templates
Add strongly typed notification records for remaining email templates that do not require document URL composition. Each record maps template placeholders to explicit properties and returns the matching EmailTemplateType. Also includes XML documentation so placeholder-to-property mapping is self-describing.
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Common.Interfaces.Services.Notification;
|
||||
|
||||
/// <summary>
|
||||
/// Payload for <see cref="EmailTemplateType.DocumentAccessCodeReceived"/> template.
|
||||
/// </summary>
|
||||
public record DocumentAccessCodeReceivedNotification : EnvelopeNotificationBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Replaces <c>[DOCUMENT_TITLE]</c> in mail subject/body.
|
||||
/// </summary>
|
||||
public required string DocumentTitle { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Replaces <c>[NAME_RECEIVER]</c> in mail body.
|
||||
/// </summary>
|
||||
public required string NameReceiver { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Replaces <c>[NAME_SENDER]</c> in mail body.
|
||||
/// </summary>
|
||||
public required string NameSender { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Determines <c>[SIGNATURE_TYPE]</c> text in mail body.
|
||||
/// </summary>
|
||||
public required bool IsReadAndConfirm { private get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Replaces <c>[SIGNATURE_TYPE]</c> in mail body.
|
||||
/// </summary>
|
||||
public string SignatureType => IsReadAndConfirm ? "Signieren" : "Lesen und bestätigen";
|
||||
|
||||
/// <summary>
|
||||
/// Replaces <c>[DOCUMENT_ACCESS_CODE]</c> in mail body.
|
||||
/// </summary>
|
||||
public required string DocumentAccessCode { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Replaces <c>[NAME_PORTAL]</c> in mail body.
|
||||
/// </summary>
|
||||
public string NamePortal { get; init; } = "signFLOW Portal";
|
||||
|
||||
/// <inheritdoc />
|
||||
public override EmailTemplateType GetTemplateType() => EmailTemplateType.DocumentAccessCodeReceived;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Common.Interfaces.Services.Notification;
|
||||
|
||||
/// <summary>
|
||||
/// Payload for <see cref="EmailTemplateType.DocumentCompleted"/> template.
|
||||
/// </summary>
|
||||
public record DocumentCompletedNotification : EnvelopeNotificationBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Replaces <c>[DOCUMENT_TITLE]</c> in mail subject/body.
|
||||
/// </summary>
|
||||
public required string DocumentTitle { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Replaces <c>[NAME_RECEIVER]</c> in mail body.
|
||||
/// </summary>
|
||||
public required string NameReceiver { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Replaces <c>[NAME_PORTAL]</c> in mail body.
|
||||
/// </summary>
|
||||
public string NamePortal { get; init; } = "signFLOW Portal";
|
||||
|
||||
/// <inheritdoc />
|
||||
public override EmailTemplateType GetTemplateType() => EmailTemplateType.DocumentCompleted;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Common.Interfaces.Services.Notification;
|
||||
|
||||
/// <summary>
|
||||
/// Payload for <see cref="EmailTemplateType.DocumentDeleted"/> template.
|
||||
/// </summary>
|
||||
public record DocumentDeletedNotification : EnvelopeNotificationBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Replaces <c>[DOCUMENT_TITLE]</c> in mail subject/body.
|
||||
/// </summary>
|
||||
public required string DocumentTitle { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Replaces <c>[NAME_RECEIVER]</c> in mail body.
|
||||
/// </summary>
|
||||
public required string NameReceiver { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Replaces <c>[NAME_SENDER]</c> in mail body.
|
||||
/// </summary>
|
||||
public required string NameSender { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Replaces <c>[REASON]</c> in mail body.
|
||||
/// </summary>
|
||||
public required string Reason { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Replaces <c>[NAME_PORTAL]</c> in mail body.
|
||||
/// </summary>
|
||||
public string NamePortal { get; init; } = "signFLOW Portal";
|
||||
|
||||
/// <inheritdoc />
|
||||
public override EmailTemplateType GetTemplateType() => EmailTemplateType.DocumentDeleted;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Common.Interfaces.Services.Notification;
|
||||
|
||||
/// <summary>
|
||||
/// Payload for <see cref="EmailTemplateType.DocumentRejected_ADM"/> template.
|
||||
/// </summary>
|
||||
public record DocumentRejectedAdmNotification : EnvelopeNotificationBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Replaces <c>[DOCUMENT_TITLE]</c> in mail subject/body.
|
||||
/// </summary>
|
||||
public required string DocumentTitle { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Replaces <c>[NAME_SENDER]</c> in mail body.
|
||||
/// </summary>
|
||||
public required string NameSender { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Replaces <c>[NAME_RECEIVER]</c> in mail body.
|
||||
/// </summary>
|
||||
public required string NameReceiver { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Replaces <c>[REASON]</c> in mail body.
|
||||
/// </summary>
|
||||
public required string Reason { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Replaces <c>[NAME_PORTAL]</c> in mail body.
|
||||
/// </summary>
|
||||
public string NamePortal { get; init; } = "signFLOW Portal";
|
||||
|
||||
/// <inheritdoc />
|
||||
public override EmailTemplateType GetTemplateType() => EmailTemplateType.DocumentRejected_ADM;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Common.Interfaces.Services.Notification;
|
||||
|
||||
/// <summary>
|
||||
/// Payload for <see cref="EmailTemplateType.DocumentRejected_REC_2"/> template.
|
||||
/// </summary>
|
||||
public record DocumentRejectedRec2Notification : EnvelopeNotificationBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Replaces <c>[DOCUMENT_TITLE]</c> in mail subject/body.
|
||||
/// </summary>
|
||||
public required string DocumentTitle { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Replaces <c>[NAME_RECEIVER]</c> in mail body.
|
||||
/// </summary>
|
||||
public required string NameReceiver { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Replaces <c>[NAME_SENDER]</c> in mail body.
|
||||
/// </summary>
|
||||
public required string NameSender { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Replaces <c>[NAME_PORTAL]</c> in mail body.
|
||||
/// </summary>
|
||||
public string NamePortal { get; init; } = "signFLOW Portal";
|
||||
|
||||
/// <inheritdoc />
|
||||
public override EmailTemplateType GetTemplateType() => EmailTemplateType.DocumentRejected_REC_2;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Common.Interfaces.Services.Notification;
|
||||
|
||||
/// <summary>
|
||||
/// Payload for <see cref="EmailTemplateType.DocumentRejected_REC"/> template.
|
||||
/// </summary>
|
||||
public record DocumentRejectedRecNotification : EnvelopeNotificationBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Replaces <c>[DOCUMENT_TITLE]</c> in mail subject/body.
|
||||
/// </summary>
|
||||
public required string DocumentTitle { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Replaces <c>[NAME_RECEIVER]</c> in mail body.
|
||||
/// </summary>
|
||||
public required string NameReceiver { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Replaces <c>[NAME_SENDER]</c> in mail body.
|
||||
/// </summary>
|
||||
public required string NameSender { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Replaces <c>[NAME_PORTAL]</c> in mail body.
|
||||
/// </summary>
|
||||
public string NamePortal { get; init; } = "signFLOW Portal";
|
||||
|
||||
/// <inheritdoc />
|
||||
public override EmailTemplateType GetTemplateType() => EmailTemplateType.DocumentRejected_REC;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Common.Interfaces.Services.Notification;
|
||||
|
||||
/// <summary>
|
||||
/// Payload for <see cref="EmailTemplateType.TotpSecret"/> template.
|
||||
/// </summary>
|
||||
public record TotpSecretNotification : EnvelopeNotificationBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Replaces <c>[TFA_EXPIRATION]</c> in mail body.
|
||||
/// </summary>
|
||||
public required string TfaExpiration { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Replaces <c>[TFA_QR_CODE]</c> in mail body.
|
||||
/// </summary>
|
||||
public required string TfaQrCode { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Replaces <c>[NAME_PORTAL]</c> in mail body.
|
||||
/// </summary>
|
||||
public string NamePortal { get; init; } = "signFLOW Portal";
|
||||
|
||||
/// <inheritdoc />
|
||||
public override EmailTemplateType GetTemplateType() => EmailTemplateType.TotpSecret;
|
||||
}
|
||||
Reference in New Issue
Block a user