BCards/src/BCards.Web/ViewModels/ModerationViewModel.cs
2025-07-12 02:32:22 -03:00

82 lines
2.6 KiB
C#

using BCards.Web.Models;
namespace BCards.Web.ViewModels;
public class ModerationDashboardViewModel
{
public List<PendingPageViewModel> PendingPages { get; set; } = new();
public Dictionary<string, int> Stats { get; set; } = new();
public int CurrentPage { get; set; } = 1;
public int PageSize { get; set; } = 20;
public bool HasNextPage { get; set; } = false;
public bool HasPreviousPage => CurrentPage > 1;
}
public class ModerationPageViewModel
{
public string Id { get; set; } = string.Empty;
public string DisplayName { get; set; } = string.Empty;
public string Category { get; set; } = string.Empty;
public string Slug { get; set; } = string.Empty;
public DateTime CreatedAt { get; set; }
public string Status { get; set; } = string.Empty;
public int ModerationAttempts { get; set; }
public string PlanType { get; set; } = string.Empty;
public string? PreviewUrl { get; set; }
public DateTime? ApprovedAt { get; set; }
public ModerationHistory? LastModerationEntry { get; set; }
public string PriorityLabel => PlanType.ToLower() switch
{
"premium" => "ALTA",
"professional" => "ALTA",
"basic" => "MÉDIA",
_ => "BAIXA"
};
public string PriorityColor => PlanType.ToLower() switch
{
"premium" => "danger",
"professional" => "warning",
"basic" => "info",
_ => "secondary"
};
}
public class ModerationReviewViewModel
{
public UserPage Page { get; set; } = new();
public User User { get; set; } = new();
public string? PreviewUrl { get; set; }
public List<ModerationCriterion> ModerationCriteria { get; set; } = new();
}
public class ModerationHistoryViewModel
{
public List<ModerationPageViewModel> Pages { get; set; } = new();
public int CurrentPage { get; set; } = 1;
public int PageSize { get; set; } = 20;
public bool HasNextPage { get; set; } = false;
public bool HasPreviousPage => CurrentPage > 1;
}
public class ModerationCriterion
{
public string Category { get; set; } = string.Empty;
public List<string> Items { get; set; } = new();
}
public class PendingPageViewModel
{
public string Id { get; set; } = "";
public string DisplayName { get; set; } = "";
public string Slug { get; set; } = "";
public string Category { get; set; } = "";
public string PlanType { get; set; } = "";
public DateTime CreatedAt { get; set; }
public int ModerationAttempts { get; set; }
public string PreviewUrl { get; set; } = "";
public string PriorityLabel { get; set; } = "";
public string PriorityColor { get; set; } = "";
}