namespace Backend.Contracts;

public sealed record AdminRiskFlagDto(
    int Id,
    string Source,
    string Type,
    string Severity,
    string Status,
    string Summary,
    string? TwitchUserId,
    string CreatedFromIp,
    DateTimeOffset CreatedAt,
    string MetadataJson,
    string? ReviewNote,
    string? ReviewedByTwitchId,
    DateTimeOffset? ReviewedAt,
    AdminRiskEntityLinkDto[] EntityLinks);

public sealed record AdminRiskEntityLinkDto(
    string Label,
    string EntityType,
    string EntityId,
    string To);

public sealed record AdminRiskCountDto(string Key, int Count);

public sealed record AdminRiskFlagsResponse(
    AdminRiskFlagDto[] Items,
    int TotalCount,
    int ReturnedCount,
    int Offset,
    int Limit,
    bool HasMore,
    AdminRiskCountDto[] SeverityCounts,
    AdminRiskCountDto[] StatusCounts);

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

public sealed record AdminAuditEntriesResponse(
    AdminAuditEntryDto[] Items,
    int TotalCount,
    int ReturnedCount,
    string? NextCursor,
    int Limit);

public sealed record AdminNominationReviewItemDto(
    int Id,
    int CategoryId,
    string CategoryName,
    string SubmittedByTwitchId,
    string CandidateText,
    string? StreamUrl,
    string Status,
    DateTimeOffset CreatedAt,
    int? CandidateId,
    string? CandidateDisplayName,
    string? ReviewNote,
    string? ReviewedByTwitchId,
    DateTimeOffset? ReviewedAt);

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

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

public sealed record RejectNominationRequest(string? ReviewNote);

public sealed record UpdateClipStatusRequest(
    string Status,
    string? ReviewNote);

public sealed record ResolveRiskFlagRequest(
    string Status,
    string? ReviewNote);

public sealed record BulkResolveRiskFlagsRequest(
    int[] RiskFlagIds,
    string Status,
    string? ReviewNote);

public sealed record AdminRiskRuleDto(
    string Key,
    string Label,
    bool Enabled,
    int Threshold,
    int WindowMinutes,
    string Severity,
    string Description);

public sealed record AdminRiskRulesResponse(AdminRiskRuleDto[] Rules);

public sealed record UpdateRiskRulesRequest(AdminRiskRuleDto[] Rules);
