186 lines
5.6 KiB
TypeScript
186 lines
5.6 KiB
TypeScript
/**
|
|
* Supabase Database Types
|
|
* Based on gantt-board schema
|
|
*/
|
|
|
|
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;
|
|
};
|
|
};
|
|
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;
|
|
};
|
|
};
|
|
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;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
type Json = any;
|
|
|
|
// Voxyz Phase 10: Import Voxyz database extensions
|
|
export type { VoxyzDatabase } from './voxyz.types';
|
|
|
|
// Extended types for activity feed
|
|
export interface TaskComment {
|
|
id: string;
|
|
text: string;
|
|
createdAt: string;
|
|
commentAuthorId: string;
|
|
replies?: TaskComment[];
|
|
}
|
|
|
|
export interface ActivityItem {
|
|
id: string;
|
|
type: 'task_created' | 'task_completed' | 'task_updated' | 'comment_added' | 'task_assigned';
|
|
task_id: string;
|
|
task_title: string;
|
|
project_id: string;
|
|
project_name: string;
|
|
project_color: string;
|
|
user_id: string;
|
|
user_name: string;
|
|
user_avatar_url?: string;
|
|
timestamp: string;
|
|
details?: string;
|
|
comment_text?: string;
|
|
old_status?: string;
|
|
new_status?: string;
|
|
}
|
|
|
|
export type TaskStatus = Database['public']['Tables']['tasks']['Row']['status'];
|
|
export type TaskType = Database['public']['Tables']['tasks']['Row']['type'];
|