export type Json =
  | string
  | number
  | boolean
  | null
  | { [key: string]: Json | undefined }
  | Json[];

export type Database = {
  public: {
    Tables: {
      profiles: {
        Row: {
          id: string;
          email: string;
          username: string;
          avatar_url: string | null;
          bio: string | null;
          total_points: number;
          games_played: number;
          modules_completed: number;
          last_login_date: string | null;
          current_streak: number;
          max_streak: number;
          streak_multiplier: number;
          created_at: string;
          updated_at: string;
          is_active: boolean;
          last_login: string | null;
        };
        Insert: {
          id: string;
          email: string;
          username: string;
          avatar_url?: string | null;
          bio?: string | null;
          total_points?: number;
          games_played?: number;
          modules_completed?: number;
          last_login_date?: string | null;
          current_streak?: number;
          max_streak?: number;
          streak_multiplier?: number;
          created_at?: string;
          updated_at?: string;
          is_active?: boolean;
          last_login?: string | null;
        };
        Update: {
          id?: string;
          email?: string;
          username?: string;
          avatar_url?: string | null;
          bio?: string | null;
          total_points?: number;
          games_played?: number;
          modules_completed?: number;
          last_login_date?: string | null;
          current_streak?: number;
          max_streak?: number;
          streak_multiplier?: number;
          created_at?: string;
          updated_at?: string;
          is_active?: boolean;
          last_login?: string | null;
        };
      };
      videos: {
        Row: {
          id: number;
          title: string;
          slug: string;
          description: string;
          video_url: string;
          transcript: string | null;
          duration_seconds: number | null;
          thumbnail_url: string | null;
          order_index: number;
          difficulty_level: string | null;
          is_published: boolean;
          created_at: string;
          updated_at: string;
        };
        Insert: {
          id?: number;
          title: string;
          slug: string;
          description: string;
          video_url: string;
          transcript?: string | null;
          duration_seconds?: number | null;
          thumbnail_url?: string | null;
          order_index: number;
          difficulty_level?: string | null;
          is_published?: boolean;
          created_at?: string;
          updated_at?: string;
        };
        Update: {
          id?: number;
          title?: string;
          slug?: string;
          description?: string;
          video_url?: string;
          transcript?: string | null;
          duration_seconds?: number | null;
          thumbnail_url?: string | null;
          order_index?: number;
          difficulty_level?: string | null;
          is_published?: boolean;
          created_at?: string;
          updated_at?: string;
        };
      };
      game_sessions: {
        Row: {
          id: string;
          user_id: string;
          game_type: string;
          score: number;
          max_score: number;
          round_number: number;
          total_rounds: number;
          game_details: Json | null;
          step1_score: number;
          step2_score: number;
          step3_score: number;
          bonus_points: number;
          penalty_points: number;
          game_duration_seconds: number | null;
          started_at: string;
          completed_at: string;
          is_completed: boolean;
          has_bonus: boolean;
          water_efficiency_achieved: boolean;
          created_at: string;
        };
        Insert: {
          id?: string;
          user_id: string;
          game_type: string;
          score: number;
          max_score?: number;
          round_number?: number;
          total_rounds?: number;
          game_details?: Json | null;
          step1_score?: number;
          step2_score?: number;
          step3_score?: number;
          bonus_points?: number;
          penalty_points?: number;
          game_duration_seconds?: number | null;
          started_at?: string;
          completed_at?: string;
          is_completed?: boolean;
          has_bonus?: boolean;
          water_efficiency_achieved?: boolean;
          created_at?: string;
        };
        Update: {
          id?: string;
          user_id?: string;
          game_type?: string;
          score?: number;
          max_score?: number;
          round_number?: number;
          total_rounds?: number;
          game_details?: Json | null;
          step1_score?: number;
          step2_score?: number;
          step3_score?: number;
          bonus_points?: number;
          penalty_points?: number;
          game_duration_seconds?: number | null;
          started_at?: string;
          completed_at?: string;
          is_completed?: boolean;
          has_bonus?: boolean;
          water_efficiency_achieved?: boolean;
          created_at?: string;
        };
      };
      badges: {
        Row: {
          id: number;
          slug: string;
          title: string;
          description: string | null;
          icon_url: string | null;
          badge_category: string | null;
          achievement_type: string | null;
          requirement_value: number | null;
          created_at: string;
        };
        Insert: {
          id?: number;
          slug: string;
          title: string;
          description?: string | null;
          icon_url?: string | null;
          badge_category?: string | null;
          achievement_type?: string | null;
          requirement_value?: number | null;
          created_at?: string;
        };
        Update: {
          id?: number;
          slug?: string;
          title?: string;
          description?: string | null;
          icon_url?: string | null;
          badge_category?: string | null;
          achievement_type?: string | null;
          requirement_value?: number | null;
          created_at?: string;
        };
      };
    };
    Views: {};
    Functions: {};
    Enums: {};
    CompositeTypes: {};
  };
};
