import { Epic as PrismaEpic, TaskStatus } from "@prisma/client";
import { Member } from "../members/types";
import { Project } from "../projects/types";
import { Task } from "../tasks/types";

export { TaskStatus };

export interface Epic extends PrismaEpic {
  project?: Project | null;
  assignee?: Member | null;
  tasks?: Task[];
}

export interface EpicWithRelations extends PrismaEpic {
  project?: {
    id: string;
    name: string;
    imageUrl: string;
    workspaceId: string;
  } | null;
  assignee?: {
    id: string;
    userId: string;
    workspaceId: string;
    role: string;
    name: string | null;
    email: string;
    imageUrl?: string | null;
  } | null;
  tasks?: {
    id: string;
    name: string;
    status: TaskStatus;
    assigneeId?: string | null;
    projectId?: string | null;
    dueDate?: Date | null;
  }[];
  _count?: {
    tasks: number;
  };
}

export interface EpicStats {
  totalTasks: number;
  completedTasks: number;
  progressPercentage: number;
  status: TaskStatus;
} 