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>
68 lines
3.1 KiB
C#
68 lines
3.1 KiB
C#
using CvMatcher.Data;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace CvMatcher.Data.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddParseErrorPrompts : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.InsertData(
|
|
schema: MigrationConstants.SchemaName,
|
|
table: "AiPrompts",
|
|
columns: ["Key", "Language", "Value", "Description"],
|
|
values: ["parse-error.summary", "en", "The AI response could not be parsed. Please try again.", "Summary shown in match email when the AI returns an unparseable response"]);
|
|
|
|
migrationBuilder.InsertData(
|
|
schema: MigrationConstants.SchemaName,
|
|
table: "AiPrompts",
|
|
columns: ["Key", "Language", "Value", "Description"],
|
|
values: ["parse-error.summary", "ro", "Răspunsul AI nu a putut fi interpretat. Vă rugăm să încercați din nou.", "Sumar afișat în emailul de potrivire când AI returnează un răspuns care nu poate fi interpretat"]);
|
|
|
|
migrationBuilder.InsertData(
|
|
schema: MigrationConstants.SchemaName,
|
|
table: "AiPrompts",
|
|
columns: ["Key", "Language", "Value", "Description"],
|
|
values: ["parse-error.recommendation", "en", "If the problem persists, try a different job link or description.", "Recommendation shown in match email when the AI returns an unparseable response"]);
|
|
|
|
migrationBuilder.InsertData(
|
|
schema: MigrationConstants.SchemaName,
|
|
table: "AiPrompts",
|
|
columns: ["Key", "Language", "Value", "Description"],
|
|
values: ["parse-error.recommendation", "ro", "Dacă problema persistă, încercați un alt link sau descriere de job.", "Recomandare afișată în emailul de potrivire când AI returnează un răspuns care nu poate fi interpretat"]);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DeleteData(
|
|
schema: MigrationConstants.SchemaName,
|
|
table: "AiPrompts",
|
|
keyColumns: ["Key", "Language"],
|
|
keyValues: ["parse-error.summary", "en"]);
|
|
|
|
migrationBuilder.DeleteData(
|
|
schema: MigrationConstants.SchemaName,
|
|
table: "AiPrompts",
|
|
keyColumns: ["Key", "Language"],
|
|
keyValues: ["parse-error.summary", "ro"]);
|
|
|
|
migrationBuilder.DeleteData(
|
|
schema: MigrationConstants.SchemaName,
|
|
table: "AiPrompts",
|
|
keyColumns: ["Key", "Language"],
|
|
keyValues: ["parse-error.recommendation", "en"]);
|
|
|
|
migrationBuilder.DeleteData(
|
|
schema: MigrationConstants.SchemaName,
|
|
table: "AiPrompts",
|
|
keyColumns: ["Key", "Language"],
|
|
keyValues: ["parse-error.recommendation", "ro"]);
|
|
}
|
|
}
|
|
}
|