import { ApprovalStatus } from '../../../common/enums';

export interface PendingApproval {
  departmentCode: string;
  departmentName: string;
  approvalId: string;
  status: ApprovalStatus;
  invalidatedAt?: Date;
}

export interface CompletedStage {
  stageId: string;
  stageName: string;
  stageOrder: number;
  completedAt: Date;
  approvals: PendingApproval[];
}

export interface WorkflowState {
  requestId: string;
  workflowId: string;
  currentStageId: string;
  currentStageOrder: number;
  completedStages: CompletedStage[];
  pendingApprovals: PendingApproval[];
  isWorkflowComplete: boolean;
  workflowFailureReason?: string;
  startedAt: Date;
  completedAt?: Date;
  metadata?: Record<string, any>;
}

export interface WorkflowPreview {
  workflowId: string;
  workflowType: string;
  name: string;
  stages: Array<{
    stageId: string;
    stageName: string;
    stageOrder: number;
    departments: string[];
    executionType: string;
    completionCriteria: string;
  }>;
}
