goldstars-services 1.0.41 → 1.0.42
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.
|
@@ -96,23 +96,21 @@ var createReservation = exports.createReservation = /*#__PURE__*/function () {
|
|
|
96
96
|
}();
|
|
97
97
|
|
|
98
98
|
/**
|
|
99
|
-
* Gets the availability status of all bikes for a specific location
|
|
99
|
+
* Gets the availability status of all bikes for a specific location and date.
|
|
100
100
|
* @param {string} location - The location ('Sambil' or 'Las Virtudes').
|
|
101
101
|
* @param {Date} date - The date to check.
|
|
102
|
-
* @param {string} timeSlot - The time slot to check.
|
|
103
102
|
* @returns {Promise<Array<object>>} - An array of bike objects, each with an added 'reservationStatus' field.
|
|
104
103
|
*/
|
|
105
104
|
var getBikeAvailabilityForSlot = exports.getBikeAvailabilityForSlot = /*#__PURE__*/function () {
|
|
106
|
-
var _ref3 = _asyncToGenerator(function* (location, date
|
|
105
|
+
var _ref3 = _asyncToGenerator(function* (location, date) {
|
|
107
106
|
// 1. Find all bikes for the given location
|
|
108
107
|
var bikesInLocation = yield _bikeModel.default.find({
|
|
109
108
|
location
|
|
110
109
|
}).lean(); // .lean() for plain JS objects
|
|
111
110
|
|
|
112
|
-
// 2. Find all reservations for the specific date
|
|
111
|
+
// 2. Find all reservations for the specific date
|
|
113
112
|
var reservations = yield _reservationModel.default.find({
|
|
114
113
|
date,
|
|
115
|
-
timeSlot,
|
|
116
114
|
location // Filter by location as well for efficiency
|
|
117
115
|
// Optional: Add status filter if needed
|
|
118
116
|
// status: 'confirmed',
|
|
@@ -162,7 +160,7 @@ var getBikeAvailabilityForSlot = exports.getBikeAvailabilityForSlot = /*#__PURE_
|
|
|
162
160
|
});
|
|
163
161
|
return bikesWithStatus;
|
|
164
162
|
});
|
|
165
|
-
return function getBikeAvailabilityForSlot(_x5, _x6
|
|
163
|
+
return function getBikeAvailabilityForSlot(_x5, _x6) {
|
|
166
164
|
return _ref3.apply(this, arguments);
|
|
167
165
|
};
|
|
168
166
|
}();
|
|
@@ -197,7 +195,7 @@ var cancelReservation = exports.cancelReservation = /*#__PURE__*/function () {
|
|
|
197
195
|
message: 'Reserva cancelada exitosamente.'
|
|
198
196
|
};
|
|
199
197
|
});
|
|
200
|
-
return function cancelReservation(_x8, _x9
|
|
198
|
+
return function cancelReservation(_x7, _x8, _x9) {
|
|
201
199
|
return _ref4.apply(this, arguments);
|
|
202
200
|
};
|
|
203
201
|
}();
|