import type { FaqItem, PublicSocialLink } from './public'

export interface CreateNominationPayload {
  year: number
  categoryId: number
  twitchUserId: string
  nominees?: string[]
  nominations?: Array<{
    name?: string
    streamUrl: string
  }>
}

export interface CreateClipPayload {
  year: number
  categoryId: number | null
  candidateId: number | null
  twitchUserId: string
  clipUrl: string
  title: string
  creator: string
}

export interface VoteEntryPayload {
  categoryId: number
  candidateId: number
}

export interface CreateVotePayload {
  seasonId: number
  twitchUserId: string
  entries: VoteEntryPayload[]
}

export interface CreateSeasonPayload {
  year: number
  name: string
  showStreamUrl: string
  currentPhase: string
  isCurrent: boolean
  isCommunityOnly: boolean
  nominationStartsAt: string
  nominationEndsAt: string
  votingStartsAt: string
  votingEndsAt: string
  reviewStartsAt: string
  reviewEndsAt: string
  showDate: string
  showStartsAt: string
  copyStructureFromSeasonId?: number | null
}

export interface UpdateSeasonPayload {
  year: number
  name: string
  showStreamUrl: string
  currentPhase: string
  isCurrent: boolean
  isCommunityOnly: boolean
  nominationStartsAt: string
  nominationEndsAt: string
  votingStartsAt: string
  votingEndsAt: string
  reviewStartsAt: string
  reviewEndsAt: string
  showDate: string
  showStartsAt: string
}

export interface UpsertCategoryPayload {
  groupName: string
  name: string
  slug: string
  description: string
  sortOrder: number
  maxNomineesPerUser: number
}

export interface UpsertCandidatePayload {
  categoryId: number
  displayName: string
  channelSlug: string
  platform: string
}

export interface UpdateClipStatusPayload {
  status: string
  reviewNote?: string
}

export interface ResolveRiskFlagPayload {
  status: string
  reviewNote?: string
}

export interface BulkResolveRiskFlagsPayload {
  riskFlagIds: number[]
  status: string
  reviewNote?: string
}

export interface UpdateRiskRulePayload {
  key: string
  label: string
  enabled: boolean
  threshold: number
  windowMinutes: number
  severity: string
  description: string
}

export interface UpdateRiskRulesPayload {
  rules: UpdateRiskRulePayload[]
}

export interface SetAwardResultPayload {
  categoryId: number
  candidateId: number
}

export interface ApproveNominationPayload {
  displayName: string
  channelSlug: string
  platform: string
  reviewNote?: string
}

export interface RejectNominationPayload {
  reviewNote?: string
}

export interface UpdateSiteSettingsPayload {
  hostDisplayName: string
  hostTagline: string
  newsletterUrl: string
  privacyEmail: string
  privacyPolicyContent: string
  imprintUrl: string
  imprintContent: string
  contactUrl: string
  contactContent: string
  sponsorsUrl: string
  sponsorsContent: string
  socialLinks: PublicSocialLink[]
  faq: FaqItem[]
}

export interface UpdateOperationalSettingsPayload {
  demoLoginEnabled: boolean
  demoLoginEmail: string
  demoLoginPassword?: string
  demoLoginTwitchUserId: string
  demoLoginDisplayName: string
  twitchClientId: string
  twitchClientSecret?: string
  twitchRedirectUri: string
  twitchScope: string
  maintenanceModeEnabled: boolean
  maintenanceTitle: string
  maintenanceMessage: string
}
