diff --git a/PlotLine.Tests/Program.cs b/PlotLine.Tests/Program.cs index d922360..0d7dd7e 100644 --- a/PlotLine.Tests/Program.cs +++ b/PlotLine.Tests/Program.cs @@ -627,7 +627,9 @@ static void StoryIntelligenceReviewCentreRouteReplacesLinearReviewResume() var view = File.ReadAllText(Path.Combine(root, "Views/Onboarding/StoryIntelligenceReviewCentre.cshtml")); Assert(controller.Contains("story-intelligence/review-centre", StringComparison.Ordinal), "Review Centre route should exist."); - Assert(controller.Contains("StoryIntelligenceResumeRoutes.ReviewCentre => RedirectToAction(nameof(StoryIntelligenceReviewCentre)", StringComparison.Ordinal), "Resume routing should open Review Centre."); + Assert(controller.Contains("story-intelligence/book/{bookId:int}/review-centre", StringComparison.Ordinal), "Review Centre should have a persistent book-based route."); + Assert(controller.Contains("=> await StoryIntelligenceBookReviewCentre(bookId);", StringComparison.Ordinal), "Continue should render the persistent book Review Centre route."); + Assert(controller.Contains("StoryIntelligenceResumeRoutes.ReviewCentre => await StoryIntelligenceReviewCentre(target.BatchID)", StringComparison.Ordinal), "Resume routing should render Review Centre."); Assert(service.Contains("public const string ReviewCentre = \"ReviewCentre\";", StringComparison.Ordinal), "Resume route constants should include ReviewCentre."); Assert(service.Contains("SceneAnalysisComplete(state)\n ? StoryIntelligenceResumeRoutes.ReviewCentre", StringComparison.Ordinal), "Completed scene analysis should resume to Review Centre."); Assert(view.Contains("Your manuscript analysis is complete.", StringComparison.Ordinal), "Review Centre should describe completed analysis."); diff --git a/PlotLine/Controllers/OnboardingController.cs b/PlotLine/Controllers/OnboardingController.cs index f6d06fd..a58e5f1 100644 --- a/PlotLine/Controllers/OnboardingController.cs +++ b/PlotLine/Controllers/OnboardingController.cs @@ -105,6 +105,10 @@ public sealed class OnboardingController(IOnboardingService onboarding, IOnboard [HttpGet("story-intelligence/book/{bookId:int}/continue")] public async Task ContinueStoryIntelligence(int bookId) + => await StoryIntelligenceBookReviewCentre(bookId); + + [HttpGet("story-intelligence/book/{bookId:int}/review-centre")] + public async Task StoryIntelligenceBookReviewCentre(int bookId) { var target = await storyIntelligence.ResumeBookAsync(bookId); if (target is null) @@ -115,14 +119,14 @@ public sealed class OnboardingController(IOnboardingService onboarding, IOnboard return target.Route switch { - StoryIntelligenceResumeRoutes.ReviewCentre => RedirectToAction(nameof(StoryIntelligenceReviewCentre), new { batchId = target.BatchID }), - StoryIntelligenceResumeRoutes.Complete => RedirectToAction(nameof(StoryIntelligenceReviewCentre), new { batchId = target.BatchID }), - StoryIntelligenceResumeRoutes.Narrative => RedirectToAction(nameof(StoryIntelligenceReviewCentre), new { batchId = target.BatchID }), - StoryIntelligenceResumeRoutes.Knowledge => RedirectToAction(nameof(StoryIntelligenceReviewCentre), new { batchId = target.BatchID }), - StoryIntelligenceResumeRoutes.Relationships => RedirectToAction(nameof(StoryIntelligenceReviewCentre), new { batchId = target.BatchID }), - StoryIntelligenceResumeRoutes.Assets => RedirectToAction(nameof(StoryIntelligenceReviewCentre), new { batchId = target.BatchID }), - StoryIntelligenceResumeRoutes.Locations => RedirectToAction(nameof(StoryIntelligenceReviewCentre), new { batchId = target.BatchID }), - StoryIntelligenceResumeRoutes.Characters => RedirectToAction(nameof(StoryIntelligenceReviewCentre), new { batchId = target.BatchID }), + StoryIntelligenceResumeRoutes.ReviewCentre => await StoryIntelligenceReviewCentre(target.BatchID), + StoryIntelligenceResumeRoutes.Complete => await StoryIntelligenceReviewCentre(target.BatchID), + StoryIntelligenceResumeRoutes.Narrative => await StoryIntelligenceReviewCentre(target.BatchID), + StoryIntelligenceResumeRoutes.Knowledge => await StoryIntelligenceReviewCentre(target.BatchID), + StoryIntelligenceResumeRoutes.Relationships => await StoryIntelligenceReviewCentre(target.BatchID), + StoryIntelligenceResumeRoutes.Assets => await StoryIntelligenceReviewCentre(target.BatchID), + StoryIntelligenceResumeRoutes.Locations => await StoryIntelligenceReviewCentre(target.BatchID), + StoryIntelligenceResumeRoutes.Characters => await StoryIntelligenceReviewCentre(target.BatchID), _ => RedirectToAction("Details", "Books", new { id = bookId }) }; }