114 lines
3.8 KiB
C#
114 lines
3.8 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using PlotLine.Models;
|
|
|
|
namespace PlotLine.ViewModels;
|
|
|
|
public sealed class OnboardingWizardViewModel
|
|
{
|
|
public string CurrentStep { get; set; } = OnboardingSteps.Welcome;
|
|
public int StepNumber { get; set; } = 1;
|
|
public int TotalSteps { get; set; } = 6;
|
|
public string? WritingJourney { get; set; }
|
|
public string? WritingSoftware { get; set; }
|
|
public int? ProjectID { get; set; }
|
|
public int? BookID { get; set; }
|
|
public string? SelectedProjectName { get; set; }
|
|
public string? SelectedBookTitle { get; set; }
|
|
public bool IsMicrosoftWordPath => string.Equals(WritingSoftware, WritingSoftwareValues.MicrosoftWord, StringComparison.Ordinal);
|
|
public CompanionPresenceViewModel CompanionPresence { get; set; } = new();
|
|
public IReadOnlyList<OnboardingOptionViewModel> Options { get; set; } = [];
|
|
public IReadOnlyList<OnboardingProjectOptionViewModel> ProjectOptions { get; set; } = [];
|
|
public IReadOnlyList<OnboardingBookOptionViewModel> BookOptions { get; set; } = [];
|
|
public ProjectOnboardingForm ProjectForm { get; set; } = new();
|
|
public BookOnboardingForm BookForm { get; set; } = new();
|
|
}
|
|
|
|
public sealed class OnboardingOptionViewModel
|
|
{
|
|
public string Value { get; init; } = string.Empty;
|
|
public string Title { get; init; } = string.Empty;
|
|
public string Description { get; init; } = string.Empty;
|
|
public string? Badge { get; init; }
|
|
}
|
|
|
|
public sealed class WritingJourneyOnboardingForm
|
|
{
|
|
[Required(ErrorMessage = "Choose the closest writing stage before continuing.")]
|
|
public string? WritingJourney { get; set; }
|
|
}
|
|
|
|
public sealed class WritingSoftwareOnboardingForm
|
|
{
|
|
[Required(ErrorMessage = "Choose the software you write in before continuing.")]
|
|
public string? WritingSoftware { get; set; }
|
|
}
|
|
|
|
public static class OnboardingSelectionModes
|
|
{
|
|
public const string Create = "Create";
|
|
public const string Select = "Select";
|
|
}
|
|
|
|
public sealed class ProjectOnboardingForm
|
|
{
|
|
[Required]
|
|
public string Mode { get; set; } = OnboardingSelectionModes.Create;
|
|
|
|
public int? SelectedProjectID { get; set; }
|
|
|
|
[StringLength(200)]
|
|
public string? ProjectName { get; set; }
|
|
|
|
public string? Description { get; set; }
|
|
}
|
|
|
|
public sealed class BookOnboardingForm
|
|
{
|
|
[Required]
|
|
public string Mode { get; set; } = OnboardingSelectionModes.Create;
|
|
|
|
public int? SelectedBookID { get; set; }
|
|
|
|
[StringLength(200)]
|
|
public string? BookTitle { get; set; }
|
|
|
|
[StringLength(200)]
|
|
public string? Subtitle { get; set; }
|
|
|
|
[Range(1, int.MaxValue, ErrorMessage = "Target word count must be greater than zero.")]
|
|
public int? TargetWordCount { get; set; }
|
|
}
|
|
|
|
public sealed class OnboardingProjectOptionViewModel
|
|
{
|
|
public int ProjectID { get; init; }
|
|
public string ProjectName { get; init; } = string.Empty;
|
|
public string Description { get; init; } = string.Empty;
|
|
}
|
|
|
|
public sealed class OnboardingBookOptionViewModel
|
|
{
|
|
public int BookID { get; init; }
|
|
public string DisplayTitle { get; init; } = string.Empty;
|
|
public string Detail { get; init; } = string.Empty;
|
|
}
|
|
|
|
public sealed class OnboardingNudgeViewModel
|
|
{
|
|
public bool ShouldShow { get; init; }
|
|
public string ButtonText { get; init; } = "Start setup";
|
|
public string Title { get; init; } = "Set up PlotDirector around the way you write";
|
|
public string Description { get; init; } = "Answer a few quick questions so PlotDirector can guide your first project.";
|
|
public bool IsCompanionPresence { get; init; }
|
|
public bool CompanionConnected { get; init; }
|
|
}
|
|
|
|
public sealed class CompanionPresenceViewModel
|
|
{
|
|
public bool IsConnected { get; init; }
|
|
public string Status { get; init; } = "Offline";
|
|
public string? CompanionVersion { get; init; }
|
|
public string? CurrentDocumentName { get; init; }
|
|
public DateTime? LastHeartbeatUtc { get; init; }
|
|
}
|