feat(account): add deletion lifecycle
CI and Deploy / test (pull_request) Successful in 5m18s
CI and Deploy / deploy (pull_request) Has been skipped

This commit is contained in:
cesnimda
2026-08-15 19:03:54 +02:00
parent 1ec9dd037e
commit 842e793f69
28 changed files with 4418 additions and 129 deletions
+10
View File
@@ -46,7 +46,10 @@ builder.Services.AddSingleton<BackgroundTenantRunner>();
builder.Services.AddSingleton(TimeProvider.System);
builder.Services.AddScoped<UserOperationStore>();
builder.Services.AddScoped<EmailSendAttemptStore>();
builder.Services.AddScoped<AccountOwnedFileInventory>();
builder.Services.AddScoped<AccountDataExportService>();
builder.Services.AddSingleton<AccountDeletionTombstoneStore>();
builder.Services.AddScoped<AccountDeletionService>();
builder.Services.AddScoped<AiOperationAdmission>();
builder.Services.AddScoped<StrategySnapshotService>();
builder.Services.AddSingleton<IAiOperationHandler, StrategySnapshotOperationHandler>();
@@ -170,6 +173,7 @@ builder.Services.AddHostedService<JobEnrichmentHostedService>();
builder.Services.AddHostedService<SummarizerProbeHostedService>();
builder.Services.AddHostedService<AiOperationHostedService>();
builder.Services.AddHostedService<EmailSendAttemptRecoveryHostedService>();
builder.Services.AddHostedService<AccountDeletionHostedService>();
builder.Services.AddHttpClient("jobimport")
.ConfigurePrimaryHttpMessageHandler(() => new HttpClientHandler
@@ -552,6 +556,12 @@ app.Use(async (ctx, next) =>
await app.InitializeJobTrackerAsync();
await using (var deletionReplayScope = app.Services.CreateAsyncScope())
{
var staged = await deletionReplayScope.ServiceProvider.GetRequiredService<AccountDeletionService>().StageRestoredAccountsAsync(CancellationToken.None);
if (staged > 0) app.Logger.LogWarning("Staged {Count} restored deleted accounts for mandatory tombstone replay.", staged);
}
await using (var attachmentScope = app.Services.CreateAsyncScope())
{
var result = await attachmentScope.ServiceProvider.GetRequiredService<IAttachmentStorage>()