export interface PlatformCommandSubmissionLike {
  executionStatus?: unknown;
  approvalRequest?: { id?: unknown; requestNo?: unknown } | null;
}

export function pendingApproval(result: unknown): PlatformCommandSubmissionLike | null {
  if (!result || typeof result !== 'object') return null;
  const submission = result as PlatformCommandSubmissionLike;
  return submission.executionStatus === 'pending_approval' && submission.approvalRequest
    ? submission
    : null;
}
