From 33d92551da3d7af22b984bd2dbe1ffb40aabb541 Mon Sep 17 00:00:00 2001 From: claude Date: Fri, 29 May 2026 09:45:42 +0300 Subject: [PATCH] Remove duplicate Data folders from models projects - Delete cv-search-models/Data (duplicate of cv-search-data/Data) - Delete myai-models/Data (duplicate of myai-data/Data) - DbContext and Entities belong only in -data projects, not -models Co-Authored-By: Claude Haiku 4.5 --- .../Data/CvSearchDbContext.cs | 62 ------------------- .../Data/Entities/JobSearchResultEntity.cs | 14 ----- .../Data/Entities/JobSearchSessionEntity.cs | 22 ------- .../Data/Entities/JobSearchTokenEntity.cs | 12 ---- .../Data/Entities/TemplateEntity.cs | 10 --- Apis/myai-models/Data/MyAiDbContext.cs | 30 --------- 6 files changed, 150 deletions(-) delete mode 100644 Apis/cv-search-models/Data/CvSearchDbContext.cs delete mode 100644 Apis/cv-search-models/Data/Entities/JobSearchResultEntity.cs delete mode 100644 Apis/cv-search-models/Data/Entities/JobSearchSessionEntity.cs delete mode 100644 Apis/cv-search-models/Data/Entities/JobSearchTokenEntity.cs delete mode 100644 Apis/myai-models/Data/Entities/TemplateEntity.cs delete mode 100644 Apis/myai-models/Data/MyAiDbContext.cs diff --git a/Apis/cv-search-models/Data/CvSearchDbContext.cs b/Apis/cv-search-models/Data/CvSearchDbContext.cs deleted file mode 100644 index 2686c2d..0000000 --- a/Apis/cv-search-models/Data/CvSearchDbContext.cs +++ /dev/null @@ -1,62 +0,0 @@ -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 options) : base(options) { } - - public DbSet JobSearchTokens => Set(); - public DbSet JobSearchSessions => Set(); - public DbSet JobSearchResults => Set(); - - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - modelBuilder.HasDefaultSchema(SchemaName); - - modelBuilder.Entity(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.Language).HasMaxLength(8).HasDefaultValue("en").IsRequired(); - entity.Property(x => x.Used).HasDefaultValue(false); - entity.Property(x => x.CreatedAt).HasDefaultValueSql("SYSUTCDATETIME()"); - }); - - modelBuilder.Entity(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.Language).HasMaxLength(8).HasDefaultValue("en").IsRequired(); - entity.Property(x => x.CreatedAt).HasDefaultValueSql("SYSUTCDATETIME()"); - entity.HasIndex(x => x.Status); - }); - - modelBuilder.Entity(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); - }); - } -} diff --git a/Apis/cv-search-models/Data/Entities/JobSearchResultEntity.cs b/Apis/cv-search-models/Data/Entities/JobSearchResultEntity.cs deleted file mode 100644 index 7cea013..0000000 --- a/Apis/cv-search-models/Data/Entities/JobSearchResultEntity.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace CvSearch.Models.Data.Entities; - -public sealed class JobSearchResultEntity -{ - public string Id { get; set; } = string.Empty; - public string SessionId { get; set; } = string.Empty; - public string ProviderName { get; set; } = string.Empty; - public string JobUrl { get; set; } = string.Empty; - public string JobTitle { get; set; } = string.Empty; - public string JobText { get; set; } = string.Empty; - public int Score { get; set; } - public string ResultJson { get; set; } = string.Empty; - public DateTime CreatedAt { get; set; } = DateTime.UtcNow; -} diff --git a/Apis/cv-search-models/Data/Entities/JobSearchSessionEntity.cs b/Apis/cv-search-models/Data/Entities/JobSearchSessionEntity.cs deleted file mode 100644 index 7985a3a..0000000 --- a/Apis/cv-search-models/Data/Entities/JobSearchSessionEntity.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace CvSearch.Models.Data.Entities; - -public sealed class JobSearchSessionEntity -{ - public string Id { get; set; } = string.Empty; - public string TokenId { get; set; } = string.Empty; - public string CvDocumentId { get; set; } = string.Empty; - public string Email { get; set; } = string.Empty; - public string Status { get; set; } = JobSearchStatus.Pending; - public string Keywords { get; set; } = string.Empty; - public string? ProviderConfigJson { get; set; } - public string Language { get; set; } = "en"; - public DateTime CreatedAt { get; set; } = DateTime.UtcNow; -} - -public static class JobSearchStatus -{ - public const string Pending = "Pending"; - public const string Processing = "Processing"; - public const string Done = "Done"; - public const string Failed = "Failed"; -} diff --git a/Apis/cv-search-models/Data/Entities/JobSearchTokenEntity.cs b/Apis/cv-search-models/Data/Entities/JobSearchTokenEntity.cs deleted file mode 100644 index 08d2f67..0000000 --- a/Apis/cv-search-models/Data/Entities/JobSearchTokenEntity.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace CvSearch.Models.Data.Entities; - -public sealed class JobSearchTokenEntity -{ - public string Id { get; set; } = string.Empty; - public string CvDocumentId { get; set; } = string.Empty; - public string Email { get; set; } = string.Empty; - public string Language { get; set; } = "en"; - public DateTime ExpiresAt { get; set; } - public bool Used { get; set; } - public DateTime CreatedAt { get; set; } = DateTime.UtcNow; -} diff --git a/Apis/myai-models/Data/Entities/TemplateEntity.cs b/Apis/myai-models/Data/Entities/TemplateEntity.cs deleted file mode 100644 index 8eb1946..0000000 --- a/Apis/myai-models/Data/Entities/TemplateEntity.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace MyAi.Models.Data.Entities; - -public sealed class TemplateEntity -{ - public string Key { get; set; } = string.Empty; - public string Language { get; set; } = string.Empty; - public string Value { get; set; } = string.Empty; - public string Description { get; set; } = string.Empty; - public DateTime UpdatedAt { get; set; } -} diff --git a/Apis/myai-models/Data/MyAiDbContext.cs b/Apis/myai-models/Data/MyAiDbContext.cs deleted file mode 100644 index 2b1c123..0000000 --- a/Apis/myai-models/Data/MyAiDbContext.cs +++ /dev/null @@ -1,30 +0,0 @@ -using MyAi.Models.Data.Entities; -using Microsoft.EntityFrameworkCore; - -namespace MyAi.Models.Data; - -public sealed class MyAiDbContext : DbContext -{ - public const string SchemaName = "myAi"; - public const string MigrationTableName = "_MyAiMigrations"; - - public MyAiDbContext(DbContextOptions options) : base(options) { } - - public DbSet Templates => Set(); - - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - modelBuilder.HasDefaultSchema(SchemaName); - - modelBuilder.Entity(entity => - { - entity.ToTable("Templates"); - entity.HasKey(x => new { x.Key, x.Language }); - entity.Property(x => x.Key).HasMaxLength(128); - entity.Property(x => x.Language).HasMaxLength(8); - entity.Property(x => x.Value).IsRequired(); - entity.Property(x => x.Description).HasMaxLength(500).HasDefaultValue(string.Empty); - entity.Property(x => x.UpdatedAt).HasDefaultValueSql("SYSUTCDATETIME()"); - }); - } -}