Add batch character assignment for chapter outline beats

Lets a writer select several beats and add one character to all of them
at once, without disturbing each beat's existing characters. Surfaced
through the REST API, the embedded agent, and the MCP server per the
project's rule that all three share the same service methods.
This commit is contained in:
James Wampler
2026-08-15 20:36:25 -07:00
parent 6774a38684
commit df10b1f99b
9 changed files with 277 additions and 33 deletions
+5
View File
@@ -34,6 +34,11 @@ public static class BeatEndpoints
(await service.ReorderAsync(chapterId, request, ct))?.Select(b => b.ToResponse()).ToList().ToApiResult())
.WithSummary("Renumber a chapter's beats to match the order given.");
chapterScoped.MapPost("/assign-character", async (
Guid chapterId, AssignCharacterToBeatsRequest request, BeatService service, CancellationToken ct) =>
(await service.AssignCharacterAsync(chapterId, request, ct))?.Select(b => b.ToResponse()).ToList().ToApiResult())
.WithSummary("Add a character to several beats at once, leaving each beat's existing characters alone.");
app.MapGet("/api/characters/{characterId:guid}/beats", async (
Guid characterId, BeatService service, CancellationToken ct) =>
(await service.ListForCharacterAsync(characterId, ct))?.Select(b => b.ToCharacterBeatResponse()).ToList().ToApiResult())