feat(email): export send attempt metadata
Add content-free provider delivery history to encrypted and daily owner exports, exclude payload hashes, and lock in tenant-safe hard-delete cascades.
This commit is contained in:
@@ -5,6 +5,7 @@ using Microsoft.AspNetCore.DataProtection;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using JobTrackerApi.Data;
|
||||
using JobTrackerApi.Models;
|
||||
|
||||
namespace JobTrackerApi.Controllers
|
||||
{
|
||||
@@ -73,6 +74,21 @@ namespace JobTrackerApi.Controllers
|
||||
.Where(e => jobIds.Contains(e.JobApplicationId))
|
||||
.OrderBy(e => e.At)
|
||||
.ToListAsync(cancellationToken);
|
||||
var emailSendAttempts = await _db.EmailSendAttempts.AsNoTracking()
|
||||
.Where(attempt => jobIds.Contains(attempt.JobApplicationId))
|
||||
.OrderBy(attempt => attempt.CreatedAtUtc)
|
||||
.Select(attempt => new EmailSendAttemptExport(
|
||||
attempt.Id,
|
||||
attempt.JobApplicationId,
|
||||
attempt.Provider,
|
||||
attempt.ClientRequestId,
|
||||
attempt.Status,
|
||||
attempt.ProviderMessageId,
|
||||
attempt.FailureCategory,
|
||||
attempt.CreatedAtUtc,
|
||||
attempt.StartedAtUtc,
|
||||
attempt.CompletedAtUtc))
|
||||
.ToListAsync(cancellationToken);
|
||||
var rules = await _db.RuleSettings.AsNoTracking().FirstOrDefaultAsync(cancellationToken);
|
||||
|
||||
return new
|
||||
@@ -82,6 +98,7 @@ namespace JobTrackerApi.Controllers
|
||||
Correspondence = correspondence,
|
||||
Attachments = attachments,
|
||||
Events = events,
|
||||
EmailSendAttempts = emailSendAttempts,
|
||||
Rules = rules
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user