// Socket event name constants for consistency across client and server

export const SOCKET_EVENTS = {
  // Vote events
  VOTE_SUBMIT: 'vote:submit',
  VOTE_BATCH: 'vote:batch',
  VOTE_UPDATED: 'vote:updated',
  VOTE_RESULT: 'vote:result',
  VOTE_ERROR: 'vote:error',

  // Draw events
  DRAW_START: 'draw:start',
  DRAW_STARTED: 'draw:started',
  DRAW_SPINNING: 'draw:spinning',
  DRAW_WINNER: 'draw:winner',
  DRAW_STOP: 'draw:stop',
  DRAW_ENDED: 'draw:ended',

  // Connection events
  CONNECTION_ACK: 'connection:ack',
  CONNECTION_PING: 'connection:ping',
  CONNECTION_PONG: 'connection:pong',
  CONNECTION_JOIN: 'connection:join',
  CONNECTION_USERS_COUNT: 'connection:users_count',

  // Sync events
  SYNC_REQUEST: 'sync:request',
  SYNC_STATE: 'sync:state',

  // Admin control events
  ADMIN_PHASE_CHANGE: 'admin:phase_change',
  ADMIN_VOTING_CONTROL: 'admin:voting_control',
  ADMIN_LOTTERY_CONTROL: 'admin:lottery_control',
  ADMIN_EMERGENCY_RESET: 'admin:emergency_reset',
  ADMIN_STATE_SYNC: 'admin:state_sync',
  ADMIN_MUSIC_CONTROL: 'admin:music_control',
} as const;

export const SOCKET_ROOMS = {
  MOBILE_USERS: 'room:mobile',
  SCREEN_DISPLAY: 'room:screen',
  ADMIN: 'room:admin',
  ALL: 'room:all',
} as const;

export type SocketEventName = (typeof SOCKET_EVENTS)[keyof typeof SOCKET_EVENTS];
export type SocketRoomName = (typeof SOCKET_ROOMS)[keyof typeof SOCKET_ROOMS];
