namespace PlotLine.Models; public static class StoryIntelligenceRunStatuses { public const string Completed = "Completed"; public const string CompletedWithIssues = "CompletedWithIssues"; public const string Failed = "Failed"; } public sealed class StoryIntelligenceRunSaveRequest { public int UserID { get; init; } public int? ProjectID { get; init; } public int? BookID { get; init; } public string Status { get; init; } = StoryIntelligenceRunStatuses.Completed; public string SourceType { get; init; } = "AdminDryRun"; public string PromptVersion { get; init; } = string.Empty; public string Model { get; init; } = string.Empty; public DateTime StartedUtc { get; init; } public DateTime? CompletedUtc { get; init; } public int? TotalInputTokens { get; init; } public int? TotalOutputTokens { get; init; } public int? TotalTokens { get; init; } public long? TotalDurationMs { get; init; } public string? ErrorMessage { get; init; } public StoryIntelligenceChapterResultSaveRequest? ChapterResult { get; init; } public IReadOnlyList SceneResults { get; init; } = []; } public sealed class StoryIntelligenceChapterResultSaveRequest { public int? ProjectID { get; init; } public int? BookID { get; init; } public int? ChapterID { get; init; } public decimal? ChapterNumber { get; init; } public string SourceLabel { get; init; } = string.Empty; public string PromptVersion { get; init; } = string.Empty; public string Model { get; init; } = string.Empty; public string RawResponseJson { get; init; } = string.Empty; public string OutputTextJson { get; init; } = string.Empty; public string ParsedJson { get; init; } = string.Empty; public int ValidationErrorsCount { get; init; } public int ValidationWarningsCount { get; init; } public int? InputTokens { get; init; } public int? OutputTokens { get; init; } public int? TotalTokens { get; init; } public long? DurationMs { get; init; } } public sealed class StoryIntelligenceSceneResultSaveRequest { public int? ProjectID { get; init; } public int? BookID { get; init; } public int? ChapterID { get; init; } public int? SceneID { get; init; } public int TemporarySceneNumber { get; init; } public int? StartParagraph { get; init; } public int? EndParagraph { get; init; } public string SourceLabel { get; init; } = string.Empty; public string PromptVersion { get; init; } = string.Empty; public string Model { get; init; } = string.Empty; public string RawResponseJson { get; init; } = string.Empty; public string OutputTextJson { get; init; } = string.Empty; public string ParsedJson { get; init; } = string.Empty; public int ValidationErrorsCount { get; init; } public int ValidationWarningsCount { get; init; } public int? InputTokens { get; init; } public int? OutputTokens { get; init; } public int? TotalTokens { get; init; } public long? DurationMs { get; init; } } public sealed class StoryIntelligenceSavedRunListItem { public int StoryIntelligenceRunID { get; init; } public DateTime CreatedUtc { get; init; } public int UserID { get; init; } public int? ProjectID { get; init; } public string? ProjectTitle { get; init; } public int? BookID { get; init; } public string? BookTitle { get; init; } public string Status { get; init; } = string.Empty; public int SceneCount { get; init; } public int? TotalTokens { get; init; } public long? TotalDurationMs { get; init; } public int ValidationErrorsCount { get; init; } public int ValidationWarningsCount { get; init; } } public sealed class StoryIntelligenceSavedRun { public int StoryIntelligenceRunID { get; init; } public int UserID { get; init; } public int? ProjectID { get; init; } public string? ProjectTitle { get; init; } public int? BookID { get; init; } public string? BookTitle { get; init; } public string Status { get; init; } = string.Empty; public string SourceType { get; init; } = string.Empty; public string PromptVersion { get; init; } = string.Empty; public string Model { get; init; } = string.Empty; public DateTime StartedUtc { get; init; } public DateTime? CompletedUtc { get; init; } public int? TotalInputTokens { get; init; } public int? TotalOutputTokens { get; init; } public int? TotalTokens { get; init; } public long? TotalDurationMs { get; init; } public string? ErrorMessage { get; init; } public DateTime CreatedUtc { get; init; } public DateTime UpdatedUtc { get; init; } } public sealed class StoryIntelligenceSavedChapterResult { public int ChapterResultID { get; init; } public int StoryIntelligenceRunID { get; init; } public int? ProjectID { get; init; } public int? BookID { get; init; } public int? ChapterID { get; init; } public decimal? ChapterNumber { get; init; } public string SourceLabel { get; init; } = string.Empty; public string PromptVersion { get; init; } = string.Empty; public string Model { get; init; } = string.Empty; public string RawResponseJson { get; init; } = string.Empty; public string OutputTextJson { get; init; } = string.Empty; public string ParsedJson { get; init; } = string.Empty; public int ValidationErrorsCount { get; init; } public int ValidationWarningsCount { get; init; } public int? InputTokens { get; init; } public int? OutputTokens { get; init; } public int? TotalTokens { get; init; } public long? DurationMs { get; init; } public DateTime CreatedUtc { get; init; } } public sealed class StoryIntelligenceSavedSceneResult { public int SceneResultID { get; init; } public int StoryIntelligenceRunID { get; init; } public int? ChapterResultID { get; init; } public int? ProjectID { get; init; } public int? BookID { get; init; } public int? ChapterID { get; init; } public int? SceneID { get; init; } public int TemporarySceneNumber { get; init; } public int? StartParagraph { get; init; } public int? EndParagraph { get; init; } public string SourceLabel { get; init; } = string.Empty; public string PromptVersion { get; init; } = string.Empty; public string Model { get; init; } = string.Empty; public string RawResponseJson { get; init; } = string.Empty; public string OutputTextJson { get; init; } = string.Empty; public string ParsedJson { get; init; } = string.Empty; public int ValidationErrorsCount { get; init; } public int ValidationWarningsCount { get; init; } public int? InputTokens { get; init; } public int? OutputTokens { get; init; } public int? TotalTokens { get; init; } public long? DurationMs { get; init; } public DateTime CreatedUtc { get; init; } }