diff --git a/Apis/cv-matcher-api/Services/CvMatcherService.cs b/Apis/cv-matcher-api/Services/CvMatcherService.cs index 2c8ac17..a35f8fe 100644 --- a/Apis/cv-matcher-api/Services/CvMatcherService.cs +++ b/Apis/cv-matcher-api/Services/CvMatcherService.cs @@ -125,9 +125,9 @@ public sealed class CvMatcherService : ICvMatcherService var evidence = evidenceChunks.Count > 0 ? string.Join("\n\n", evidenceChunks.Take(4)) : Limit(job.Text, 4000); var systemPrompt = await _aiPrompts.GetAsync("ai.cv-match.system-prompt", language, ct) - ?? (language == "ro" - ? "Ești un motor strict de potrivire CV-job. Returnează doar JSON. Punctează realist între 0 și 100." - : "You are a strict CV-to-job matching engine. Return JSON only. Score realistically from 0 to 100."); + ?? throw new InvalidOperationException( + $"AI prompt not found: key='ai.cv-match.system-prompt', language='{language}'. " + + $"This is a configuration error. Ensure the cvMatcher.AiPrompts table is properly seeded with language-specific prompts."); var userPrompt = $""" CV: diff --git a/Apis/email-data/Services/EmailTemplateService.cs b/Apis/email-data/Services/EmailTemplateService.cs index 8cd338d..f59220b 100644 --- a/Apis/email-data/Services/EmailTemplateService.cs +++ b/Apis/email-data/Services/EmailTemplateService.cs @@ -37,8 +37,9 @@ public sealed class EmailTemplateService : IEmailTemplateService && _valueCache.TryGetValue(CacheKey(key, "en"), out var fallback)) return fallback; - _logger.LogWarning("Email template not found: key={Key}, language={Language}", key, language); - return key; + throw new InvalidOperationException( + $"Email template not found: key='{key}', language='{language}'. " + + $"This is a configuration error. Ensure the email.Templates table is properly seeded."); } ///