fix(email): preserve draft send identity
CI and Deploy / test (pull_request) Successful in 4m15s
CI and Deploy / deploy (pull_request) Has been skipped

Persist and export each draft's idempotency UUID so refresh and edits cannot create a fresh delivery identity. Add reversible provider-specific migration SQL.
This commit is contained in:
cesnimda
2026-08-10 10:11:04 +02:00
parent 108440d361
commit 80b5532c2f
12 changed files with 2778 additions and 4 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,39 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace JobTrackerApi.Migrations
{
/// <inheritdoc />
public partial class AddEmailDraftClientRequestId : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
if (ActiveProvider.Contains("MySql", StringComparison.OrdinalIgnoreCase))
{
migrationBuilder.Sql("""
ALTER TABLE `EmailDrafts`
ADD `ClientRequestId` varchar(128) NOT NULL DEFAULT '';
""");
return;
}
migrationBuilder.AddColumn<string>(
name: "ClientRequestId",
table: "EmailDrafts",
type: "TEXT",
maxLength: 128,
nullable: false,
defaultValue: "");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ClientRequestId",
table: "EmailDrafts");
}
}
}
@@ -1108,6 +1108,11 @@ namespace JobTrackerApi.Migrations
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("ClientRequestId")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedAtUtc")
.HasColumnType("TEXT");