6293fa89e3
Build and Push Docker Images / build (push) Failing after 1m36s
- New cv-search-models shared library: EF entities + CvSearchDbContext for cvSearch schema (JobSearchTokens, JobSearchSessions, JobSearchResults tables) - New cv-search-job worker service: polls DB for pending sessions, scrapes job boards via configurable HTML scraping, runs LLM scoring via cv-matcher-api, emails ranked results - cv-matcher-api: JobTokenService creates one-time tokens; JobSearchController handles link clicks and creates sessions - api: proxies job-search start endpoint, appends job search link to match result email - CI workflow updated to build and push myai-cv-search-job:staging image - CLAUDE.md documentation added for all affected services Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
61 lines
2.7 KiB
C#
61 lines
2.7 KiB
C#
using CvSearch.Models.Data.Entities;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace CvSearch.Models.Data;
|
|
|
|
public sealed class CvSearchDbContext : DbContext
|
|
{
|
|
public const string SchemaName = "cvSearch";
|
|
public const string MigrationTableName = "_Migrations";
|
|
|
|
public CvSearchDbContext(DbContextOptions<CvSearchDbContext> options) : base(options) { }
|
|
|
|
public DbSet<JobSearchTokenEntity> JobSearchTokens => Set<JobSearchTokenEntity>();
|
|
public DbSet<JobSearchSessionEntity> JobSearchSessions => Set<JobSearchSessionEntity>();
|
|
public DbSet<JobSearchResultEntity> JobSearchResults => Set<JobSearchResultEntity>();
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
modelBuilder.HasDefaultSchema(SchemaName);
|
|
|
|
modelBuilder.Entity<JobSearchTokenEntity>(entity =>
|
|
{
|
|
entity.ToTable("JobSearchTokens");
|
|
entity.HasKey(x => x.Id);
|
|
entity.Property(x => x.Id).HasMaxLength(64);
|
|
entity.Property(x => x.CvDocumentId).HasMaxLength(64).IsRequired();
|
|
entity.Property(x => x.Email).HasMaxLength(256).IsRequired();
|
|
entity.Property(x => x.Used).HasDefaultValue(false);
|
|
entity.Property(x => x.CreatedAt).HasDefaultValueSql("SYSUTCDATETIME()");
|
|
});
|
|
|
|
modelBuilder.Entity<JobSearchSessionEntity>(entity =>
|
|
{
|
|
entity.ToTable("JobSearchSessions");
|
|
entity.HasKey(x => x.Id);
|
|
entity.Property(x => x.Id).HasMaxLength(64);
|
|
entity.Property(x => x.TokenId).HasMaxLength(64).IsRequired();
|
|
entity.Property(x => x.CvDocumentId).HasMaxLength(64).IsRequired();
|
|
entity.Property(x => x.Email).HasMaxLength(256).IsRequired();
|
|
entity.Property(x => x.Status).HasMaxLength(32).IsRequired();
|
|
entity.Property(x => x.Keywords).HasMaxLength(1000);
|
|
entity.Property(x => x.ProviderConfigJson).IsRequired(false);
|
|
entity.Property(x => x.CreatedAt).HasDefaultValueSql("SYSUTCDATETIME()");
|
|
entity.HasIndex(x => x.Status);
|
|
});
|
|
|
|
modelBuilder.Entity<JobSearchResultEntity>(entity =>
|
|
{
|
|
entity.ToTable("JobSearchResults");
|
|
entity.HasKey(x => x.Id);
|
|
entity.Property(x => x.Id).HasMaxLength(64);
|
|
entity.Property(x => x.SessionId).HasMaxLength(64).IsRequired();
|
|
entity.Property(x => x.ProviderName).HasMaxLength(128);
|
|
entity.Property(x => x.JobUrl).HasMaxLength(2048);
|
|
entity.Property(x => x.JobTitle).HasMaxLength(512);
|
|
entity.Property(x => x.CreatedAt).HasDefaultValueSql("SYSUTCDATETIME()");
|
|
entity.HasIndex(x => x.SessionId);
|
|
});
|
|
}
|
|
}
|