import { Task as PrismaTask, TaskStatus } from "@prisma/client";
import { Member } from "../members/types";
import { Project } from "../projects/types";
import { Board } from "../boards/types";

export { TaskStatus };

export interface Task extends PrismaTask {
  project?: Project | null;
  assignee?: Member | null;
  board?: Board | null;
  epic?: {
    id: string;
    name: string;
    status: TaskStatus;
  } | null;
}

export interface TaskWithRelations extends PrismaTask {
  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;
  board?: {
    id: string;
    name: string;
    description?: string | null;
  } | null;
  epic?: {
    id: string;
    name: string;
    status: TaskStatus;
    description?: string | null;
  } | null;
}
