export interface SessionResponse {
  authenticated: boolean;
  provider?: string | null;
  is_admin: boolean;
  external_user_id?: string | null;
  external_team_id?: string | null;
  external_player_id?: string | null;
  token_expires_at?: string | null;
}

export interface TeamSnapTokenResponse {
  access_token: string;
  expires_at?: string | null;
  api_root: string;
  auth_url: string;
}

export interface AudioAsset {
  id: number;
  external_team_id: string;
  owner_external_player_id: string;
  title: string;
  original_filename: string;
  mime_type: string;
  size_bytes: number;
  created_at: string;
}

export interface AudioAssetUpdate {
  title: string;
}

export interface AudioAssetImportCreate {
  external_team_id: string;
  owner_external_player_id: string;
  url: string;
  title?: string;
}

export interface AudioClip {
  id: number;
  asset_id: number;
  external_team_id: string;
  owner_external_player_id: string;
  asset_title: string;
  label: string;
  start_ms: number;
  end_ms: number;
  sort_order: number;
  hidden: boolean;
  normalization_status: string;
  normalized_url?: string | null;
  waveform_duration_ms?: number | null;
  waveform_peaks?: number[] | null;
  created_at: string;
}

export interface AudioClipUpdate {
  start_ms: number;
  end_ms: number;
  label?: string;
  sort_order?: number | null;
  hidden?: boolean | null;
}

export interface GameAssignment {
  id: number;
  external_team_id: string;
  external_game_id: string;
  external_player_id: string;
  clip_id: number;
  clip_label: string;
  asset_title: string;
  start_ms: number;
  end_ms: number;
  batting_slot?: number | null;
  status: string;
  normalized_url?: string | null;
  updated_at: string;
}

export interface GamePrepResponse {
  external_game_id: string;
  external_team_id: string;
  prepared_at: string;
  assignments: GameAssignment[];
}

export interface TeamSnapTeam {
  id: number | string;
  name?: string;
  seasonName?: string;
  isRetired?: boolean;
  [key: string]: unknown;
}

export interface TeamSnapUser {
  id: number | string;
  firstName?: string;
  lastName?: string;
  email?: string;
}

export interface TeamSnapMember {
  id: number | string;
  teamId?: number | string;
  userId?: number | string;
  isNonPlayer?: boolean;
  number?: number | string;
  jerseyNumber?: number | string;
  jersey_number?: number | string;
  firstName?: string;
  lastName?: string;
  name?: string;
  fullName?: string;
  displayName?: string;
  email?: string;
}

export interface TeamSnapAvailability {
  id: number | string;
  teamId?: number | string;
  eventId?: number | string;
  memberId?: number | string;
  statusCode?: number | null;
  [key: string]: unknown;
}

export interface TeamSnapEvent {
  id: number | string;
  teamId?: number | string;
  name?: string;
  isGame?: boolean;
  opponentName?: string;
  locationName?: string;
  startDate?: string | Date;
}

export interface TeamSnapEventLineup {
  id: number | string;
  eventId?: number | string;
  isPublished?: boolean;
  [key: string]: unknown;
}

export interface TeamSnapEventLineupEntry {
  id: number | string;
  eventLineupId?: number | string;
  memberId?: number | string;
  label?: string;
  sequence?: number | string | null;
  [key: string]: unknown;
}

export interface TeamSnapAssignment {
  id: number | string;
  teamId?: number | string;
  eventId?: number | string;
  memberId?: number | string;
  description?: string;
  order?: number;
  [key: string]: unknown;
}
