("Value")
- .IsRequired()
- .HasColumnType("nvarchar(max)");
-
- b.HasKey("Key", "Language");
-
- b.ToTable("EmailTemplates", MigrationConstants.SchemaName);
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/Apis/email-data/Migrations/20260528130652_SeedEmailTemplates.cs b/Apis/email-data/Migrations/20260528130652_SeedEmailTemplates.cs
deleted file mode 100644
index d1fd003..0000000
--- a/Apis/email-data/Migrations/20260528130652_SeedEmailTemplates.cs
+++ /dev/null
@@ -1,178 +0,0 @@
-using Microsoft.EntityFrameworkCore.Migrations;
-using Email.Data;
-
-#nullable disable
-
-namespace Email.Data.Migrations
-{
- ///
- public partial class SeedEmailTemplates : Migration
- {
- ///
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- Seed(migrationBuilder);
- }
-
- ///
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- // Delete all seeded templates (only those we know we added)
- migrationBuilder.DeleteData(
- table: "EmailTemplates",
- keyColumns: new[] { "Key", "Language" },
- keyValues: new object[] { "email.html-shell.start", "*" });
- }
-
- private static void Seed(MigrationBuilder m)
- {
- const string op = "contact@myai.ro";
- const string schema = MigrationConstants.SchemaName;
-
- void Row(string key, string lang, string value, string description = "", string operatorCopy = "")
- => m.InsertData("EmailTemplates",
- ["Key", "Language", "Value", "Description", "OperatorCopy"],
- [key, lang, value, description, operatorCopy],
- schema);
-
- // ── HTML shell (no operator copy — these are layout fragments, not addressable emails) ──
- Row("email.html-shell.start", "*",
- "\n\n\n\n \n \n \n \n myAi\n | \n | ",
- "Opening HTML shell fragment — wrapped around every HtmlBody before sending");
-
- Row("email.html-shell.end", "*",
- " | \n | \n Automated message from myAi.\n | \n \n |
\n
\n\n",
- "Closing HTML shell fragment — appended after every HtmlBody before sending");
-
- // ── CV match result email ──
- Row("email.match.subject", "en",
- "MyAi.ro CV Match: {{score}}% - {{jobLabel}}",
- "Subject for the CV match result email",
- op);
-
- Row("email.match.subject", "ro",
- "MyAi.ro Potrivire CV: {{score}}% - {{jobLabel}}",
- "Subiect email rezultat potrivire CV",
- op);
-
- Row("email.match.body", "en",
- "CV Match Report
" +
- "" +
- "" +
- "| CV ID | " +
- "{{cvDocumentId}} | " +
- "
" +
- "" +
- "| Job | " +
- "{{jobLabel}} | " +
- "
" +
- "" +
- "| URL | " +
- "{{jobUrl}} | " +
- "
" +
- "" +
- "| Score | " +
- "{{score}}% | " +
- "
" +
- "
" +
- "Summary
" +
- "{{summary}}
" +
- "Strengths
{{strengths}}" +
- "Gaps
{{gaps}}" +
- "Recommendations
{{recommendations}}",
- "Body for the CV match result email",
- op);
-
- Row("email.match.body", "ro",
- "Raport Potrivire CV
" +
- "" +
- "" +
- "| ID Document CV | " +
- "{{cvDocumentId}} | " +
- "
" +
- "" +
- "| Job | " +
- "{{jobLabel}} | " +
- "
" +
- "" +
- "| URL | " +
- "{{jobUrl}} | " +
- "
" +
- "" +
- "| Scor | " +
- "{{score}}% | " +
- "
" +
- "
" +
- "Rezumat
" +
- "{{summary}}
" +
- "Puncte forte
{{strengths}}" +
- "Lipsuri
{{gaps}}" +
- "Recomandări
{{recommendations}}",
- "Corpul emailului pentru rezultatul potrivirii CV",
- op);
-
- Row("email.match.job-search-footer", "en",
- "" +
- "
" +
- "Want to find matching jobs automatically? " +
- "Start a job search →
" +
- "Link valid for {{expiryDays}} days." +
- "
" +
- "
",
- "Job search CTA appended to match result email",
- op);
-
- Row("email.match.job-search-footer", "ro",
- "",
- "CTA cautare joburi adaugat la emailul de potrivire CV",
- op);
-
- // ── Job search results email ──
- Row("email.search-results.subject", "en",
- "MyAi.ro: {{count}} jobs matching your CV",
- "Subject for job search results email",
- op);
-
- Row("email.search-results.subject", "ro",
- "MyAi.ro: {{count}} joburi potrivite CV-ului tau",
- "Subiect email rezultate cautare joburi",
- op);
-
- Row("email.search-results.body", "en",
- "Job Search Results
" +
- "Found {{count}} matching job(s):
" +
- "{{items}}",
- "Body preamble for job search results email",
- op);
-
- Row("email.search-results.body", "ro",
- "Rezultate Căutare Joburi
" +
- "Am găsit {{count}} job(uri) potrivite:
" +
- "{{items}}",
- "Corpul emailului de rezultate cautare joburi",
- op);
-
- Row("email.search-results.empty", "en",
- "" +
- "
No matching jobs found
" +
- "
Your job search completed but no matching jobs were found. Try again later or adjust your CV.
" +
- "
",
- "No results message for job search results email",
- op);
-
- Row("email.search-results.empty", "ro",
- "" +
- "
Niciun job potrivit găsit
" +
- "
Căutarea s-a finalizat dar nu au fost găsite joburi potrivite. Încearcă mai târziu sau ajustează CV-ul.
" +
- "
",
- "Mesaj fara rezultate pentru emailul de cautare joburi",
- op);
- }
- }
-}
diff --git a/Apis/email-data/Migrations/20260601132154_RenameEmailTemplatesToTemplates.cs b/Apis/email-data/Migrations/20260601132154_RenameEmailTemplatesToTemplates.cs
deleted file mode 100644
index a025685..0000000
--- a/Apis/email-data/Migrations/20260601132154_RenameEmailTemplatesToTemplates.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace Email.Data.Migrations
-{
- ///
- public partial class RenameEmailTemplatesToTemplates : Migration
- {
- ///
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.RenameTable(
- name: "EmailTemplates",
- schema: MigrationConstants.SchemaName,
- newName: "Templates");
- }
-
- ///
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.RenameTable(
- name: "Templates",
- schema: MigrationConstants.SchemaName,
- newName: "EmailTemplates");
- }
- }
-}
diff --git a/Apis/email-data/Migrations/20260601132154_RenameEmailTemplatesToTemplates.Designer.cs b/Apis/email-data/Migrations/20260601133043_InitialSchema.Designer.cs
similarity index 95%
rename from Apis/email-data/Migrations/20260601132154_RenameEmailTemplatesToTemplates.Designer.cs
rename to Apis/email-data/Migrations/20260601133043_InitialSchema.Designer.cs
index ac1be70..540cb27 100644
--- a/Apis/email-data/Migrations/20260601132154_RenameEmailTemplatesToTemplates.Designer.cs
+++ b/Apis/email-data/Migrations/20260601133043_InitialSchema.Designer.cs
@@ -12,8 +12,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace Email.Data.Migrations
{
[DbContext(typeof(EmailDbContext))]
- [Migration("20260601132154_RenameEmailTemplatesToTemplates")]
- partial class RenameEmailTemplatesToTemplates
+ [Migration("20260601133043_InitialSchema")]
+ partial class InitialSchema
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
diff --git a/Apis/email-data/Migrations/20260601133043_InitialSchema.cs b/Apis/email-data/Migrations/20260601133043_InitialSchema.cs
new file mode 100644
index 0000000..91c2012
--- /dev/null
+++ b/Apis/email-data/Migrations/20260601133043_InitialSchema.cs
@@ -0,0 +1,43 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace Email.Data.Migrations
+{
+ ///
+ public partial class InitialSchema : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.EnsureSchema(
+ name: "email");
+
+ migrationBuilder.CreateTable(
+ name: "Templates",
+ schema: "email",
+ columns: table => new
+ {
+ Key = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false),
+ Language = table.Column(type: "nvarchar(8)", maxLength: 8, nullable: false),
+ Value = table.Column(type: "nvarchar(max)", nullable: false),
+ Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: false, defaultValue: ""),
+ UpdatedAt = table.Column(type: "datetime2", nullable: false, defaultValueSql: "SYSUTCDATETIME()"),
+ OperatorCopy = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false, defaultValue: "")
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Templates", x => new { x.Key, x.Language });
+ });
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "Templates",
+ schema: "email");
+ }
+ }
+}
diff --git a/Apis/email-data/Migrations/EmailDbContextModelSnapshot.cs b/Apis/email-data/Migrations/EmailDbContextModelSnapshot.cs
index db53a2d..6556cfb 100644
--- a/Apis/email-data/Migrations/EmailDbContextModelSnapshot.cs
+++ b/Apis/email-data/Migrations/EmailDbContextModelSnapshot.cs
@@ -17,7 +17,7 @@ namespace Email.Data.Migrations
{
#pragma warning disable 612, 618
modelBuilder
- .HasDefaultSchema(MigrationConstants.SchemaName)
+ .HasDefaultSchema("email")
.HasAnnotation("ProductVersion", "10.0.7")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
@@ -58,7 +58,7 @@ namespace Email.Data.Migrations
b.HasKey("Key", "Language");
- b.ToTable("Templates", MigrationConstants.SchemaName);
+ b.ToTable("Templates", "email");
});
#pragma warning restore 612, 618
}