/**
 * Supabase Database Types
 * Generated based on the schema in supabase/schema.sql
 */

export interface Database {
  public: {
    Tables: {
      users: {
        Row: {
          id: string;
          legacy_id: string | null;
          name: string;
          email: string;
          avatar_url: string | null;
          password_hash: string;
          created_at: string;
        };
        Insert: {
          id?: string;
          legacy_id?: string | null;
          name: string;
          email: string;
          avatar_url?: string | null;
          password_hash: string;
          created_at?: string;
        };
        Update: {
          id?: string;
          legacy_id?: string | null;
          name?: string;
          email?: string;
          avatar_url?: string | null;
          password_hash?: string;
          created_at?: string;
        };
      };
      sessions: {
        Row: {
          id: string;
          user_id: string;
          token_hash: string;
          created_at: string;
          expires_at: string;
        };
        Insert: {
          id?: string;
          user_id: string;
          token_hash: string;
          created_at?: string;
          expires_at: string;
        };
        Update: {
          id?: string;
          user_id?: string;
          token_hash?: string;
          created_at?: string;
          expires_at?: string;
        };
      };
      password_reset_tokens: {
        Row: {
          id: string;
          user_id: string;
          token_hash: string;
          expires_at: string;
          created_at: string;
          used: boolean;
        };
        Insert: {
          id?: string;
          user_id: string;
          token_hash: string;
          expires_at: string;
          created_at?: string;
          used?: boolean;
        };
        Update: {
          id?: string;
          user_id?: string;
          token_hash?: string;
          expires_at?: string;
          created_at?: string;
          used?: boolean;
        };
      };
      projects: {
        Row: {
          id: string;
          legacy_id: string | null;
          name: string;
          description: string | null;
          color: string;
          created_at: string;
        };
        Insert: {
          id?: string;
          legacy_id?: string | null;
          name: string;
          description?: string | null;
          color: string;
          created_at?: string;
        };
        Update: {
          id?: string;
          legacy_id?: string | null;
          name?: string;
          description?: string | null;
          color?: string;
          created_at?: string;
        };
      };
      sprints: {
        Row: {
          id: string;
          legacy_id: string | null;
          name: string;
          goal: string | null;
          start_date: string;
          end_date: string;
          status: 'planning' | 'active' | 'completed';
          project_id: string;
          created_at: string;
        };
        Insert: {
          id?: string;
          legacy_id?: string | null;
          name: string;
          goal?: string | null;
          start_date: string;
          end_date: string;
          status: 'planning' | 'active' | 'completed';
          project_id: string;
          created_at?: string;
        };
        Update: {
          id?: string;
          legacy_id?: string | null;
          name?: string;
          goal?: string | null;
          start_date?: string;
          end_date?: string;
          status?: 'planning' | 'active' | 'completed';
          project_id?: string;
          created_at?: string;
        };
      };
      tasks: {
        Row: {
          id: string;
          legacy_id: string | null;
          title: string;
          description: string | null;
          type: 'idea' | 'task' | 'bug' | 'research' | 'plan';
          status: 'open' | 'todo' | 'blocked' | 'in-progress' | 'review' | 'validate' | 'archived' | 'canceled' | 'done';
          priority: 'low' | 'medium' | 'high' | 'urgent';
          project_id: string;
          sprint_id: string | null;
          created_at: string;
          updated_at: string;
          created_by_id: string | null;
          created_by_name: string | null;
          created_by_avatar_url: string | null;
          updated_by_id: string | null;
          updated_by_name: string | null;
          updated_by_avatar_url: string | null;
          assignee_id: string | null;
          assignee_name: string | null;
          assignee_email: string | null;
          assignee_avatar_url: string | null;
          due_date: string | null;
          comments: Json;
          tags: Json;
          attachments: Json;
        };
        Insert: {
          id?: string;
          legacy_id?: string | null;
          title: string;
          description?: string | null;
          type: 'idea' | 'task' | 'bug' | 'research' | 'plan';
          status: 'open' | 'todo' | 'blocked' | 'in-progress' | 'review' | 'validate' | 'archived' | 'canceled' | 'done';
          priority: 'low' | 'medium' | 'high' | 'urgent';
          project_id: string;
          sprint_id?: string | null;
          created_at?: string;
          updated_at?: string;
          created_by_id?: string | null;
          created_by_name?: string | null;
          created_by_avatar_url?: string | null;
          updated_by_id?: string | null;
          updated_by_name?: string | null;
          updated_by_avatar_url?: string | null;
          assignee_id?: string | null;
          assignee_name?: string | null;
          assignee_email?: string | null;
          assignee_avatar_url?: string | null;
          due_date?: string | null;
          comments?: Json;
          tags?: Json;
          attachments?: Json;
        };
        Update: {
          id?: string;
          legacy_id?: string | null;
          title?: string;
          description?: string | null;
          type?: 'idea' | 'task' | 'bug' | 'research' | 'plan';
          status?: 'open' | 'todo' | 'blocked' | 'in-progress' | 'review' | 'validate' | 'archived' | 'canceled' | 'done';
          priority?: 'low' | 'medium' | 'high' | 'urgent';
          project_id?: string;
          sprint_id?: string | null;
          created_at?: string;
          updated_at?: string;
          created_by_id?: string | null;
          created_by_name?: string | null;
          created_by_avatar_url?: string | null;
          updated_by_id?: string | null;
          updated_by_name?: string | null;
          updated_by_avatar_url?: string | null;
          assignee_id?: string | null;
          assignee_name?: string | null;
          assignee_email?: string | null;
          assignee_avatar_url?: string | null;
          due_date?: string | null;
          comments?: Json;
          tags?: Json;
          attachments?: Json;
        };
      };
      meta: {
        Row: {
          key: string;
          value: string;
          updated_at: string;
        };
        Insert: {
          key: string;
          value: string;
          updated_at?: string;
        };
        Update: {
          key?: string;
          value?: string;
          updated_at?: string;
        };
      };
    };
  };
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
type Json = any;
