// ── File-based coord DTOs (legacy file-system backed) ──

export interface CoordMissionStatusDto {
  mission: {
    id: string;
    name: string;
    status: string;
    projectPath: string;
  };
  milestones: {
    total: number;
    completed: number;
    current?: {
      id: string;
      name: string;
      status: string;
    };
  };
  tasks: {
    total: number;
    done: number;
    inProgress: number;
    pending: number;
    blocked: number;
    cancelled: number;
  };
  nextTaskId?: string;
  activeSession?: {
    sessionId: string;
    runtime: string;
    startedAt: string;
  };
}

export interface CoordTaskDetailDto {
  missionId: string;
  task: {
    id: string;
    title: string;
    status: string;
    milestone?: string;
    pr?: string;
    notes?: string;
  };
  isNextTask: boolean;
  activeSession?: {
    sessionId: string;
    runtime: string;
    startedAt: string;
  };
}

// ── DB-backed coord DTOs ──

export interface CreateDbMissionDto {
  name: string;
  description?: string;
  projectId?: string;
  phase?: string;
  milestones?: Record<string, unknown>[];
  config?: Record<string, unknown>;
  status?: 'planning' | 'active' | 'paused' | 'completed' | 'failed';
}

export interface UpdateDbMissionDto {
  name?: string;
  description?: string;
  projectId?: string;
  phase?: string;
  milestones?: Record<string, unknown>[];
  config?: Record<string, unknown>;
  status?: 'planning' | 'active' | 'paused' | 'completed' | 'failed';
}

export interface CreateMissionTaskDto {
  missionId: string;
  taskId?: string;
  status?: 'not-started' | 'in-progress' | 'blocked' | 'done' | 'cancelled';
  description?: string;
  notes?: string;
  pr?: string;
}

export interface UpdateMissionTaskDto {
  taskId?: string;
  status?: 'not-started' | 'in-progress' | 'blocked' | 'done' | 'cancelled';
  description?: string;
  notes?: string;
  pr?: string;
}
