diff --git a/EmailCollector.Api/Migrations/20241212054047_AddCustomEmailTemplates.Designer.cs b/EmailCollector.Api/Migrations/20241212054047_AddCustomEmailTemplates.Designer.cs
new file mode 100644
index 0000000..85604b4
--- /dev/null
+++ b/EmailCollector.Api/Migrations/20241212054047_AddCustomEmailTemplates.Designer.cs
@@ -0,0 +1,535 @@
+//
+using System;
+using EmailCollector.Api.Data;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace EmailCollector.Api.Migrations
+{
+ [DbContext(typeof(EmailCollectorApiContext))]
+ [Migration("20241212054047_AddCustomEmailTemplates")]
+ partial class AddCustomEmailTemplates
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder.HasAnnotation("ProductVersion", "8.0.8");
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.ApiKey", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("CreatedAt")
+ .HasColumnType("TEXT");
+
+ b.Property("Expiration")
+ .HasColumnType("TEXT");
+
+ b.Property("IsRevoked")
+ .HasColumnType("INTEGER");
+
+ b.Property("KeyHash")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("UserId")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("ApiKeys");
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.CustomEmailTemplates", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("CreatedAt")
+ .HasColumnType("TEXT");
+
+ b.Property("Event")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("FormId")
+ .HasColumnType("TEXT");
+
+ b.Property("IsActive")
+ .HasColumnType("INTEGER");
+
+ b.Property("TemplateBodyUri")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("TemplateSubject")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("FormId");
+
+ b.ToTable("CustomEmailTemplates");
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.EmailCollectorApiUser", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT");
+
+ b.Property("AccessFailedCount")
+ .HasColumnType("INTEGER");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnType("TEXT");
+
+ b.Property("Email")
+ .HasMaxLength(256)
+ .HasColumnType("TEXT");
+
+ b.Property("EmailConfirmed")
+ .HasColumnType("INTEGER");
+
+ b.Property("LockoutEnabled")
+ .HasColumnType("INTEGER");
+
+ b.Property("LockoutEnd")
+ .HasColumnType("TEXT");
+
+ b.Property("NormalizedEmail")
+ .HasMaxLength(256)
+ .HasColumnType("TEXT");
+
+ b.Property("NormalizedUserName")
+ .HasMaxLength(256)
+ .HasColumnType("TEXT");
+
+ b.Property("PasswordHash")
+ .HasColumnType("TEXT");
+
+ b.Property("PhoneNumber")
+ .HasColumnType("TEXT");
+
+ b.Property("PhoneNumberConfirmed")
+ .HasColumnType("INTEGER");
+
+ b.Property("SecurityStamp")
+ .HasColumnType("TEXT");
+
+ b.Property("TwoFactorEnabled")
+ .HasColumnType("INTEGER");
+
+ b.Property("UserName")
+ .HasMaxLength(256)
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("NormalizedEmail")
+ .HasDatabaseName("EmailIndex");
+
+ b.HasIndex("NormalizedUserName")
+ .IsUnique()
+ .HasDatabaseName("UserNameIndex");
+
+ b.ToTable("AspNetUsers", (string)null);
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.EmailSignup", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("EmailAddress")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("SignupDate")
+ .HasColumnType("TEXT");
+
+ b.Property("SignupFormId")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("EmailSignups");
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.FormCorsSettings", b =>
+ {
+ b.Property("FormId")
+ .HasColumnType("TEXT");
+
+ b.Property("AllowedOrigins")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("FormId");
+
+ b.ToTable("FormCorsSettings");
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.FormEmailSettings", b =>
+ {
+ b.Property("FormId")
+ .HasColumnType("TEXT");
+
+ b.Property("EmailFrom")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("EmailMethod")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("FormId");
+
+ b.ToTable("FormEmailSettings");
+
+ b.UseTptMappingStrategy();
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.RecaptchaFormSettings", b =>
+ {
+ b.Property("FormId")
+ .HasColumnType("TEXT");
+
+ b.Property("SecretKey")
+ .HasColumnType("TEXT");
+
+ b.Property("SiteKey")
+ .HasColumnType("TEXT");
+
+ b.HasKey("FormId");
+
+ b.ToTable("RecaptchaFormSettings");
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.SignupForm", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("CreatedAt")
+ .HasColumnType("TEXT");
+
+ b.Property("CreatedBy")
+ .HasColumnType("TEXT");
+
+ b.Property("FormName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("Status")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("SignupForms");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnType("TEXT");
+
+ b.Property("Name")
+ .HasMaxLength(256)
+ .HasColumnType("TEXT");
+
+ b.Property("NormalizedName")
+ .HasMaxLength(256)
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("NormalizedName")
+ .IsUnique()
+ .HasDatabaseName("RoleNameIndex");
+
+ b.ToTable("AspNetRoles", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("ClaimType")
+ .HasColumnType("TEXT");
+
+ b.Property("ClaimValue")
+ .HasColumnType("TEXT");
+
+ b.Property("RoleId")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("AspNetRoleClaims", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("ClaimType")
+ .HasColumnType("TEXT");
+
+ b.Property("ClaimValue")
+ .HasColumnType("TEXT");
+
+ b.Property("UserId")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("AspNetUserClaims", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
+ {
+ b.Property("LoginProvider")
+ .HasColumnType("TEXT");
+
+ b.Property("ProviderKey")
+ .HasColumnType("TEXT");
+
+ b.Property("ProviderDisplayName")
+ .HasColumnType("TEXT");
+
+ b.Property("UserId")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("LoginProvider", "ProviderKey");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("AspNetUserLogins", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("TEXT");
+
+ b.Property("RoleId")
+ .HasColumnType("TEXT");
+
+ b.HasKey("UserId", "RoleId");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("AspNetUserRoles", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("TEXT");
+
+ b.Property("LoginProvider")
+ .HasColumnType("TEXT");
+
+ b.Property("Name")
+ .HasColumnType("TEXT");
+
+ b.Property("Value")
+ .HasColumnType("TEXT");
+
+ b.HasKey("UserId", "LoginProvider", "Name");
+
+ b.ToTable("AspNetUserTokens", (string)null);
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.SmtpEmailSettings", b =>
+ {
+ b.HasBaseType("EmailCollector.Domain.Entities.FormEmailSettings");
+
+ b.Property("SmtpPassword")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("SmtpPort")
+ .HasColumnType("INTEGER");
+
+ b.Property("SmtpServer")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("SmtpUsername")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.ToTable("SmtpEmailSettings", (string)null);
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.ApiKey", b =>
+ {
+ b.HasOne("EmailCollector.Domain.Entities.EmailCollectorApiUser", "User")
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.CustomEmailTemplates", b =>
+ {
+ b.HasOne("EmailCollector.Domain.Entities.SignupForm", "Form")
+ .WithMany("CustomEmailTemplates")
+ .HasForeignKey("FormId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Form");
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.FormCorsSettings", b =>
+ {
+ b.HasOne("EmailCollector.Domain.Entities.SignupForm", "Form")
+ .WithOne("FormCorsSettings")
+ .HasForeignKey("EmailCollector.Domain.Entities.FormCorsSettings", "FormId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Form");
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.FormEmailSettings", b =>
+ {
+ b.HasOne("EmailCollector.Domain.Entities.SignupForm", "Form")
+ .WithOne("FormEmailSettings")
+ .HasForeignKey("EmailCollector.Domain.Entities.FormEmailSettings", "FormId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Form");
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.RecaptchaFormSettings", b =>
+ {
+ b.HasOne("EmailCollector.Domain.Entities.SignupForm", "Form")
+ .WithOne("RecaptchaSettings")
+ .HasForeignKey("EmailCollector.Domain.Entities.RecaptchaFormSettings", "FormId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Form");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
+ {
+ b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
+ .WithMany()
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
+ {
+ b.HasOne("EmailCollector.Domain.Entities.EmailCollectorApiUser", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
+ {
+ b.HasOne("EmailCollector.Domain.Entities.EmailCollectorApiUser", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
+ {
+ b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
+ .WithMany()
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("EmailCollector.Domain.Entities.EmailCollectorApiUser", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
+ {
+ b.HasOne("EmailCollector.Domain.Entities.EmailCollectorApiUser", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.SmtpEmailSettings", b =>
+ {
+ b.HasOne("EmailCollector.Domain.Entities.FormEmailSettings", null)
+ .WithOne()
+ .HasForeignKey("EmailCollector.Domain.Entities.SmtpEmailSettings", "FormId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.SignupForm", b =>
+ {
+ b.Navigation("CustomEmailTemplates");
+
+ b.Navigation("FormCorsSettings")
+ .IsRequired();
+
+ b.Navigation("FormEmailSettings")
+ .IsRequired();
+
+ b.Navigation("RecaptchaSettings")
+ .IsRequired();
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/EmailCollector.Api/Migrations/20241212054047_AddCustomEmailTemplates.cs b/EmailCollector.Api/Migrations/20241212054047_AddCustomEmailTemplates.cs
new file mode 100644
index 0000000..3e88e83
--- /dev/null
+++ b/EmailCollector.Api/Migrations/20241212054047_AddCustomEmailTemplates.cs
@@ -0,0 +1,51 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace EmailCollector.Api.Migrations
+{
+ ///
+ public partial class AddCustomEmailTemplates : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.CreateTable(
+ name: "CustomEmailTemplates",
+ columns: table => new
+ {
+ Id = table.Column(type: "TEXT", nullable: false),
+ FormId = table.Column(type: "TEXT", nullable: false),
+ Event = table.Column(type: "TEXT", nullable: false),
+ TemplateSubject = table.Column(type: "TEXT", nullable: false),
+ TemplateBodyUri = table.Column(type: "TEXT", nullable: false),
+ IsActive = table.Column(type: "INTEGER", nullable: false),
+ CreatedAt = table.Column(type: "TEXT", nullable: false),
+ UpdatedAt = table.Column(type: "TEXT", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_CustomEmailTemplates", x => x.Id);
+ table.ForeignKey(
+ name: "FK_CustomEmailTemplates_SignupForms_FormId",
+ column: x => x.FormId,
+ principalTable: "SignupForms",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_CustomEmailTemplates_FormId",
+ table: "CustomEmailTemplates",
+ column: "FormId");
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "CustomEmailTemplates");
+ }
+ }
+}
diff --git a/EmailCollector.Api/Migrations/20241213073002_fixCustomEmailTemplateName.Designer.cs b/EmailCollector.Api/Migrations/20241213073002_fixCustomEmailTemplateName.Designer.cs
new file mode 100644
index 0000000..a97e701
--- /dev/null
+++ b/EmailCollector.Api/Migrations/20241213073002_fixCustomEmailTemplateName.Designer.cs
@@ -0,0 +1,535 @@
+//
+using System;
+using EmailCollector.Api.Data;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace EmailCollector.Api.Migrations
+{
+ [DbContext(typeof(EmailCollectorApiContext))]
+ [Migration("20241213073002_fixCustomEmailTemplateName")]
+ partial class fixCustomEmailTemplateName
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder.HasAnnotation("ProductVersion", "8.0.8");
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.ApiKey", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("CreatedAt")
+ .HasColumnType("TEXT");
+
+ b.Property("Expiration")
+ .HasColumnType("TEXT");
+
+ b.Property("IsRevoked")
+ .HasColumnType("INTEGER");
+
+ b.Property("KeyHash")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("UserId")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("ApiKeys");
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.CustomEmailTemplate", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("CreatedAt")
+ .HasColumnType("TEXT");
+
+ b.Property("Event")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("FormId")
+ .HasColumnType("TEXT");
+
+ b.Property("IsActive")
+ .HasColumnType("INTEGER");
+
+ b.Property("TemplateBodyUri")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("TemplateSubject")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("FormId");
+
+ b.ToTable("CustomEmailTemplates");
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.EmailCollectorApiUser", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT");
+
+ b.Property("AccessFailedCount")
+ .HasColumnType("INTEGER");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnType("TEXT");
+
+ b.Property("Email")
+ .HasMaxLength(256)
+ .HasColumnType("TEXT");
+
+ b.Property("EmailConfirmed")
+ .HasColumnType("INTEGER");
+
+ b.Property("LockoutEnabled")
+ .HasColumnType("INTEGER");
+
+ b.Property("LockoutEnd")
+ .HasColumnType("TEXT");
+
+ b.Property("NormalizedEmail")
+ .HasMaxLength(256)
+ .HasColumnType("TEXT");
+
+ b.Property("NormalizedUserName")
+ .HasMaxLength(256)
+ .HasColumnType("TEXT");
+
+ b.Property("PasswordHash")
+ .HasColumnType("TEXT");
+
+ b.Property("PhoneNumber")
+ .HasColumnType("TEXT");
+
+ b.Property("PhoneNumberConfirmed")
+ .HasColumnType("INTEGER");
+
+ b.Property("SecurityStamp")
+ .HasColumnType("TEXT");
+
+ b.Property("TwoFactorEnabled")
+ .HasColumnType("INTEGER");
+
+ b.Property("UserName")
+ .HasMaxLength(256)
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("NormalizedEmail")
+ .HasDatabaseName("EmailIndex");
+
+ b.HasIndex("NormalizedUserName")
+ .IsUnique()
+ .HasDatabaseName("UserNameIndex");
+
+ b.ToTable("AspNetUsers", (string)null);
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.EmailSignup", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("EmailAddress")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("SignupDate")
+ .HasColumnType("TEXT");
+
+ b.Property("SignupFormId")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("EmailSignups");
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.FormCorsSettings", b =>
+ {
+ b.Property("FormId")
+ .HasColumnType("TEXT");
+
+ b.Property("AllowedOrigins")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("FormId");
+
+ b.ToTable("FormCorsSettings");
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.FormEmailSettings", b =>
+ {
+ b.Property("FormId")
+ .HasColumnType("TEXT");
+
+ b.Property("EmailFrom")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("EmailMethod")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("FormId");
+
+ b.ToTable("FormEmailSettings");
+
+ b.UseTptMappingStrategy();
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.RecaptchaFormSettings", b =>
+ {
+ b.Property("FormId")
+ .HasColumnType("TEXT");
+
+ b.Property("SecretKey")
+ .HasColumnType("TEXT");
+
+ b.Property("SiteKey")
+ .HasColumnType("TEXT");
+
+ b.HasKey("FormId");
+
+ b.ToTable("RecaptchaFormSettings");
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.SignupForm", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("CreatedAt")
+ .HasColumnType("TEXT");
+
+ b.Property("CreatedBy")
+ .HasColumnType("TEXT");
+
+ b.Property("FormName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("Status")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("SignupForms");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnType("TEXT");
+
+ b.Property("Name")
+ .HasMaxLength(256)
+ .HasColumnType("TEXT");
+
+ b.Property("NormalizedName")
+ .HasMaxLength(256)
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("NormalizedName")
+ .IsUnique()
+ .HasDatabaseName("RoleNameIndex");
+
+ b.ToTable("AspNetRoles", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("ClaimType")
+ .HasColumnType("TEXT");
+
+ b.Property("ClaimValue")
+ .HasColumnType("TEXT");
+
+ b.Property("RoleId")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("AspNetRoleClaims", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("ClaimType")
+ .HasColumnType("TEXT");
+
+ b.Property("ClaimValue")
+ .HasColumnType("TEXT");
+
+ b.Property("UserId")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("AspNetUserClaims", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
+ {
+ b.Property("LoginProvider")
+ .HasColumnType("TEXT");
+
+ b.Property("ProviderKey")
+ .HasColumnType("TEXT");
+
+ b.Property("ProviderDisplayName")
+ .HasColumnType("TEXT");
+
+ b.Property("UserId")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("LoginProvider", "ProviderKey");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("AspNetUserLogins", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("TEXT");
+
+ b.Property("RoleId")
+ .HasColumnType("TEXT");
+
+ b.HasKey("UserId", "RoleId");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("AspNetUserRoles", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("TEXT");
+
+ b.Property("LoginProvider")
+ .HasColumnType("TEXT");
+
+ b.Property("Name")
+ .HasColumnType("TEXT");
+
+ b.Property("Value")
+ .HasColumnType("TEXT");
+
+ b.HasKey("UserId", "LoginProvider", "Name");
+
+ b.ToTable("AspNetUserTokens", (string)null);
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.SmtpEmailSettings", b =>
+ {
+ b.HasBaseType("EmailCollector.Domain.Entities.FormEmailSettings");
+
+ b.Property("SmtpPassword")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("SmtpPort")
+ .HasColumnType("INTEGER");
+
+ b.Property("SmtpServer")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("SmtpUsername")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.ToTable("SmtpEmailSettings", (string)null);
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.ApiKey", b =>
+ {
+ b.HasOne("EmailCollector.Domain.Entities.EmailCollectorApiUser", "User")
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.CustomEmailTemplate", b =>
+ {
+ b.HasOne("EmailCollector.Domain.Entities.SignupForm", "Form")
+ .WithMany("CustomEmailTemplates")
+ .HasForeignKey("FormId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Form");
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.FormCorsSettings", b =>
+ {
+ b.HasOne("EmailCollector.Domain.Entities.SignupForm", "Form")
+ .WithOne("FormCorsSettings")
+ .HasForeignKey("EmailCollector.Domain.Entities.FormCorsSettings", "FormId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Form");
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.FormEmailSettings", b =>
+ {
+ b.HasOne("EmailCollector.Domain.Entities.SignupForm", "Form")
+ .WithOne("FormEmailSettings")
+ .HasForeignKey("EmailCollector.Domain.Entities.FormEmailSettings", "FormId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Form");
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.RecaptchaFormSettings", b =>
+ {
+ b.HasOne("EmailCollector.Domain.Entities.SignupForm", "Form")
+ .WithOne("RecaptchaSettings")
+ .HasForeignKey("EmailCollector.Domain.Entities.RecaptchaFormSettings", "FormId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Form");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
+ {
+ b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
+ .WithMany()
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
+ {
+ b.HasOne("EmailCollector.Domain.Entities.EmailCollectorApiUser", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
+ {
+ b.HasOne("EmailCollector.Domain.Entities.EmailCollectorApiUser", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
+ {
+ b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
+ .WithMany()
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("EmailCollector.Domain.Entities.EmailCollectorApiUser", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
+ {
+ b.HasOne("EmailCollector.Domain.Entities.EmailCollectorApiUser", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.SmtpEmailSettings", b =>
+ {
+ b.HasOne("EmailCollector.Domain.Entities.FormEmailSettings", null)
+ .WithOne()
+ .HasForeignKey("EmailCollector.Domain.Entities.SmtpEmailSettings", "FormId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.SignupForm", b =>
+ {
+ b.Navigation("CustomEmailTemplates");
+
+ b.Navigation("FormCorsSettings")
+ .IsRequired();
+
+ b.Navigation("FormEmailSettings")
+ .IsRequired();
+
+ b.Navigation("RecaptchaSettings")
+ .IsRequired();
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/EmailCollector.Api/Migrations/20241213073002_fixCustomEmailTemplateName.cs b/EmailCollector.Api/Migrations/20241213073002_fixCustomEmailTemplateName.cs
new file mode 100644
index 0000000..ff9ec45
--- /dev/null
+++ b/EmailCollector.Api/Migrations/20241213073002_fixCustomEmailTemplateName.cs
@@ -0,0 +1,22 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace EmailCollector.Api.Migrations
+{
+ ///
+ public partial class fixCustomEmailTemplateName : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+
+ }
+ }
+}
diff --git a/EmailCollector.Api/Migrations/20241213073748_AddUniqueConstraint_FormId_Event_On_CustomEmailTemplates.Designer.cs b/EmailCollector.Api/Migrations/20241213073748_AddUniqueConstraint_FormId_Event_On_CustomEmailTemplates.Designer.cs
new file mode 100644
index 0000000..3c07394
--- /dev/null
+++ b/EmailCollector.Api/Migrations/20241213073748_AddUniqueConstraint_FormId_Event_On_CustomEmailTemplates.Designer.cs
@@ -0,0 +1,536 @@
+//
+using System;
+using EmailCollector.Api.Data;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace EmailCollector.Api.Migrations
+{
+ [DbContext(typeof(EmailCollectorApiContext))]
+ [Migration("20241213073748_AddUniqueConstraint_FormId_Event_On_CustomEmailTemplates")]
+ partial class AddUniqueConstraint_FormId_Event_On_CustomEmailTemplates
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder.HasAnnotation("ProductVersion", "8.0.8");
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.ApiKey", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("CreatedAt")
+ .HasColumnType("TEXT");
+
+ b.Property("Expiration")
+ .HasColumnType("TEXT");
+
+ b.Property("IsRevoked")
+ .HasColumnType("INTEGER");
+
+ b.Property("KeyHash")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("UserId")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("ApiKeys");
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.CustomEmailTemplate", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("CreatedAt")
+ .HasColumnType("TEXT");
+
+ b.Property("Event")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("FormId")
+ .HasColumnType("TEXT");
+
+ b.Property("IsActive")
+ .HasColumnType("INTEGER");
+
+ b.Property("TemplateBodyUri")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("TemplateSubject")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("UpdatedAt")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex(new[] { "FormId", "Event" }, "IX_CustomEmailTemplate_FormId_Event_Unique")
+ .IsUnique();
+
+ b.ToTable("CustomEmailTemplates");
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.EmailCollectorApiUser", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT");
+
+ b.Property("AccessFailedCount")
+ .HasColumnType("INTEGER");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnType("TEXT");
+
+ b.Property("Email")
+ .HasMaxLength(256)
+ .HasColumnType("TEXT");
+
+ b.Property("EmailConfirmed")
+ .HasColumnType("INTEGER");
+
+ b.Property("LockoutEnabled")
+ .HasColumnType("INTEGER");
+
+ b.Property("LockoutEnd")
+ .HasColumnType("TEXT");
+
+ b.Property("NormalizedEmail")
+ .HasMaxLength(256)
+ .HasColumnType("TEXT");
+
+ b.Property("NormalizedUserName")
+ .HasMaxLength(256)
+ .HasColumnType("TEXT");
+
+ b.Property("PasswordHash")
+ .HasColumnType("TEXT");
+
+ b.Property("PhoneNumber")
+ .HasColumnType("TEXT");
+
+ b.Property("PhoneNumberConfirmed")
+ .HasColumnType("INTEGER");
+
+ b.Property("SecurityStamp")
+ .HasColumnType("TEXT");
+
+ b.Property("TwoFactorEnabled")
+ .HasColumnType("INTEGER");
+
+ b.Property("UserName")
+ .HasMaxLength(256)
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("NormalizedEmail")
+ .HasDatabaseName("EmailIndex");
+
+ b.HasIndex("NormalizedUserName")
+ .IsUnique()
+ .HasDatabaseName("UserNameIndex");
+
+ b.ToTable("AspNetUsers", (string)null);
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.EmailSignup", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("EmailAddress")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("SignupDate")
+ .HasColumnType("TEXT");
+
+ b.Property("SignupFormId")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("EmailSignups");
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.FormCorsSettings", b =>
+ {
+ b.Property("FormId")
+ .HasColumnType("TEXT");
+
+ b.Property("AllowedOrigins")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("FormId");
+
+ b.ToTable("FormCorsSettings");
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.FormEmailSettings", b =>
+ {
+ b.Property("FormId")
+ .HasColumnType("TEXT");
+
+ b.Property("EmailFrom")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("EmailMethod")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("FormId");
+
+ b.ToTable("FormEmailSettings");
+
+ b.UseTptMappingStrategy();
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.RecaptchaFormSettings", b =>
+ {
+ b.Property("FormId")
+ .HasColumnType("TEXT");
+
+ b.Property("SecretKey")
+ .HasColumnType("TEXT");
+
+ b.Property("SiteKey")
+ .HasColumnType("TEXT");
+
+ b.HasKey("FormId");
+
+ b.ToTable("RecaptchaFormSettings");
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.SignupForm", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("CreatedAt")
+ .HasColumnType("TEXT");
+
+ b.Property("CreatedBy")
+ .HasColumnType("TEXT");
+
+ b.Property("FormName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("Status")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("SignupForms");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnType("TEXT");
+
+ b.Property("Name")
+ .HasMaxLength(256)
+ .HasColumnType("TEXT");
+
+ b.Property("NormalizedName")
+ .HasMaxLength(256)
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("NormalizedName")
+ .IsUnique()
+ .HasDatabaseName("RoleNameIndex");
+
+ b.ToTable("AspNetRoles", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("ClaimType")
+ .HasColumnType("TEXT");
+
+ b.Property("ClaimValue")
+ .HasColumnType("TEXT");
+
+ b.Property("RoleId")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("AspNetRoleClaims", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("ClaimType")
+ .HasColumnType("TEXT");
+
+ b.Property("ClaimValue")
+ .HasColumnType("TEXT");
+
+ b.Property("UserId")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("AspNetUserClaims", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
+ {
+ b.Property("LoginProvider")
+ .HasColumnType("TEXT");
+
+ b.Property("ProviderKey")
+ .HasColumnType("TEXT");
+
+ b.Property("ProviderDisplayName")
+ .HasColumnType("TEXT");
+
+ b.Property("UserId")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("LoginProvider", "ProviderKey");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("AspNetUserLogins", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("TEXT");
+
+ b.Property("RoleId")
+ .HasColumnType("TEXT");
+
+ b.HasKey("UserId", "RoleId");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("AspNetUserRoles", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("TEXT");
+
+ b.Property("LoginProvider")
+ .HasColumnType("TEXT");
+
+ b.Property("Name")
+ .HasColumnType("TEXT");
+
+ b.Property("Value")
+ .HasColumnType("TEXT");
+
+ b.HasKey("UserId", "LoginProvider", "Name");
+
+ b.ToTable("AspNetUserTokens", (string)null);
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.SmtpEmailSettings", b =>
+ {
+ b.HasBaseType("EmailCollector.Domain.Entities.FormEmailSettings");
+
+ b.Property("SmtpPassword")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("SmtpPort")
+ .HasColumnType("INTEGER");
+
+ b.Property("SmtpServer")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("SmtpUsername")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.ToTable("SmtpEmailSettings", (string)null);
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.ApiKey", b =>
+ {
+ b.HasOne("EmailCollector.Domain.Entities.EmailCollectorApiUser", "User")
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.CustomEmailTemplate", b =>
+ {
+ b.HasOne("EmailCollector.Domain.Entities.SignupForm", "Form")
+ .WithMany("CustomEmailTemplates")
+ .HasForeignKey("FormId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Form");
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.FormCorsSettings", b =>
+ {
+ b.HasOne("EmailCollector.Domain.Entities.SignupForm", "Form")
+ .WithOne("FormCorsSettings")
+ .HasForeignKey("EmailCollector.Domain.Entities.FormCorsSettings", "FormId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Form");
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.FormEmailSettings", b =>
+ {
+ b.HasOne("EmailCollector.Domain.Entities.SignupForm", "Form")
+ .WithOne("FormEmailSettings")
+ .HasForeignKey("EmailCollector.Domain.Entities.FormEmailSettings", "FormId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Form");
+ });
+
+ modelBuilder.Entity("EmailCollector.Domain.Entities.RecaptchaFormSettings", b =>
+ {
+ b.HasOne("EmailCollector.Domain.Entities.SignupForm", "Form")
+ .WithOne("RecaptchaSettings")
+ .HasForeignKey("EmailCollector.Domain.Entities.RecaptchaFormSettings", "FormId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Form");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
+ {
+ b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
+ .WithMany()
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
+ {
+ b.HasOne("EmailCollector.Domain.Entities.EmailCollectorApiUser", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin