PlotDirector/PlotLine/Models/ProjectBackupModels.cs

375 lines
17 KiB
C#

namespace PlotLine.Models;
public sealed class ProjectBackupExport
{
public string Format { get; init; } = "PlotDirector.ProjectBackup";
public string FormatVersion { get; init; } = "1.3";
public DateTime ExportedAtUtc { get; init; }
public string SourceApplication { get; init; } = "PlotDirector";
public Project? Project { get; init; }
public ProjectBackupData Data { get; init; } = new();
public IReadOnlyList<ProjectBackupFile> Files { get; set; } = [];
public ProjectBackupDiagnostics Diagnostics { get; init; } = new();
}
public sealed class ProjectBackupData
{
public IReadOnlyList<ProjectBackupSceneAssetSuggestions> SceneAssetSuggestions { get; set; } = [];
public IReadOnlyList<ProjectBackupSceneCharacterSuggestions> SceneCharacterSuggestions { get; set; } = [];
public IReadOnlyList<ProjectBackupSceneLocationSuggestions> SceneLocationSuggestions { get; set; } = [];
public IReadOnlyList<ProjectBackupSceneTextStatistics> SceneTextStatistics { get; set; } = [];
public IReadOnlyList<ProjectBackupOnboardingManuscriptBuilds> OnboardingManuscriptBuilds { get; set; } = [];
public IReadOnlyList<ProjectBackupOnboardingManuscriptBuildChapterMap> OnboardingManuscriptBuildChapterMap { get; set; } = [];
public IReadOnlyList<ProjectBackupOnboardingManuscriptBuildSceneMap> OnboardingManuscriptBuildSceneMap { get; set; } = [];
public IReadOnlyList<ProjectBackupOnboardingManuscriptBuildCharacterMap> OnboardingManuscriptBuildCharacterMap { get; set; } = [];
public IReadOnlyList<CharacterImage> CharacterImages { get; set; } = [];
public IReadOnlyList<ProjectBackupCompanionSceneAsset> WordCompanionSceneAssets { get; set; } = [];
public IReadOnlyList<ProjectBackupCompanionSceneLocation> WordCompanionSceneLocations { get; set; } = [];
public IReadOnlyList<ManuscriptDocumentModel> ManuscriptDocuments { get; set; } = [];
public IReadOnlyList<ProjectBackupSceneManuscriptSource> SceneManuscriptSources { get; set; } = [];
public IReadOnlyList<ProjectBackupStructuralChapterSource> ManuscriptStructuralChapterSources { get; set; } = [];
public IReadOnlyList<WritingPlan> WritingPlans { get; set; } = [];
public IReadOnlyList<WritingScheduleItem> WritingScheduleItems { get; set; } = [];
public IReadOnlyList<CharacterAlias> CharacterAliases { get; set; } = [];
public IReadOnlyList<AssetAlias> AssetAliases { get; set; } = [];
public IReadOnlyList<LocationAlias> LocationAliases { get; set; } = [];
public IReadOnlyList<AuthorPlotSeed> AuthorPlotSeeds { get; set; } = [];
public IReadOnlyList<ContinuityWarningAcknowledgement> ContinuityWarningAcknowledgements { get; set; } = [];
public IReadOnlyList<ProjectBackupPlotEventTarget> PlotEventTargetPlotLines { get; set; } = [];
public IReadOnlyList<MapReferenceImage> MapReferenceImages { get; set; } = [];
public IReadOnlyList<MapJourneyNote> MapJourneyNotes { get; set; } = [];
public IReadOnlyList<StoryMap> StoryMaps { get; set; } = [];
public IReadOnlyList<MapFeature> MapFeatures { get; set; } = [];
public IReadOnlyList<MapRelationship> MapRelationships { get; set; } = [];
public IReadOnlyList<Book> Books { get; init; } = [];
public IReadOnlyList<Chapter> Chapters { get; init; } = [];
public IReadOnlyList<Scene> Scenes { get; init; } = [];
public IReadOnlyList<ProjectBackupScenePurpose> ScenePurposes { get; init; } = [];
public IReadOnlyList<ProjectBackupSceneOutcome> SceneOutcomes { get; init; } = [];
public IReadOnlyList<SceneMetricType> SceneMetricTypes { get; init; } = [];
public IReadOnlyList<SceneMetricValue> SceneMetricValues { get; init; } = [];
public IReadOnlyList<ProjectTimelineSettings> TimelineSettings { get; init; } = [];
public IReadOnlyList<ProjectTimelineMetricSetting> TimelineMetricSettings { get; init; } = [];
public IReadOnlyList<TimelineViewPreset> TimelineViewPresets { get; init; } = [];
public IReadOnlyList<PlotLineItem> PlotLines { get; init; } = [];
public IReadOnlyList<PlotThread> PlotThreads { get; init; } = [];
public IReadOnlyList<ThreadEvent> ThreadEvents { get; init; } = [];
public IReadOnlyList<StoryAsset> StoryAssets { get; init; } = [];
public IReadOnlyList<AssetState> AssetStates { get; init; } = [];
public IReadOnlyList<AssetEvent> AssetEvents { get; init; } = [];
public IReadOnlyList<AssetDependency> AssetDependencies { get; init; } = [];
public IReadOnlyList<AssetCustodyEvent> AssetCustodyEvents { get; init; } = [];
public IReadOnlyList<ProjectBackupAssetCustodyCharacter> AssetCustodyCharacters { get; init; } = [];
public IReadOnlyList<Character> Characters { get; init; } = [];
public IReadOnlyList<SceneCharacter> SceneCharacters { get; init; } = [];
public IReadOnlyList<CharacterAttributeType> CharacterAttributeTypes { get; init; } = [];
public IReadOnlyList<CharacterAttributeEvent> CharacterAttributeEvents { get; init; } = [];
public IReadOnlyList<CharacterKnowledgeItem> CharacterKnowledge { get; init; } = [];
public IReadOnlyList<CharacterRelationship> CharacterRelationships { get; init; } = [];
public IReadOnlyList<RelationshipEvent> RelationshipEvents { get; init; } = [];
public IReadOnlyList<LocationItem> Locations { get; init; } = [];
public IReadOnlyList<LocationRelationship> LocationRelationships { get; init; } = [];
public IReadOnlyList<FloorPlan> FloorPlans { get; init; } = [];
public IReadOnlyList<FloorPlanFloor> FloorPlanFloors { get; init; } = [];
public IReadOnlyList<FloorPlanBlock> FloorPlanBlocks { get; init; } = [];
public IReadOnlyList<FloorPlanTransition> FloorPlanTransitions { get; init; } = [];
public IReadOnlyList<SceneAssetLocation> SceneAssetLocations { get; init; } = [];
public IReadOnlyList<SceneFloorPlanOccupancy> SceneFloorPlanOccupancy { get; init; } = [];
public IReadOnlyList<SceneDependency> SceneDependencies { get; init; } = [];
public IReadOnlyList<ProjectBackupValidationRun> ValidationRuns { get; init; } = [];
public IReadOnlyList<ContinuityWarning> ContinuityWarnings { get; init; } = [];
public IReadOnlyList<SceneNote> SceneNotes { get; init; } = [];
public IReadOnlyList<SceneWorkflow> SceneWorkflow { get; init; } = [];
public IReadOnlyList<SceneChecklistItem> SceneChecklistItems { get; init; } = [];
public IReadOnlyList<SceneAttachment> SceneAttachments { get; init; } = [];
public IReadOnlyList<ChapterGoal> ChapterGoals { get; init; } = [];
public IReadOnlyList<Scenario> Scenarios { get; init; } = [];
public IReadOnlyList<ProjectBackupScenarioSceneOrder> ScenarioSceneOrder { get; init; } = [];
public IReadOnlyList<ProjectBackupScenarioValidationRun> ScenarioValidationRuns { get; init; } = [];
public IReadOnlyList<ScenarioWarning> ScenarioWarnings { get; init; } = [];
public IReadOnlyList<GenreMetricPreset> GenreMetricPresets { get; init; } = [];
public IReadOnlyList<ProjectBackupGenreMetricPresetMetric> GenreMetricPresetMetrics { get; init; } = [];
public IReadOnlyList<ProjectBackupAccessRecord> ProjectAccess { get; init; } = [];
public IReadOnlyList<UserFile> UserFiles { get; init; } = [];
}
public sealed class ProjectBackupDiagnostics
{
public int ProjectId { get; init; }
public IReadOnlyList<string> IncludedEntitySets { get; init; } = [];
public string? Note { get; init; }
}
public sealed class ProjectBackupResult
{
public string FileName { get; init; } = string.Empty;
public string ContentType { get; init; } = "application/json";
public string Json { get; init; } = string.Empty;
}
public sealed class ProjectBackupScenePurpose
{
public int SceneID { get; set; }
public int ScenePurposeTypeID { get; set; }
public string PurposeName { get; set; } = string.Empty;
public int SortOrder { get; set; }
}
public sealed class ProjectBackupSceneOutcome
{
public int SceneOutcomeID { get; set; }
public int SceneID { get; set; }
public string OutcomeDescription { get; set; } = string.Empty;
public int? OutcomeTypeID { get; set; }
public DateTime CreatedDate { get; set; }
public DateTime UpdatedDate { get; set; }
}
public sealed class ProjectBackupAssetCustodyCharacter
{
public int AssetCustodyEventCharacterID { get; set; }
public int AssetCustodyEventID { get; set; }
public int? CharacterID { get; set; }
public string? CharacterName { get; set; }
public string? CharacterNameText { get; set; }
public int CustodyRoleID { get; set; }
public string CustodyRoleName { get; set; } = string.Empty;
}
public sealed class ProjectBackupValidationRun
{
public int ValidationRunID { get; set; }
public int ProjectID { get; set; }
public int? BookID { get; set; }
public DateTime StartedDate { get; set; }
public DateTime? CompletedDate { get; set; }
public string? TriggeredBy { get; set; }
public string? ScopeDescription { get; set; }
}
public sealed class ProjectBackupScenarioSceneOrder
{
public int ScenarioSceneOrderID { get; set; }
public int ScenarioID { get; set; }
public int SceneID { get; set; }
public int? ProposedChapterID { get; set; }
public int ProposedSortOrder { get; set; }
public string? Notes { get; set; }
public DateTime CreatedDate { get; set; }
public DateTime UpdatedDate { get; set; }
}
public sealed class ProjectBackupScenarioValidationRun
{
public int ScenarioValidationRunID { get; set; }
public int ScenarioID { get; set; }
public DateTime StartedDate { get; set; }
public DateTime? CompletedDate { get; set; }
public int WarningCount { get; set; }
}
public sealed class ProjectBackupGenreMetricPresetMetric
{
public int GenreMetricPresetID { get; set; }
public string PresetKey { get; set; } = string.Empty;
public string PresetName { get; set; } = string.Empty;
public int MetricTypeID { get; set; }
public string MetricName { get; set; } = string.Empty;
public int SortOrder { get; set; }
}
public sealed class ProjectBackupAccessRecord
{
public int ProjectUserAccessID { get; set; }
public int ProjectID { get; set; }
public int UserID { get; set; }
public string Email { get; set; } = string.Empty;
public string DisplayName { get; set; } = string.Empty;
public string AccessRole { get; set; } = string.Empty;
public int? InvitedByUserID { get; set; }
public string? InvitedByEmail { get; set; }
public DateTime? InvitedDateUTC { get; set; }
public DateTime? AcceptedDateUTC { get; set; }
public bool IsActive { get; set; }
}
public sealed class ProjectBackupSceneManuscriptSource
{
public int SceneID { get; set; }
public int ProjectID { get; set; }
public int BookID { get; set; }
public int ChapterID { get; set; }
public string SourceText { get; set; } = string.Empty;
public int SourceWordCount { get; set; }
public int SourceCharacterCount { get; set; }
public int? SourceStartParagraph { get; set; }
public int? SourceEndParagraph { get; set; }
public int? WordStartParagraphIndex { get; set; }
public int? WordEndParagraphIndex { get; set; }
public string SourceKind { get; set; } = string.Empty;
public DateTime CreatedUtc { get; set; }
public DateTime UpdatedUtc { get; set; }
}
public sealed class ProjectBackupStructuralChapterSource
{
public int ChapterID { get; set; }
public int ProjectID { get; set; }
public int BookID { get; set; }
public string SourceText { get; set; } = string.Empty;
public int SourceWordCount { get; set; }
public int SourceCharacterCount { get; set; }
public string? ParagraphMapJson { get; set; }
public DateTime CreatedUtc { get; set; }
public DateTime UpdatedUtc { get; set; }
public string? StructuralParsedJson { get; set; }
public string? DefaultPovName { get; set; }
public string? ExplicitNarratorName { get; set; }
}
public sealed class ProjectBackupPlotEventTarget
{
public int PlotEventID { get; set; }
public int PlotLineID { get; set; }
public DateTime CreatedDate { get; set; }
}
public sealed class ProjectBackupCompanionSceneAsset
{
public int WordCompanionSceneAssetID { get; set; }
public int SceneID { get; set; }
public int StoryAssetID { get; set; }
public DateTime CreatedDate { get; set; }
public DateTime UpdatedDate { get; set; }
}
public sealed class ProjectBackupCompanionSceneLocation
{
public int WordCompanionSceneLocationID { get; set; }
public int SceneID { get; set; }
public int LocationID { get; set; }
public DateTime CreatedDate { get; set; }
public DateTime UpdatedDate { get; set; }
}
public sealed class ProjectBackupFile
{
public string Path { get; set; } = string.Empty;
public byte[] Data { get; set; } = [];
public string Sha256 { get; set; } = string.Empty;
public long FileSizeBytes => Data?.LongLength ?? 0;
public string OriginalFileName => System.IO.Path.GetFileName(Path);
public string? RestoredFileName => System.IO.Path.GetFileName(RestoredPath);
public string ContentType => System.IO.Path.GetExtension(Path).ToLowerInvariant() switch
{
".webp"=>"image/webp", ".png"=>"image/png", ".jpg" or ".jpeg"=>"image/jpeg", ".pdf"=>"application/pdf",
".txt"=>"text/plain", _=>"application/octet-stream"
};
public string? RestoredPath { get; set; }
public string? EntityType { get; set; }
public int EntityID { get; set; }
}
public sealed class ProjectBackupOnboardingManuscriptBuilds
{
public int OnboardingManuscriptBuildID { get; set; }
public Guid PreviewID { get; set; }
public int UserID { get; set; }
public int ProjectID { get; set; }
public int BookID { get; set; }
public int? ManuscriptDocumentID { get; set; }
public string Status { get; set; } = string.Empty;
public string MarkerStatus { get; set; } = string.Empty;
public int ChaptersCreated { get; set; }
public int ScenesCreated { get; set; }
public int CharactersCreated { get; set; }
public int CharactersReused { get; set; }
public int SceneAppearancesCreated { get; set; }
public DateTime CreatedUtc { get; set; }
public DateTime UpdatedUtc { get; set; }
public string? MarkerSyncMessage { get; set; }
public DateTime? MarkerSyncCompletedUtc { get; set; }
}
public sealed class ProjectBackupOnboardingManuscriptBuildChapterMap
{
public int OnboardingManuscriptBuildID { get; set; }
public string TemporaryChapterKey { get; set; } = string.Empty;
public int ChapterID { get; set; }
}
public sealed class ProjectBackupOnboardingManuscriptBuildSceneMap
{
public int OnboardingManuscriptBuildID { get; set; }
public string TemporarySceneKey { get; set; } = string.Empty;
public int SceneID { get; set; }
}
public sealed class ProjectBackupOnboardingManuscriptBuildCharacterMap
{
public int OnboardingManuscriptBuildID { get; set; }
public string TemporaryCharacterKey { get; set; } = string.Empty;
public int CharacterID { get; set; }
public bool Created { get; set; }
}
public sealed class ProjectBackupSceneAssetSuggestions
{
public int SceneAssetSuggestionID { get; set; }
public int SceneID { get; set; }
public int AssetID { get; set; }
public string SuggestionSource { get; set; } = "";
public DateTime DetectedUtc { get; set; }
public string Status { get; set; } = "";
public string Confidence { get; set; } = "";
public string? Reason { get; set; }
public int CreatedByUserID { get; set; }
public int? ReviewedByUserID { get; set; }
public DateTime? ReviewedUtc { get; set; }
}
public sealed class ProjectBackupSceneCharacterSuggestions
{
public int SceneCharacterSuggestionID { get; set; }
public int SceneID { get; set; }
public int CharacterID { get; set; }
public string SuggestionSource { get; set; } = "";
public DateTime DetectedUtc { get; set; }
public string Status { get; set; } = "";
public string Confidence { get; set; } = "";
public string? Reason { get; set; }
public int CreatedByUserID { get; set; }
public int? ReviewedByUserID { get; set; }
public DateTime? ReviewedUtc { get; set; }
}
public sealed class ProjectBackupSceneLocationSuggestions
{
public int SceneLocationSuggestionID { get; set; }
public int SceneID { get; set; }
public int LocationID { get; set; }
public string SuggestionSource { get; set; } = "";
public DateTime DetectedUtc { get; set; }
public string Status { get; set; } = "";
public string Confidence { get; set; } = "";
public string? Reason { get; set; }
public int CreatedByUserID { get; set; }
public int? ReviewedByUserID { get; set; }
public DateTime? ReviewedUtc { get; set; }
}
public sealed class ProjectBackupSceneTextStatistics
{
public int SceneID { get; set; }
public int TotalWordCount { get; set; }
public int DialogueWordCount { get; set; }
public int ProseWordCount { get; set; }
public int TotalParagraphCount { get; set; }
public int DialogueParagraphCount { get; set; }
public int ProseParagraphCount { get; set; }
public DateTime CalculatedUtc { get; set; }
public DateTime UpdatedUtc { get; set; }
}