/**
 * TabataFit Supabase Database Types
 * Generated types for the Supabase schema
 */

export type Json =
  | string
  | number
  | boolean
  | null
  | { [key: string]: Json | undefined }
  | Json[]

export interface Database {
  public: {
    Tables: {
      workouts: {
        Row: {
          id: string
          title: string
          trainer_id: string
          category: 'full-body' | 'core' | 'upper-body' | 'lower-body' | 'cardio'
          level: 'Beginner' | 'Intermediate' | 'Advanced'
          duration: number
          calories: number
          rounds: number
          prep_time: number
          work_time: number
          rest_time: number
          equipment: string[]
          music_vibe: 'electronic' | 'hip-hop' | 'pop' | 'rock' | 'chill'
          exercises: {
            name: string
            duration: number
          }[]
          thumbnail_url: string | null
          video_url: string | null
          is_featured: boolean
          created_at: string
          updated_at: string
        }
        Insert: {
          id?: string
          title: string
          trainer_id: string
          category: 'full-body' | 'core' | 'upper-body' | 'lower-body' | 'cardio'
          level: 'Beginner' | 'Intermediate' | 'Advanced'
          duration: number
          calories: number
          rounds: number
          prep_time: number
          work_time: number
          rest_time: number
          equipment?: string[]
          music_vibe: 'electronic' | 'hip-hop' | 'pop' | 'rock' | 'chill'
          exercises: {
            name: string
            duration: number
          }[]
          thumbnail_url?: string | null
          video_url?: string | null
          is_featured?: boolean
          created_at?: string
          updated_at?: string
        }
        Update: {
          id?: string
          title?: string
          trainer_id?: string
          category?: 'full-body' | 'core' | 'upper-body' | 'lower-body' | 'cardio'
          level?: 'Beginner' | 'Intermediate' | 'Advanced'
          duration?: number
          calories?: number
          rounds?: number
          prep_time?: number
          work_time?: number
          rest_time?: number
          equipment?: string[]
          music_vibe?: 'electronic' | 'hip-hop' | 'pop' | 'rock' | 'chill'
          exercises?: {
            name: string
            duration: number
          }[]
          thumbnail_url?: string | null
          video_url?: string | null
          is_featured?: boolean
          updated_at?: string
        }
      }
      user_profiles: {
        Row: {
          id: string
          name: string
          fitness_level: string
          goal: string
          weekly_frequency: number
          barriers: string[]
          is_anonymous: boolean
          sync_enabled: boolean
          subscription_plan: string
          onboarding_completed_at: string
          created_at: string
          updated_at: string
        }
        Insert: {
          id: string
          name: string
          fitness_level: string
          goal: string
          weekly_frequency: number
          barriers?: string[]
          is_anonymous?: boolean
          sync_enabled?: boolean
          subscription_plan?: string
          onboarding_completed_at: string
          created_at?: string
          updated_at?: string
        }
        Update: {
          id?: string
          name?: string
          fitness_level?: string
          goal?: string
          weekly_frequency?: number
          barriers?: string[]
          is_anonymous?: boolean
          sync_enabled?: boolean
          subscription_plan?: string
          onboarding_completed_at?: string
          updated_at?: string
        }
      }
      user_preferences: {
        Row: {
          user_id: string
          preferred_categories: string[]
          preferred_trainers: string[]
          preferred_durations: string[]
          difficulty_preference: string
          created_at: string
          updated_at: string
        }
        Insert: {
          user_id: string
          preferred_categories?: string[]
          preferred_trainers?: string[]
          preferred_durations?: string[]
          difficulty_preference?: string
          created_at?: string
          updated_at?: string
        }
        Update: {
          preferred_categories?: string[]
          preferred_trainers?: string[]
          preferred_durations?: string[]
          difficulty_preference?: string
          updated_at?: string
        }
      }
      workout_sessions: {
        Row: {
          id: string
          user_id: string
          workout_id: string
          completed_at: string
          duration_seconds: number
          calories_burned: number
          feeling_rating: number | null
          created_at: string
        }
        Insert: {
          id?: string
          user_id: string
          workout_id: string
          completed_at: string
          duration_seconds: number
          calories_burned: number
          feeling_rating?: number | null
          created_at?: string
        }
        Update: {
          workout_id?: string
          completed_at?: string
          duration_seconds?: number
          calories_burned?: number
          feeling_rating?: number | null
        }
      }
      trainers: {
        Row: {
          id: string
          name: string
          specialty: string
          color: string
          avatar_url: string | null
          workout_count: number
          created_at: string
          updated_at: string
        }
        Insert: {
          id?: string
          name: string
          specialty: string
          color: string
          avatar_url?: string | null
          workout_count?: number
          created_at?: string
          updated_at?: string
        }
        Update: {
          id?: string
          name?: string
          specialty?: string
          color?: string
          avatar_url?: string | null
          workout_count?: number
          updated_at?: string
        }
      }
      collections: {
        Row: {
          id: string
          title: string
          description: string
          icon: string
          gradient: string[] | null
          created_at: string
          updated_at: string
        }
        Insert: {
          id?: string
          title: string
          description: string
          icon: string
          gradient?: string[] | null
          created_at?: string
          updated_at?: string
        }
        Update: {
          id?: string
          title?: string
          description?: string
          icon?: string
          gradient?: string[] | null
          updated_at?: string
        }
      }
      collection_workouts: {
        Row: {
          id: string
          collection_id: string
          workout_id: string
          sort_order: number
          created_at: string
        }
        Insert: {
          id?: string
          collection_id: string
          workout_id: string
          sort_order?: number
          created_at?: string
        }
        Update: {
          id?: string
          collection_id?: string
          workout_id?: string
          sort_order?: number
        }
      }
      workout_programs: {
        Row: {
          id: string
          title: string
          description: string | null
          body_zone: 'upper-body' | 'lower-body' | 'full-body'
          level: 'Beginner' | 'Intermediate' | 'Advanced'
          is_free: boolean
          music_vibe: 'electronic' | 'hip-hop' | 'pop' | 'rock' | 'chill'
          estimated_duration: number
          estimated_calories: number
          icon: string | null
          accent_color: string | null
          sort_order: number
          created_at: string
          updated_at: string
        }
        Insert: {
          id?: string
          title: string
          description?: string | null
          body_zone: 'upper-body' | 'lower-body' | 'full-body'
           level: 'Beginner' | 'Intermediate' | 'Advanced'
          is_free?: boolean
          music_vibe?: 'electronic' | 'hip-hop' | 'pop' | 'rock' | 'chill'
          estimated_duration?: number
          estimated_calories: number
          icon?: string | null
          accent_color?: string | null
          sort_order?: number
          created_at?: string
          updated_at?: string
        }
        Update: {
          id?: string
          title?: string
          description?: string | null
          body_zone?: 'upper-body' | 'lower-body' | 'full-body'
          level?: 'Beginner' | 'Intermediate' | 'Advanced'
          is_free?: boolean
          music_vibe?: 'electronic' | 'hip-hop' | 'pop' | 'rock' | 'chill'
          estimated_duration?: number
          estimated_calories?: number
          icon?: string | null
          accent_color?: string | null
          sort_order?: number
          updated_at?: string
        }
      }
      program_tabatas: {
        Row: {
          id: string
          program_id: string
          position: number
          exercise_1_name: string
          exercise_1_name_en: string | null
          exercise_1_tip: string | null
          exercise_1_tip_en: string | null
          exercise_1_modification: string | null
          exercise_1_modification_en: string | null
          exercise_1_progression: string | null
          exercise_1_progression_en: string | null
          exercise_2_name: string
          exercise_2_name_en: string | null
          exercise_2_tip: string | null
          exercise_2_tip_en: string | null
          exercise_2_modification: string | null
          exercise_2_modification_en: string | null
          exercise_2_progression: string | null
          exercise_2_progression_en: string | null
          rounds: number
          work_time: number
          rest_time: number
          created_at: string
        }
        Insert: {
          id?: string
          program_id: string
          position: number
          exercise_1_name: string
          exercise_1_name_en?: string | null
          exercise_1_tip?: string | null
          exercise_1_tip_en?: string | null
          exercise_1_modification?: string | null
          exercise_1_modification_en?: string | null
          exercise_1_progression?: string | null
          exercise_1_progression_en?: string | null
          exercise_2_name: string
          exercise_2_name_en?: string | null
          exercise_2_tip?: string | null
          exercise_2_tip_en?: string | null
          exercise_2_modification?: string | null
          exercise_2_modification_en?: string | null
          exercise_2_progression?: string | null
          exercise_2_progression_en?: string | null
          rounds?: number
          work_time?: number
          rest_time?: number
          created_at?: string
        }
        Update: {
          id?: string
          program_id?: string
          position?: number
          exercise_1_name?: string
          exercise_1_name_en?: string | null
          exercise_1_tip?: string | null
          exercise_1_tip_en?: string | null
          exercise_1_modification?: string | null
          exercise_1_modification_en?: string | null
          exercise_1_progression?: string | null
          exercise_1_progression_en?: string | null
          exercise_2_name?: string
          exercise_2_name_en?: string | null
          exercise_2_tip?: string | null
          exercise_2_tip_en?: string | null
          exercise_2_modification?: string | null
          exercise_2_modification_en?: string | null
          exercise_2_progression?: string | null
          exercise_2_progression_en?: string | null
          rounds?: number
          work_time?: number
          rest_time?: number
        }
      }
      achievements: {
        Row: {
          id: string
          title: string
          description: string
          icon: string
          requirement: number
          type: 'workouts' | 'streak' | 'minutes' | 'calories'
          created_at: string
          updated_at: string
        }
        Insert: {
          id?: string
          title: string
          description: string
          icon: string
          requirement: number
          type: 'workouts' | 'streak' | 'minutes' | 'calories'
          created_at?: string
          updated_at?: string
        }
        Update: {
          id?: string
          title?: string
          description?: string
          icon?: string
          requirement?: number
          type?: 'workouts' | 'streak' | 'minutes' | 'calories'
          updated_at?: string
        }
      }
      admin_users: {
        Row: {
          id: string
          email: string
          role: 'admin' | 'editor'
          created_at: string
          last_login: string | null
        }
        Insert: {
          id?: string
          email: string
          role?: 'admin' | 'editor'
          created_at?: string
          last_login?: string | null
        }
        Update: {
          id?: string
          email?: string
          role?: 'admin' | 'editor'
          last_login?: string | null
        }
      }
      download_jobs: {
        Row: {
          id: string
          playlist_url: string
          playlist_title: string | null
          status: 'pending' | 'processing' | 'completed' | 'failed'
          total_items: number
          completed_items: number
          failed_items: number
          created_by: string
          created_at: string
          updated_at: string
        }
        Insert: {
          id?: string
          playlist_url: string
          playlist_title?: string | null
          status?: 'pending' | 'processing' | 'completed' | 'failed'
          total_items?: number
          completed_items?: number
          failed_items?: number
          created_by: string
        }
        Update: Partial<Omit<Database['public']['Tables']['download_jobs']['Insert'], 'id'>>
      }
      download_items: {
        Row: {
          id: string
          job_id: string
          video_id: string
          title: string | null
          duration_seconds: number | null
          thumbnail_url: string | null
          status: 'pending' | 'downloading' | 'completed' | 'failed'
          storage_path: string | null
          public_url: string | null
          error_message: string | null
          genre: 'edm' | 'hip-hop' | 'pop' | 'rock' | 'latin' | 'house' | 'drum-and-bass' | 'dubstep' | 'r-and-b' | 'country' | 'metal' | 'ambient' | null
          created_at: string
        }
        Insert: {
          id?: string
          job_id: string
          video_id: string
          title?: string | null
          duration_seconds?: number | null
          thumbnail_url?: string | null
          status?: 'pending' | 'downloading' | 'completed' | 'failed'
          storage_path?: string | null
          public_url?: string | null
          error_message?: string | null
          genre?: 'edm' | 'hip-hop' | 'pop' | 'rock' | 'latin' | 'house' | 'drum-and-bass' | 'dubstep' | 'r-and-b' | 'country' | 'metal' | 'ambient' | null
        }
        Update: Partial<Omit<Database['public']['Tables']['download_items']['Insert'], 'id'>>
      }
    }
    Views: {
      [_ in never]: never
    }
    Functions: {
      [_ in never]: never
    }
    Enums: {
      [_ in never]: never
    }
  }
}
