/**
 * Workflow types
 * TypeScript types for workflow domain
 */

export enum TaskStatus {
  PENDING = 'pending',
  IN_PROGRESS = 'in_progress',
  COMPLETED = 'completed',
  BLOCKED = 'blocked',
  REJECTED = 'rejected',
}

export enum WorkflowPhase {
  CONCEPT_DEVELOPMENT = 'Concept Development',
  REQUIREMENTS_ANALYSIS = 'Requirements Analysis',
  DESIGN = 'Design',
  DEVELOPMENT = 'Development',
  TESTING = 'Testing',
  DEPLOYMENT = 'Deployment',
  MAINTENANCE = 'Maintenance',
  RETIREMENT = 'Retirement',
}

export interface WorkflowItem {
  id: number;
  task: string;
  status: TaskStatus;
  requires_approval: boolean;
  approver?: string;
  comment?: string;
  updated_by?: string;
  updated_at?: string;
  created_at: string;
}

export interface Workflow {
  workflow_id: string;
  project_name: string;
  project_description?: string;
  records_officer_email?: string;
  current_phase: string;
  phase_number: number;
  project_status: string;
  completion_percentage: number;
  pending_approvals: string[];
  next_phase_ready: boolean;
  checklist_items: WorkflowItem[];
  completed_items: number[];
  validation_results: Record<string, string>;
  created_at: string;
  updated_at: string;
  created_by?: string;
}

export interface CreateWorkflowDto {
  project_name: string;
  project_description?: string;
  records_officer_email?: string;
}

export interface UpdateWorkflowItemDto {
  item_id: number;
  status: TaskStatus;
  comment?: string;
  updated_by?: string;
}

export interface ApprovalRequestDto {
  approval_type: string;
  approved: boolean;
  approver?: string;
  comment?: string;
}
