namespace Backend.Contracts;

public sealed record AdminMetricDto(string Label, int Value, string Note);

public sealed record AdminActivityDto(string Label, string Age);

public sealed record AdminTopCategoryDto(string Category, int Votes);

public sealed record AdminRiskFlagDto(
    int Id,
    string Source,
    string Type,
    string Severity,
    string Status,
    string Summary,
    string? TwitchUserId,
    string CreatedFromIp,
    DateTimeOffset CreatedAt,
    string MetadataJson);

public sealed record AdminAuditEntryDto(
    int Id,
    string AdminTwitchUserId,
    string ActionType,
    string EntityType,
    string EntityId,
    string Summary,
    DateTimeOffset CreatedAt);

public sealed record AdminDashboardResponse(
    IEnumerable<AdminMetricDto> Metrics,
    IEnumerable<AdminActivityDto> Activities,
    IEnumerable<AdminTopCategoryDto> TopCategories,
    IEnumerable<AdminRiskFlagDto> RiskFlags,
    IEnumerable<AdminAuditEntryDto> AuditEntries);

public sealed record AdminSeasonListItemDto(
    int Id,
    int Year,
    string Name,
    string CurrentPhase,
    bool IsCurrent,
    int CategoryCount);

public sealed record AdminCategoryItemDto(
    int Id,
    string GroupName,
    string Name,
    string Slug,
    string Description,
    int SortOrder,
    int MaxNomineesPerUser,
    int CandidateCount);

public sealed record AdminCandidateItemDto(
    int Id,
    int CategoryId,
    string DisplayName,
    string ChannelSlug,
    string Platform);

public sealed record AdminNominationReviewItemDto(
    int Id,
    int CategoryId,
    string CategoryName,
    string SubmittedByTwitchId,
    string CandidateText,
    DateTimeOffset CreatedAt);

public sealed record AdminClipSubmissionItemDto(
    int Id,
    int? CategoryId,
    string SubmittedByTwitchId,
    string ClipUrl,
    string Title,
    string Creator,
    string Platform,
    string Status,
    DateTimeOffset CreatedAt);

public sealed record AdminSeasonDetailResponse(
    int Id,
    int Year,
    string Name,
    string CurrentPhase,
    bool IsCurrent,
    IEnumerable<AdminCategoryItemDto> Categories,
    IEnumerable<AdminCandidateItemDto> Candidates,
    IEnumerable<AdminNominationReviewItemDto> PendingNominations,
    IEnumerable<AdminClipSubmissionItemDto> ClipSubmissions);

public sealed record UpdateSeasonRequest(
    string CurrentPhase,
    bool IsCurrent);

public sealed record UpsertCategoryRequest(
    string GroupName,
    string Name,
    string Slug,
    string Description,
    int SortOrder,
    int MaxNomineesPerUser);

public sealed record UpsertCandidateRequest(
    int CategoryId,
    string DisplayName,
    string ChannelSlug,
    string Platform);

public sealed record ApproveNominationRequest(
    string? DisplayName,
    string? ChannelSlug,
    string? Platform);

public sealed record ResolveRiskFlagRequest(string Status);
