Move RAG repository from rag-api to rag-data — consolidate data layer ownership

- Move IRagRepository, EfRagRepository, and VectorSerializer from rag-api/Data to rag-data/Repositories
- Add rag-api-models ProjectReference to rag-data.csproj for model type availability
- Delete rag-api/Data folder (no longer needed; all data access is now in rag-data)
- This aligns RAG with email-api and other services: all data code in the data project

Pattern: rag-api (API logic) → rag-data (repository, EF entities, migrations)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-05-29 09:38:25 +03:00
parent 36759d8fee
commit 487924e345
25 changed files with 125 additions and 57 deletions
@@ -1,5 +1,6 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using CvMatcher.Data;
#nullable disable
@@ -12,11 +13,11 @@ namespace CvMatcher.Data.Migrations
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.EnsureSchema(
name: "cvMatcher");
name: MigrationConstants.SchemaName);
migrationBuilder.CreateTable(
name: "ChatCache",
schema: "cvMatcher",
schema: MigrationConstants.SchemaName,
columns: table => new
{
CacheKey = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
@@ -32,7 +33,7 @@ namespace CvMatcher.Data.Migrations
migrationBuilder.CreateTable(
name: "Results",
schema: "cvMatcher",
schema: MigrationConstants.SchemaName,
columns: table => new
{
Id = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
@@ -49,7 +50,7 @@ namespace CvMatcher.Data.Migrations
migrationBuilder.CreateIndex(
name: "IX_Results_CvDocumentId_JobDocumentId",
schema: "cvMatcher",
schema: MigrationConstants.SchemaName,
table: "Results",
columns: new[] { "CvDocumentId", "JobDocumentId" },
unique: true);
@@ -60,11 +61,11 @@ namespace CvMatcher.Data.Migrations
{
migrationBuilder.DropTable(
name: "ChatCache",
schema: "cvMatcher");
schema: MigrationConstants.SchemaName);
migrationBuilder.DropTable(
name: "Results",
schema: "cvMatcher");
schema: MigrationConstants.SchemaName);
}
}
}
@@ -1,4 +1,5 @@
using Microsoft.EntityFrameworkCore.Migrations;
using CvMatcher.Data;
#nullable disable
@@ -12,7 +13,7 @@ namespace CvMatcher.Data.Migrations
{
migrationBuilder.AddColumn<string>(
name: "Language",
schema: "cvMatcher",
schema: MigrationConstants.SchemaName,
table: "Results",
type: "nvarchar(max)",
nullable: false,
@@ -24,7 +25,7 @@ namespace CvMatcher.Data.Migrations
{
migrationBuilder.DropColumn(
name: "Language",
schema: "cvMatcher",
schema: MigrationConstants.SchemaName,
table: "Results");
}
}
@@ -1,5 +1,6 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using CvMatcher.Data;
#nullable disable
@@ -13,7 +14,7 @@ namespace CvMatcher.Data.Migrations
{
migrationBuilder.CreateTable(
name: "AiPrompts",
schema: "cvMatcher",
schema: MigrationConstants.SchemaName,
columns: table => new
{
Key = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
@@ -28,7 +29,7 @@ namespace CvMatcher.Data.Migrations
});
migrationBuilder.InsertData(
schema: "cvMatcher",
schema: MigrationConstants.SchemaName,
table: "AiPrompts",
columns: ["Key", "Language", "Value", "Description"],
values: new object[]
@@ -43,7 +44,7 @@ namespace CvMatcher.Data.Migrations
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(name: "AiPrompts", schema: "cvMatcher");
migrationBuilder.DropTable(name: "AiPrompts", schema: MigrationConstants.SchemaName);
}
}
}