export type PmWorkOrderState =
  | "draft"
  | "scheduled"
  | "in_progress"
  | "completed"
  | "verified"
  | "overdue"
  | "cancelled";

export type ApprovalState = "draft" | "submitted" | "pending_owner" | "approved" | "rejected" | "changes_requested" | "cancelled";

export type ProductionPlanState = "draft" | "simulated" | "locked" | "approved" | "released" | "replanned";

export type OperationsDashboardResponse = {
  generatedAt: string;
  summary: {
    totalAssets: number;
    criticalAssets: number;
    downAssets: number;
    activeTemplates: number;
    openWorkOrders: number;
    overdueWorkOrders: number;
    pendingApprovals: number;
    forecastUnits: number;
    plannedUnits: number;
    actualVarianceUnits: number;
  };
  workOrdersByState: Array<{ state: PmWorkOrderState; count: number }>;
  upcomingMaintenance: Array<{
    id: string;
    assetName: string;
    title: string;
    dueBy: string;
    state: PmWorkOrderState;
  }>;
  approvalInbox: Array<{
    id: string;
    requestType: string;
    state: ApprovalState;
    workOrderId: string | null;
    productionPlanId: string | null;
    createdAt: string;
    reason: string | null;
  }>;
};
