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:
@@ -2,25 +2,25 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Novelly.Api.Beats;
|
||||
using Novelly.Api.Chapters;
|
||||
using Novelly.Api.Common;
|
||||
using Novelly.Api.Projects;
|
||||
using Novelly.Api.Novels;
|
||||
|
||||
namespace Novelly.Api.Tests;
|
||||
|
||||
[TestFixture]
|
||||
public class ChapterServiceTests : ServiceTestFixture
|
||||
{
|
||||
private Guid _projectId;
|
||||
private Guid _novelId;
|
||||
|
||||
protected override void OnSetUp()
|
||||
{
|
||||
_projectId = Projects.CreateAsync(new CreateProjectRequest("The Salt Road")).Result.Id;
|
||||
_novelId = Novels.CreateAsync(new CreateNovelRequest("The Salt Road")).Result.Id;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task Setting_a_number_that_already_exists_is_still_stored_as_given()
|
||||
{
|
||||
var first = await Chapters.CreateAsync(_projectId, new CreateChapterRequest("Landfall", Number: 5));
|
||||
var second = await Chapters.CreateAsync(_projectId, new CreateChapterRequest("The Harbour", Number: 5));
|
||||
var first = await Chapters.CreateAsync(_novelId, new CreateChapterRequest("Landfall", Number: 5));
|
||||
var second = await Chapters.CreateAsync(_novelId, new CreateChapterRequest("The Harbour", Number: 5));
|
||||
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
@@ -32,7 +32,7 @@ public class ChapterServiceTests : ServiceTestFixture
|
||||
[Test]
|
||||
public async Task Updating_leaves_omitted_fields_alone_and_clears_notes_on_empty_string()
|
||||
{
|
||||
var chapter = await Chapters.CreateAsync(_projectId, new CreateChapterRequest(
|
||||
var chapter = await Chapters.CreateAsync(_novelId, new CreateChapterRequest(
|
||||
"Landfall", Summary: "The ship makes shore.", Notes: "Check the tide tables."));
|
||||
|
||||
var renamed = (await Chapters.UpdateAsync(chapter.Id, new UpdateChapterRequest(Title: "First Landfall")))!;
|
||||
@@ -56,7 +56,7 @@ public class ChapterServiceTests : ServiceTestFixture
|
||||
[Test]
|
||||
public async Task Deleting_a_chapter_takes_its_beats_with_it()
|
||||
{
|
||||
var chapter = await Chapters.CreateAsync(_projectId, new CreateChapterRequest("Landfall"));
|
||||
var chapter = await Chapters.CreateAsync(_novelId, new CreateChapterRequest("Landfall"));
|
||||
await Beats.CreateAsync(chapter.Id, new CreateBeatRequest("She finds the map"));
|
||||
|
||||
await Chapters.DeleteAsync(chapter.Id);
|
||||
@@ -66,7 +66,7 @@ public class ChapterServiceTests : ServiceTestFixture
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task Creating_a_chapter_under_a_missing_project_returns_null_rather_than_throwing() =>
|
||||
public async Task Creating_a_chapter_under_a_missing_novel_returns_null_rather_than_throwing() =>
|
||||
Assert.That(
|
||||
await Chapters.CreateAsync(Guid.NewGuid(), new CreateChapterRequest("Landfall")),
|
||||
Is.Null);
|
||||
|
||||
Reference in New Issue
Block a user