import { RecommendationMetricMap } from "@/types/recommendations";

export function sumRecommendationMetricMap(
  obj: RecommendationMetricMap
): number {
  // In the recommendations section of the building passport we have the cost map which
  // contains the costs of the recommendations. We need to sum these costs to display
  // the total cost of the recommendations
  return Object.values(obj).reduce((sum, current) => sum + current, 0);
}
