382 lines
15 KiB
C#
382 lines
15 KiB
C#
namespace PlotLine.Models;
|
|
|
|
public static class ManuscriptScanSources
|
|
{
|
|
public const string WordCompanion = "WordCompanion";
|
|
}
|
|
|
|
public static class ManuscriptScanStatuses
|
|
{
|
|
public const string NotStarted = "NotStarted";
|
|
public const string Running = "Running";
|
|
public const string Complete = "Complete";
|
|
public const string Failed = "Failed";
|
|
}
|
|
|
|
public static class ManuscriptScanReviewStatuses
|
|
{
|
|
public const string ScanComplete = "ScanComplete";
|
|
public const string ReviewInProgress = "ReviewInProgress";
|
|
public const string ReviewComplete = "ReviewComplete";
|
|
public const string ReadyToImport = "ReadyToImport";
|
|
public const string CoreImportComplete = "CoreImportComplete";
|
|
}
|
|
|
|
public sealed class ManuscriptScanCommand
|
|
{
|
|
public Guid ScanID { get; init; }
|
|
public int UserID { get; init; }
|
|
public int OnboardingID { get; init; }
|
|
public int ProjectID { get; init; }
|
|
public int BookID { get; init; }
|
|
public DateTime RequestedUtc { get; init; }
|
|
}
|
|
|
|
public sealed class ManuscriptScanProgress
|
|
{
|
|
public int? UserID { get; init; }
|
|
public int OnboardingID { get; init; }
|
|
public string Message { get; init; } = string.Empty;
|
|
public int? PercentComplete { get; init; }
|
|
public int ChapterCount { get; init; }
|
|
public int SceneCount { get; init; }
|
|
public int CharacterCandidateCount { get; init; }
|
|
public int TotalWordCount { get; init; }
|
|
}
|
|
|
|
public sealed class ManuscriptScanFailure
|
|
{
|
|
public int? UserID { get; init; }
|
|
public int OnboardingID { get; init; }
|
|
public string Message { get; init; } = string.Empty;
|
|
}
|
|
|
|
public sealed class ManuscriptScanChunk
|
|
{
|
|
public Guid ScanID { get; init; }
|
|
public int? UserID { get; init; }
|
|
public int OnboardingID { get; init; }
|
|
public int ChunkIndex { get; init; }
|
|
public int TotalChunks { get; init; }
|
|
public int TotalLength { get; init; }
|
|
public string Payload { get; init; } = string.Empty;
|
|
}
|
|
|
|
public sealed class ManuscriptScanPreview
|
|
{
|
|
public Guid PreviewID { get; init; } = Guid.NewGuid();
|
|
public int UserID { get; init; }
|
|
public int OnboardingID { get; init; }
|
|
public int ProjectID { get; init; }
|
|
public int BookID { get; init; }
|
|
public string Source { get; init; } = ManuscriptScanSources.WordCompanion;
|
|
public string? DocumentTitle { get; init; }
|
|
public string? CompanionDocumentIdentifier { get; init; }
|
|
public int TotalWordCount { get; init; }
|
|
public int ChapterCount { get; init; }
|
|
public int SceneCount { get; init; }
|
|
public int CharacterCandidateCount { get; init; }
|
|
public DateTime CreatedUtc { get; init; } = DateTime.UtcNow;
|
|
public IReadOnlyList<ManuscriptScanChapterPreview> Chapters { get; init; } = [];
|
|
public IReadOnlyList<ManuscriptScanScenePreview> Scenes { get; init; } = [];
|
|
public IReadOnlyList<ManuscriptScanCharacterCandidatePreview> CharacterCandidates { get; init; } = [];
|
|
}
|
|
|
|
public sealed class ManuscriptScanChapterPreview
|
|
{
|
|
public string TemporaryChapterKey { get; init; } = string.Empty;
|
|
public int ChapterNumber { get; init; }
|
|
public string Title { get; init; } = string.Empty;
|
|
public int WordCount { get; init; }
|
|
public string? ChapterText { get; init; }
|
|
public int? StartPosition { get; init; }
|
|
public int? ExistingChapterID { get; init; }
|
|
public IReadOnlyList<ManuscriptScanParagraphMap> ParagraphMap { get; init; } = [];
|
|
public IReadOnlyList<ManuscriptScanSourceParagraph> SourceParagraphs { get; init; } = [];
|
|
}
|
|
|
|
public sealed class ManuscriptScanParagraphMap
|
|
{
|
|
public int StructuralParagraphOrdinal { get; init; }
|
|
public int WordParagraphIndex { get; init; }
|
|
public string Text { get; init; } = string.Empty;
|
|
}
|
|
|
|
public sealed class ManuscriptScanSourceParagraph
|
|
{
|
|
public int WordParagraphIndex { get; init; }
|
|
public string Text { get; init; } = string.Empty;
|
|
public bool IsBlank { get; init; }
|
|
public bool IsChapterHeading { get; init; }
|
|
public bool IsSceneHeading { get; init; }
|
|
public bool IsSceneSeparator { get; init; }
|
|
public bool IncludeInSourceText { get; init; }
|
|
}
|
|
|
|
public sealed class ManuscriptScanScenePreview
|
|
{
|
|
public string TemporarySceneKey { get; init; } = string.Empty;
|
|
public string TemporaryChapterKey { get; init; } = string.Empty;
|
|
public int SceneNumberWithinChapter { get; init; }
|
|
public string? Title { get; init; }
|
|
public int WordCount { get; init; }
|
|
public string? OpeningTextPreview { get; init; }
|
|
public int? StartPosition { get; init; }
|
|
public int? ExistingSceneID { get; init; }
|
|
}
|
|
|
|
public sealed class ManuscriptScanCharacterCandidatePreview
|
|
{
|
|
public string TemporaryCharacterKey { get; init; } = string.Empty;
|
|
public string Name { get; init; } = string.Empty;
|
|
public int MentionCount { get; init; }
|
|
public int QualityScore { get; init; }
|
|
public string Category { get; init; } = "PossibleCharacter";
|
|
public string? Reason { get; init; }
|
|
public bool IsExistingCharacterMatch { get; init; }
|
|
public string? SuggestedImportance { get; init; }
|
|
public IReadOnlyList<ManuscriptScanCharacterEvidenceScene> EvidenceScenes { get; init; } = [];
|
|
}
|
|
|
|
public sealed class ManuscriptScanCharacterEvidenceScene
|
|
{
|
|
public int SceneID { get; init; }
|
|
public int ChapterID { get; init; }
|
|
public int ChapterNumber { get; init; }
|
|
public int SceneNumber { get; init; }
|
|
public int MentionCount { get; init; }
|
|
public string? StructuralSummary { get; init; }
|
|
}
|
|
|
|
public static class CoreImportBasicLocationReviewStatuses
|
|
{
|
|
public const string Pending = "Pending";
|
|
public const string Completed = "Completed";
|
|
public const string Skipped = "Skipped";
|
|
}
|
|
|
|
public static class CoreImportBasicLocationCandidateActions
|
|
{
|
|
public const string Create = "Create";
|
|
public const string SameLocation = "SameLocation";
|
|
public const string Ignore = "Ignore";
|
|
}
|
|
|
|
public sealed class CoreImportBasicLocationReview
|
|
{
|
|
public int CoreImportBasicLocationReviewID { get; set; }
|
|
public Guid PreviewID { get; set; }
|
|
public int UserID { get; set; }
|
|
public int ProjectID { get; set; }
|
|
public int BookID { get; set; }
|
|
public int? BuildID { get; set; }
|
|
public string Status { get; set; } = CoreImportBasicLocationReviewStatuses.Pending;
|
|
public int RawObservationCount { get; set; }
|
|
public int CandidateCount { get; set; }
|
|
public DateTime CreatedUtc { get; set; }
|
|
public DateTime UpdatedUtc { get; set; }
|
|
public DateTime? CompletedUtc { get; set; }
|
|
}
|
|
|
|
public sealed class CoreImportBasicLocationCandidate
|
|
{
|
|
public int CoreImportBasicLocationCandidateID { get; set; }
|
|
public int CoreImportBasicLocationReviewID { get; set; }
|
|
public string StableKey { get; set; } = string.Empty;
|
|
public string ProposedName { get; set; } = string.Empty;
|
|
public string PreferredName { get; set; } = string.Empty;
|
|
public string KnownNamesJson { get; set; } = "[]";
|
|
public int? ParentLocationID { get; set; }
|
|
public string? ParentCandidateKey { get; set; }
|
|
public int? ExistingLocationID { get; set; }
|
|
public string Action { get; set; } = CoreImportBasicLocationCandidateActions.Create;
|
|
public int? SameAsLocationID { get; set; }
|
|
public string? SameAsCandidateKey { get; set; }
|
|
public int? ResultLocationID { get; set; }
|
|
public int FirstChapterNumber { get; set; }
|
|
public int FirstSceneNumber { get; set; }
|
|
public int FirstOccurrenceIndex { get; set; }
|
|
public int ObservationCount { get; set; }
|
|
public int SortOrder { get; set; }
|
|
public DateTime CreatedUtc { get; set; }
|
|
public DateTime UpdatedUtc { get; set; }
|
|
public IReadOnlyList<CoreImportBasicLocationEvidence> Evidence { get; set; } = [];
|
|
}
|
|
|
|
public sealed class CoreImportBasicLocationEvidence
|
|
{
|
|
public int CoreImportBasicLocationEvidenceID { get; set; }
|
|
public int CoreImportBasicLocationCandidateID { get; set; }
|
|
public int SceneID { get; set; }
|
|
public int ChapterID { get; set; }
|
|
public int ChapterNumber { get; set; }
|
|
public int SceneNumber { get; set; }
|
|
public int OccurrenceIndex { get; set; }
|
|
public string EvidenceText { get; set; } = string.Empty;
|
|
public int SortOrder { get; set; }
|
|
}
|
|
|
|
public sealed class CoreImportBasicLocationDecision
|
|
{
|
|
public string StableKey { get; set; } = string.Empty;
|
|
public string PreferredName { get; set; } = string.Empty;
|
|
public string Action { get; set; } = CoreImportBasicLocationCandidateActions.Create;
|
|
public int? ParentLocationID { get; set; }
|
|
public string? ParentCandidateKey { get; set; }
|
|
public int? SameAsLocationID { get; set; }
|
|
public string? SameAsCandidateKey { get; set; }
|
|
}
|
|
|
|
public sealed class CoreImportBasicLocationDiscoveryResult
|
|
{
|
|
public int RawObservationCount { get; init; }
|
|
public int ExcludedObservationCount { get; init; }
|
|
public IReadOnlyList<CoreImportBasicLocationCandidate> Candidates { get; init; } = [];
|
|
}
|
|
|
|
public sealed class ManuscriptScanState
|
|
{
|
|
public Guid? ScanID { get; init; }
|
|
public string Status { get; init; } = ManuscriptScanStatuses.NotStarted;
|
|
public string ReviewStatus { get; init; } = ManuscriptScanReviewStatuses.ScanComplete;
|
|
public string Message { get; init; } = string.Empty;
|
|
public int? PercentComplete { get; init; }
|
|
public int ChapterCount { get; init; }
|
|
public int SceneCount { get; init; }
|
|
public int CharacterCandidateCount { get; init; }
|
|
public int TotalWordCount { get; init; }
|
|
public Guid? PreviewID { get; init; }
|
|
public DateTime? UpdatedUtc { get; init; }
|
|
}
|
|
|
|
public sealed class ManuscriptScanReviewDecision
|
|
{
|
|
public Guid PreviewID { get; init; }
|
|
public string Status { get; init; } = ManuscriptScanReviewStatuses.ScanComplete;
|
|
public bool GenerateSceneTitles { get; init; } = true;
|
|
public DateTime UpdatedUtc { get; init; } = DateTime.UtcNow;
|
|
public IReadOnlyList<ManuscriptScanChapterReviewDecision> Chapters { get; init; } = [];
|
|
public IReadOnlyList<ManuscriptScanSceneReviewDecision> Scenes { get; init; } = [];
|
|
public IReadOnlyList<ManuscriptScanCharacterReviewDecision> Characters { get; init; } = [];
|
|
}
|
|
|
|
public sealed class ManuscriptScanChapterReviewDecision
|
|
{
|
|
public string TemporaryChapterKey { get; init; } = string.Empty;
|
|
public bool Include { get; init; }
|
|
public string Title { get; init; } = string.Empty;
|
|
public int ChapterNumber { get; init; }
|
|
}
|
|
|
|
public sealed class ManuscriptScanSceneReviewDecision
|
|
{
|
|
public string TemporarySceneKey { get; init; } = string.Empty;
|
|
public string TemporaryChapterKey { get; init; } = string.Empty;
|
|
public bool Include { get; init; }
|
|
public string? Title { get; init; }
|
|
public int SceneNumberWithinChapter { get; init; }
|
|
public bool AllowZeroWords { get; init; }
|
|
}
|
|
|
|
public sealed class ManuscriptScanCharacterReviewDecision
|
|
{
|
|
public string TemporaryCharacterKey { get; init; } = string.Empty;
|
|
public bool Include { get; init; }
|
|
public string Name { get; init; } = string.Empty;
|
|
public string Category { get; init; } = "PossibleCharacter";
|
|
public int? ExistingCharacterID { get; init; }
|
|
public string? AliasTargetTemporaryCharacterKey { get; init; }
|
|
public string? SexHint { get; init; }
|
|
}
|
|
|
|
public sealed class OnboardingManuscriptBuildResult
|
|
{
|
|
public int BuildID { get; init; }
|
|
public Guid PreviewID { get; init; }
|
|
public int ProjectID { get; init; }
|
|
public int BookID { get; init; }
|
|
public int? ManuscriptDocumentID { get; init; }
|
|
public string Status { get; init; } = "Built";
|
|
public string MarkerStatus { get; init; } = "Pending";
|
|
public int ChaptersCreated { get; init; }
|
|
public int ScenesCreated { get; init; }
|
|
public int CharactersCreated { get; init; }
|
|
public int CharactersReused { get; init; }
|
|
public int SceneAppearancesCreated { get; init; }
|
|
public bool AlreadyBuilt { get; init; }
|
|
public string Message { get; init; } = string.Empty;
|
|
public IReadOnlyList<OnboardingBuildChapterMap> ChapterMappings { get; init; } = [];
|
|
public IReadOnlyList<OnboardingBuildSceneMap> SceneMappings { get; init; } = [];
|
|
public IReadOnlyList<OnboardingBuildCharacterMap> CharacterMappings { get; init; } = [];
|
|
public IReadOnlyList<OnboardingBuildMarkerInstruction> ChapterMarkerInstructions { get; init; } = [];
|
|
public IReadOnlyList<OnboardingBuildMarkerInstruction> SceneMarkerInstructions { get; init; } = [];
|
|
public IReadOnlyList<OnboardingSceneStructureSummary> SceneStructure { get; init; } = [];
|
|
public string? MarkerWarning { get; init; }
|
|
}
|
|
|
|
public sealed class OnboardingSceneStructureSummary
|
|
{
|
|
public string TemporaryChapterKey { get; init; } = string.Empty;
|
|
public int ChapterNumber { get; init; }
|
|
public string ChapterTitle { get; init; } = string.Empty;
|
|
public int SceneCount { get; init; }
|
|
public int WordCount { get; init; }
|
|
public IReadOnlyList<OnboardingSceneStructureDetail> Scenes { get; init; } = [];
|
|
}
|
|
|
|
public sealed class OnboardingSceneStructureDetail
|
|
{
|
|
public int SceneNumberWithinChapter { get; init; }
|
|
public string Title { get; init; } = string.Empty;
|
|
public string DisplayTitle => SceneTitleDisplay.Format(SceneNumberWithinChapter, Title);
|
|
public int WordCount { get; init; }
|
|
public string? StructuralSummary { get; init; }
|
|
public int StartParagraph { get; init; }
|
|
public int EndParagraph { get; init; }
|
|
}
|
|
|
|
public sealed class OnboardingBuildChapterMap
|
|
{
|
|
public string TemporaryChapterKey { get; init; } = string.Empty;
|
|
public int ChapterID { get; init; }
|
|
}
|
|
|
|
public sealed class OnboardingBuildSceneMap
|
|
{
|
|
public string TemporarySceneKey { get; init; } = string.Empty;
|
|
public int SceneID { get; init; }
|
|
public string? SceneTitle { get; init; }
|
|
public string? SceneTitleSource { get; init; }
|
|
}
|
|
|
|
public sealed class OnboardingBuildCharacterMap
|
|
{
|
|
public string TemporaryCharacterKey { get; init; } = string.Empty;
|
|
public int CharacterID { get; init; }
|
|
public bool Created { get; init; }
|
|
}
|
|
|
|
public sealed class OnboardingBuildMarkerInstruction
|
|
{
|
|
public string TemporaryKey { get; init; } = string.Empty;
|
|
public int EntityID { get; init; }
|
|
public int WordParagraphIndex { get; init; }
|
|
public string MarkerTag { get; init; } = string.Empty;
|
|
public string MarkerTitle { get; init; } = string.Empty;
|
|
public string MarkerPrefix { get; init; } = string.Empty;
|
|
}
|
|
|
|
public sealed class OnboardingBuildProgress
|
|
{
|
|
public string Status { get; init; } = "Running";
|
|
public string Message { get; init; } = string.Empty;
|
|
public int? PercentComplete { get; init; }
|
|
public int ChaptersCreated { get; init; }
|
|
public int ScenesCreated { get; init; }
|
|
public int CharactersCreated { get; init; }
|
|
public int SceneAppearancesCreated { get; init; }
|
|
public Guid? PreviewID { get; init; }
|
|
public int? BuildID { get; init; }
|
|
public string? MarkerStatus { get; init; }
|
|
}
|