Rename Project concept to Novel across the stack

Renames the domain concept from Project to Novel throughout the backend
(entities, DTOs, services, endpoints, ProjectAccessService/Permission,
ProjectId foreign keys), MCP server (tool names and routes), and the
React/Vite frontend (types, hooks, routes, components). Adds a new EF
Core migration (RenameProjectToNovel) using RenameTable/RenameColumn to
preserve existing data instead of dropping/recreating tables. Updates
CLAUDE.md's structure section to reference Novels/ instead of Projects/.
This commit is contained in:
James Wampler
2026-08-17 23:03:09 -07:00
parent 0ab4f568b5
commit 4313c8f206
95 changed files with 3192 additions and 1660 deletions
+10 -10
View File
@@ -1,6 +1,6 @@
using System.Threading.Channels;
using Novelly.Api.Imports;
using Novelly.Api.Projects;
using Novelly.Api.Novels;
namespace Novelly.Api.Tests;
@@ -17,7 +17,7 @@ public class ImportServiceTests : ServiceTestFixture
_queue = Channel.CreateUnbounded<Guid>();
_imports = new ImportService(
Db.Context,
Projects,
Novels,
_queue,
UserContext,
new CapturingLogger<ImportService>(),
@@ -44,7 +44,7 @@ public class ImportServiceTests : ServiceTestFixture
Assert.Multiple(() =>
{
Assert.That(inspection.Readiness, Is.EqualTo(ImportReadiness.Fresh));
Assert.That(inspection.ProjectId, Is.Null);
Assert.That(inspection.NovelId, Is.Null);
Assert.That(inspection.ChaptersTotal, Is.EqualTo(3));
Assert.That(inspection.ChaptersCompleted, Is.EqualTo(0));
});
@@ -54,7 +54,7 @@ public class ImportServiceTests : ServiceTestFixture
public async Task Inspecting_a_folder_with_an_incomplete_ledger_reports_resumable()
{
WriteChapterFiles(3);
WriteLedger("""{"projectId": "11111111-1111-1111-1111-111111111111", "completedPasses": ["project"], "completedChapters": [1]}""");
WriteLedger("""{"novelId": "11111111-1111-1111-1111-111111111111", "completedPasses": ["novel"], "completedChapters": [1]}""");
var inspection = await _imports.InspectAsync(new InspectImportRequest(_root));
@@ -72,8 +72,8 @@ public class ImportServiceTests : ServiceTestFixture
WriteChapterFiles(2);
WriteLedger("""
{
"projectId": "11111111-1111-1111-1111-111111111111",
"completedPasses": ["project", "characters", "chapters", "arcs"],
"novelId": "11111111-1111-1111-1111-111111111111",
"completedPasses": ["novel", "characters", "chapters", "arcs"],
"completedChapters": [1, 2]
}
""");
@@ -117,17 +117,17 @@ public class ImportServiceTests : ServiceTestFixture
}
[Test]
public async Task Force_restarting_a_completed_import_deletes_the_ledger_and_its_project()
public async Task Force_restarting_a_completed_import_deletes_the_ledger_and_its_novel()
{
var project = await Projects.CreateAsync(new CreateProjectRequest("The Blade Itself"));
WriteLedger($$"""{"projectId": "{{project.Id}}", "completedPasses": ["project", "characters", "chapters", "arcs"], "completedChapters": [1]}""");
var novel = await Novels.CreateAsync(new CreateNovelRequest("The Blade Itself"));
WriteLedger($$"""{"novelId": "{{novel.Id}}", "completedPasses": ["novel", "characters", "chapters", "arcs"], "completedChapters": [1]}""");
await _imports.StartOrResumeAsync(new StartImportRequest(_root, ForceRestart: true));
Assert.Multiple(() =>
{
Assert.That(File.Exists(Path.Combine(_root, ".novelly-import.json")), Is.False);
Assert.That(Projects.GetAsync(project.Id).Result, Is.Null);
Assert.That(Novels.GetAsync(novel.Id).Result, Is.Null);
});
}