using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace EmailApi.Data.Migrations { /// public partial class CreateEmailTemplates : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.EnsureSchema(name: "emailApi"); migrationBuilder.CreateTable( name: "EmailTemplates", schema: "emailApi", 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_EmailTemplates", x => new { x.Key, x.Language }); }); Seed(migrationBuilder); } private static void Seed(MigrationBuilder m) { const string op = "contact@myai.ro"; 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], "emailApi"); // ── 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 \n \n \n
\n

myAi

\n
", "Opening HTML shell fragment — wrapped around every HtmlBody before sending"); Row("email.html-shell.end", "*", "
\n Automated message from myAi.\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", "
" + "

" + "Vrei să găsești joburi potrivite automat? " + "Pornește o căutare de joburi →
" + "Link valabil {{expiryDays}} zile." + "

" + "
", "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); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable(name: "EmailTemplates", schema: "emailApi"); } } }