1e8758796e
- Frontend: update extractApiError to check body.code first via i18n 'error.<code>' keys; add en/ro translations for cv_file_missing, captcha_verification_failed, request_cancelled - email-data migration: seed 6 fallback template keys (match N/A, subject label, unknown IP, job search results empty states for keywords/providers/location) - EmailApiEmailSender: replace "N/A", "Job", "Unknown" literals with template lookups - CvSearchEmailSender: replace "none detected", "none", "-" literals with template lookups - cv-matcher-data migration: seed parse-error.summary and parse-error.recommendation in AiPrompts - CvMatcherService: look up localized parse-error messages from AiPrompts before calling ParseResult Closes #53 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
164 lines
7.7 KiB
C#
164 lines
7.7 KiB
C#
using Email.Data;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Email.Data.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddFallbackStringTemplates : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.InsertData(
|
|
schema: MigrationConstants.SchemaName,
|
|
table: "Templates",
|
|
columns: ["Key", "Language", "Value", "Description"],
|
|
values: ["email.match.fallback-na", "en", "N/A", "Fallback when a match email field (job label or URL) has no value"]);
|
|
|
|
migrationBuilder.InsertData(
|
|
schema: MigrationConstants.SchemaName,
|
|
table: "Templates",
|
|
columns: ["Key", "Language", "Value", "Description"],
|
|
values: ["email.match.fallback-na", "ro", "N/A", "Fallback când un câmp al emailului de potrivire (etichetă job sau URL) nu are valoare"]);
|
|
|
|
migrationBuilder.InsertData(
|
|
schema: MigrationConstants.SchemaName,
|
|
table: "Templates",
|
|
columns: ["Key", "Language", "Value", "Description"],
|
|
values: ["email.match.subject-fallback-label", "en", "Job", "Fallback job label used in match email subject when no specific label is available"]);
|
|
|
|
migrationBuilder.InsertData(
|
|
schema: MigrationConstants.SchemaName,
|
|
table: "Templates",
|
|
columns: ["Key", "Language", "Value", "Description"],
|
|
values: ["email.match.subject-fallback-label", "ro", "Job", "Etichetă fallback pentru subiectul emailului de potrivire când nu există o etichetă specifică"]);
|
|
|
|
migrationBuilder.InsertData(
|
|
schema: MigrationConstants.SchemaName,
|
|
table: "Templates",
|
|
columns: ["Key", "Language", "Value", "Description"],
|
|
values: ["email.notification.unknown-ip", "en", "Unknown", "Fallback IP address label in operator notification emails"]);
|
|
|
|
migrationBuilder.InsertData(
|
|
schema: MigrationConstants.SchemaName,
|
|
table: "Templates",
|
|
columns: ["Key", "Language", "Value", "Description"],
|
|
values: ["email.notification.unknown-ip", "ro", "Necunoscut", "Etichetă fallback pentru adresa IP în emailurile de notificare operator"]);
|
|
|
|
migrationBuilder.InsertData(
|
|
schema: MigrationConstants.SchemaName,
|
|
table: "Templates",
|
|
columns: ["Key", "Language", "Value", "Description"],
|
|
values: ["email.search-results.keywords-empty", "en", "none detected", "Text shown in job search results email when no CV keywords were extracted"]);
|
|
|
|
migrationBuilder.InsertData(
|
|
schema: MigrationConstants.SchemaName,
|
|
table: "Templates",
|
|
columns: ["Key", "Language", "Value", "Description"],
|
|
values: ["email.search-results.keywords-empty", "ro", "niciunul detectat", "Text afișat în emailul cu rezultatele căutării când nu au fost extrase cuvinte cheie din CV"]);
|
|
|
|
migrationBuilder.InsertData(
|
|
schema: MigrationConstants.SchemaName,
|
|
table: "Templates",
|
|
columns: ["Key", "Language", "Value", "Description"],
|
|
values: ["email.search-results.providers-empty", "en", "none", "Text shown in job search results email when no providers were searched"]);
|
|
|
|
migrationBuilder.InsertData(
|
|
schema: MigrationConstants.SchemaName,
|
|
table: "Templates",
|
|
columns: ["Key", "Language", "Value", "Description"],
|
|
values: ["email.search-results.providers-empty", "ro", "niciunul", "Text afișat în emailul cu rezultatele căutării când nu au fost căutați furnizori"]);
|
|
|
|
migrationBuilder.InsertData(
|
|
schema: MigrationConstants.SchemaName,
|
|
table: "Templates",
|
|
columns: ["Key", "Language", "Value", "Description"],
|
|
values: ["email.search-results.location-empty", "en", "-", "Fallback location display in job search results email scan summary"]);
|
|
|
|
migrationBuilder.InsertData(
|
|
schema: MigrationConstants.SchemaName,
|
|
table: "Templates",
|
|
columns: ["Key", "Language", "Value", "Description"],
|
|
values: ["email.search-results.location-empty", "ro", "-", "Afișaj fallback pentru locație în sumarului de scanare al emailului cu rezultatele căutării"]);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DeleteData(
|
|
schema: MigrationConstants.SchemaName,
|
|
table: "Templates",
|
|
keyColumns: ["Key", "Language"],
|
|
keyValues: ["email.match.fallback-na", "en"]);
|
|
|
|
migrationBuilder.DeleteData(
|
|
schema: MigrationConstants.SchemaName,
|
|
table: "Templates",
|
|
keyColumns: ["Key", "Language"],
|
|
keyValues: ["email.match.fallback-na", "ro"]);
|
|
|
|
migrationBuilder.DeleteData(
|
|
schema: MigrationConstants.SchemaName,
|
|
table: "Templates",
|
|
keyColumns: ["Key", "Language"],
|
|
keyValues: ["email.match.subject-fallback-label", "en"]);
|
|
|
|
migrationBuilder.DeleteData(
|
|
schema: MigrationConstants.SchemaName,
|
|
table: "Templates",
|
|
keyColumns: ["Key", "Language"],
|
|
keyValues: ["email.match.subject-fallback-label", "ro"]);
|
|
|
|
migrationBuilder.DeleteData(
|
|
schema: MigrationConstants.SchemaName,
|
|
table: "Templates",
|
|
keyColumns: ["Key", "Language"],
|
|
keyValues: ["email.notification.unknown-ip", "en"]);
|
|
|
|
migrationBuilder.DeleteData(
|
|
schema: MigrationConstants.SchemaName,
|
|
table: "Templates",
|
|
keyColumns: ["Key", "Language"],
|
|
keyValues: ["email.notification.unknown-ip", "ro"]);
|
|
|
|
migrationBuilder.DeleteData(
|
|
schema: MigrationConstants.SchemaName,
|
|
table: "Templates",
|
|
keyColumns: ["Key", "Language"],
|
|
keyValues: ["email.search-results.keywords-empty", "en"]);
|
|
|
|
migrationBuilder.DeleteData(
|
|
schema: MigrationConstants.SchemaName,
|
|
table: "Templates",
|
|
keyColumns: ["Key", "Language"],
|
|
keyValues: ["email.search-results.keywords-empty", "ro"]);
|
|
|
|
migrationBuilder.DeleteData(
|
|
schema: MigrationConstants.SchemaName,
|
|
table: "Templates",
|
|
keyColumns: ["Key", "Language"],
|
|
keyValues: ["email.search-results.providers-empty", "en"]);
|
|
|
|
migrationBuilder.DeleteData(
|
|
schema: MigrationConstants.SchemaName,
|
|
table: "Templates",
|
|
keyColumns: ["Key", "Language"],
|
|
keyValues: ["email.search-results.providers-empty", "ro"]);
|
|
|
|
migrationBuilder.DeleteData(
|
|
schema: MigrationConstants.SchemaName,
|
|
table: "Templates",
|
|
keyColumns: ["Key", "Language"],
|
|
keyValues: ["email.search-results.location-empty", "en"]);
|
|
|
|
migrationBuilder.DeleteData(
|
|
schema: MigrationConstants.SchemaName,
|
|
table: "Templates",
|
|
keyColumns: ["Key", "Language"],
|
|
keyValues: ["email.search-results.location-empty", "ro"]);
|
|
}
|
|
}
|
|
}
|