async function calculateDiscount(productIds) {
  const timer = new Timer();


  let discountUsd = 0;
  const processConcurrently = sliceIntoChunks(productIds, 10)
      .map(async (productIds) => {
        const discounts = await db.collection("discounts")
            .where("products", "array-contains-any", productIds)
            .get();
        for (const discount of discounts.docs) {
          discountUsd += discount.data().usd || 0;
        }
      });
  await Promise.all(processConcurrently);
  logger.info("calculateDiscount", {calcDiscountMs: timer.measureMs()});
  return discountUsd;
}
Sum discounts of all `productIds`
@param {string[]} productIds
@return {number}