feat(cover-letter): add contextual AI workspace

This commit is contained in:
cesnimda
2026-08-28 12:34:17 +02:00
parent e3f938cb42
commit b6dcc7c760
7 changed files with 346 additions and 21 deletions
+19 -2
View File
@@ -92,6 +92,22 @@ public sealed class InterviewAiContextTests
await db.SaveChangesAsync();
}
private static async Task AttachCvAsync(JobTrackerContext db, string owner, int jobId)
{
db.CvVariants.Add(new CvVariant
{
OwnerUserId = owner,
JobApplicationId = jobId,
Name = "Backend CV",
PublicSlug = Guid.NewGuid().ToString("N"),
SettingsJson = CvVariantSettingsJson.Serialize(new CvVariantSettings()),
Version = 1,
CreatedAtUtc = DateTimeOffset.UtcNow,
UpdatedAtUtc = DateTimeOffset.UtcNow,
});
await db.SaveChangesAsync();
}
private static AiGenerateRequest Interview() => new("interview", null, null);
[Fact]
@@ -116,6 +132,7 @@ public sealed class InterviewAiContextTests
await using var _ = db;
var job = await SeedJobAsync(db, "user-1");
await SeedProfileAsync(db, "user-1");
await AttachCvAsync(db, "user-1", job.Id);
await svc.GenerateAsync("user-1", job.Id, "profile text", "Ada", Interview(), "test", default);
@@ -129,14 +146,14 @@ public sealed class InterviewAiContextTests
}
[Fact]
public async Task Other_modules_are_unchanged()
public async Task Modules_without_application_intelligence_are_unchanged()
{
var (db, svc, ai) = New("user-1");
await using var _ = db;
var job = await SeedJobAsync(db, "user-1");
await SeedProfileAsync(db, "user-1");
foreach (var module in new[] { "job-analysis", "career-match", "cover-letter", "application-review" })
foreach (var module in new[] { "job-analysis", "career-match", "application-review" })
{
await svc.GenerateAsync("user-1", job.Id, "profile text", "Ada", new AiGenerateRequest(module, null, null), "test", default);
Assert.DoesNotContain("APPLICATION INTELLIGENCE", ai.LastText);