148 lines
5.6 KiB
C#
148 lines
5.6 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using PlotLine.Models;
|
|
|
|
namespace PlotLine.ViewModels;
|
|
|
|
public sealed class FeatureRequestIndexViewModel
|
|
{
|
|
public IReadOnlyList<FeatureRequest> Requests { get; set; } = [];
|
|
}
|
|
|
|
public sealed class FeatureRequestRoadmapViewModel
|
|
{
|
|
public IReadOnlyList<FeatureRequestRoadmapSection> Sections { get; set; } = [];
|
|
}
|
|
|
|
public sealed class FeatureRequestCreateViewModel
|
|
{
|
|
[Required(ErrorMessage = "Enter a title.")]
|
|
[StringLength(200, ErrorMessage = "Title must be 200 characters or fewer.")]
|
|
public string Title { get; set; } = string.Empty;
|
|
|
|
[Required(ErrorMessage = "Describe the problem or suggestion.")]
|
|
[Display(Name = "Description / Problem")]
|
|
public string Description { get; set; } = string.Empty;
|
|
|
|
[StringLength(100, ErrorMessage = "App area must be 100 characters or fewer.")]
|
|
[Display(Name = "App Area")]
|
|
public string? AppArea { get; set; }
|
|
|
|
[StringLength(50, ErrorMessage = "Importance must be 50 characters or fewer.")]
|
|
public string? Importance { get; set; }
|
|
|
|
public IReadOnlyList<string> AppAreas { get; set; } = FeatureRequestOptions.AppAreas;
|
|
public IReadOnlyList<string> ImportanceOptions { get; set; } = FeatureRequestOptions.ImportanceOptions;
|
|
}
|
|
|
|
public sealed class FeatureRequestDetailsViewModel
|
|
{
|
|
public FeatureRequest Request { get; set; } = new();
|
|
public IReadOnlyList<FeatureRequestMessage> Messages { get; set; } = [];
|
|
public FeatureRequestReplyViewModel Reply { get; set; } = new();
|
|
public bool IsAdminView { get; set; }
|
|
public IReadOnlyList<string> StatusOptions { get; set; } = FeatureRequestStatuses.All;
|
|
}
|
|
|
|
public sealed class FeatureRequestReplyViewModel
|
|
{
|
|
public int FeatureRequestID { get; set; }
|
|
|
|
[Required(ErrorMessage = "Enter a message.")]
|
|
public string MessageBody { get; set; } = string.Empty;
|
|
}
|
|
|
|
public sealed class AdminFeatureRequestIndexViewModel
|
|
{
|
|
public IReadOnlyList<FeatureRequest> Requests { get; set; } = [];
|
|
public string? Status { get; set; }
|
|
public string? AppArea { get; set; }
|
|
public string? Importance { get; set; }
|
|
public string? Search { get; set; }
|
|
public string Sort { get; set; } = FeatureRequestSortOptions.LatestActivity;
|
|
public IReadOnlyList<string> StatusOptions { get; set; } = FeatureRequestStatuses.All;
|
|
public IReadOnlyList<string> AppAreas { get; set; } = FeatureRequestOptions.AppAreas;
|
|
public IReadOnlyList<string> ImportanceOptions { get; set; } = FeatureRequestOptions.ImportanceOptions;
|
|
public IReadOnlyList<(string Value, string Label)> SortOptions { get; set; } = FeatureRequestSortOptions.All;
|
|
}
|
|
|
|
public sealed class AdminFeatureRequestUpdateViewModel
|
|
{
|
|
public int FeatureRequestID { get; set; }
|
|
public string Status { get; set; } = FeatureRequestStatuses.New;
|
|
public bool IsPublicCandidate { get; set; }
|
|
public string? AdminNotes { get; set; }
|
|
}
|
|
|
|
public sealed class AdminDashboardViewModel
|
|
{
|
|
public FeatureRequestAdminSummary FeatureRequestSummary { get; set; } = new();
|
|
}
|
|
|
|
public sealed class StoryIntelligenceDiagnosticsViewModel
|
|
{
|
|
public string Model { get; set; } = string.Empty;
|
|
public int MaxOutputTokens { get; set; }
|
|
public int TimeoutSeconds { get; set; }
|
|
public bool ApiKeyConfigured { get; set; }
|
|
public bool ClientConstructed { get; set; }
|
|
public string ConnectionStatus { get; set; } = string.Empty;
|
|
public bool PromptRepositoryHealthy { get; set; }
|
|
public string PromptFileName { get; set; } = string.Empty;
|
|
public bool ScenePromptLoaded { get; set; }
|
|
public int ScenePromptLength { get; set; }
|
|
public string PromptVersion { get; set; } = string.Empty;
|
|
public bool RuntimeSubstitutionWorks { get; set; }
|
|
public string? ErrorMessage { get; set; }
|
|
}
|
|
|
|
public sealed class StoryIntelligenceDryRunViewModel
|
|
{
|
|
public StoryIntelligenceDryRunForm Form { get; set; } = StoryIntelligenceDryRunForm.Default();
|
|
public StoryIntelligenceDryRunResultViewModel? Result { get; set; }
|
|
}
|
|
|
|
public sealed class StoryIntelligenceDryRunForm
|
|
{
|
|
public int? ProjectID { get; set; }
|
|
public int? BookID { get; set; }
|
|
public int? ChapterID { get; set; }
|
|
public int? SceneID { get; set; }
|
|
public decimal? ChapterNumber { get; set; }
|
|
public decimal? SceneNumber { get; set; }
|
|
public string SourceLabel { get; set; } = "Admin test scene";
|
|
public string SceneText { get; set; } = string.Empty;
|
|
|
|
public static StoryIntelligenceDryRunForm Default() => new()
|
|
{
|
|
ProjectID = null,
|
|
BookID = null,
|
|
ChapterID = null,
|
|
SceneID = null,
|
|
ChapterNumber = 1,
|
|
SceneNumber = 1,
|
|
SourceLabel = "Admin test scene",
|
|
SceneText = "Mara found the brass key under the loose stair. Elias watched from the doorway and asked whether she had told the captain. Mara hid the key in her glove and said the captain would learn soon enough."
|
|
};
|
|
}
|
|
|
|
public sealed class StoryIntelligenceDryRunResultViewModel
|
|
{
|
|
public bool Success { get; init; }
|
|
public string PromptVersion { get; init; } = string.Empty;
|
|
public string Model { get; init; } = string.Empty;
|
|
public string SceneContextJson { get; init; } = string.Empty;
|
|
public string Duration { get; init; } = string.Empty;
|
|
public int RetryCount { get; init; }
|
|
public string RawResponseText { get; init; } = string.Empty;
|
|
public string? ErrorMessage { get; init; }
|
|
}
|
|
|
|
public sealed class AdminFeatureRequestFilter
|
|
{
|
|
public string? Status { get; set; }
|
|
public string? AppArea { get; set; }
|
|
public string? Importance { get; set; }
|
|
public string? Search { get; set; }
|
|
public string Sort { get; set; } = FeatureRequestSortOptions.LatestActivity;
|
|
}
|