Add ChapterKind for front/back matter chapters
Chapters can now be marked FrontMatter/Body/BackMatter. Number stays the manuscript sort key for every chapter; the author-facing display number is now computed per-request as the chapter's ordinal among Body chapters only, so a foreword or afterword no longer shifts the numbering of the rest of the book. Surfaced through the API, agent toolset, and import toolset.
This commit is contained in:
@@ -16,6 +16,8 @@ public class Chapter
|
||||
|
||||
public int Number { get; set; }
|
||||
|
||||
public ChapterKind Kind { get; set; } = ChapterKind.Body;
|
||||
|
||||
public string Title { get; set; } = string.Empty;
|
||||
|
||||
public string? Summary { get; set; }
|
||||
@@ -44,6 +46,7 @@ public class ChapterEntityTypeConfiguration : IEntityTypeConfiguration<Chapter>
|
||||
{
|
||||
entity.Property(c => c.Title).IsRequired().HasMaxLength(300);
|
||||
entity.Property(c => c.Status).HasConversion<string>().HasMaxLength(32);
|
||||
entity.Property(c => c.Kind).HasConversion<string>().HasMaxLength(32);
|
||||
entity.HasIndex(c => new { c.NovelId, c.Number });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user