@happychef/algorithm 1.2.4 → 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -49,16 +49,16 @@ function getMealType(time) {
49
49
  }
50
50
 
51
51
  /**
52
- * Count guests arriving at exact time
52
+ * Count number of groups/reservations arriving at exact time
53
53
  * @param {Array} reservations - Reservation list
54
54
  * @param {string} date - Date (YYYY-MM-DD)
55
55
  * @param {string} time - Time (HH:MM)
56
- * @returns {number} - Guest count
56
+ * @returns {number} - Number of groups/arrivals (count of reservations)
57
57
  */
58
58
  function countArrivalsAtTime(reservations, date, time) {
59
59
  return reservations
60
60
  .filter(r => r.date === date && r.time === time)
61
- .reduce((sum, r) => sum + (parseInt(r.guests, 10) || 0), 0);
61
+ .length; // Count number of reservations, not total guests
62
62
  }
63
63
 
64
64
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happychef/algorithm",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "Restaurant and reservation algorithm utilities",
5
5
  "main": "index.js",
6
6
  "author": "happy chef",