feat(email): add durable send ledger
CI and Deploy / test (pull_request) Failing after 1m21s
CI and Deploy / deploy (pull_request) Has been skipped

Tracks only idempotency and delivery metadata; recipient, subject, and body are excluded. No provider send path is enabled.
This commit is contained in:
cesnimda
2026-08-09 23:32:27 +02:00
parent 3a7e4f1088
commit 653f011be2
8 changed files with 3077 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
namespace JobTrackerApi.Models;
public static class EmailSendStatuses
{
public const string Pending = "pending";
public const string Sending = "sending";
public const string Sent = "sent";
public const string Failed = "failed";
public const string Uncertain = "uncertain";
}
public sealed class EmailSendAttempt
{
public Guid Id { get; set; }
public string OwnerUserId { get; set; } = string.Empty;
public int JobApplicationId { get; set; }
public JobApplication JobApplication { get; set; } = null!;
public string Provider { get; set; } = string.Empty;
public string ClientRequestId { get; set; } = string.Empty;
public string PayloadHash { get; set; } = string.Empty;
public string Status { get; set; } = EmailSendStatuses.Pending;
public string? ProviderMessageId { get; set; }
public string? FailureCategory { get; set; }
public DateTime CreatedAtUtc { get; set; }
public DateTime? StartedAtUtc { get; set; }
public DateTime? CompletedAtUtc { get; set; }
}