goldstars-services 1.0.44 → 1.0.45

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.
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getBikeAvailabilityForSlot = exports.createReservation = exports.cancelReservation = void 0;
6
+ exports.default = void 0;
7
7
  var _reservationModel = _interopRequireDefault(require("../models/reservation.model.js"));
8
8
  var _bikeModel = _interopRequireDefault(require("../models/bike.model.js"));
9
9
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -45,7 +45,7 @@ var isBikeReserved = /*#__PURE__*/function () {
45
45
  * @returns {Promise<object>} - The created reservation document.
46
46
  * @throws {Error} - If bike not found, is instructor bike, or already reserved.
47
47
  */
48
- var createReservation = exports.createReservation = /*#__PURE__*/function () {
48
+ var createReservation = /*#__PURE__*/function () {
49
49
  var _ref2 = _asyncToGenerator(function* (reservationData) {
50
50
  var {
51
51
  userId,
@@ -98,7 +98,7 @@ var createReservation = exports.createReservation = /*#__PURE__*/function () {
98
98
  */
99
99
  // Comentado el código existente para simplificar la función y probar la exportación
100
100
  /*
101
- export const getBikeAvailabilityForSlot = async (location, date) => {
101
+ const getBikeAvailabilityForSlot = async (location, date) => {
102
102
  // 1. Find all bikes for the given location
103
103
  const bikesInLocation = await Bike.find({ location }).lean(); // .lean() for plain JS objects
104
104
 
@@ -148,7 +148,7 @@ export const getBikeAvailabilityForSlot = async (location, date) => {
148
148
  */
149
149
 
150
150
  // Nueva implementación simplificada para probar la exportación
151
- var getBikeAvailabilityForSlot = exports.getBikeAvailabilityForSlot = /*#__PURE__*/function () {
151
+ var getBikeAvailabilityForSlot = /*#__PURE__*/function () {
152
152
  var _ref3 = _asyncToGenerator(function* (location, date) {
153
153
  return {
154
154
  message: "Function is being called successfully",
@@ -170,7 +170,7 @@ var getBikeAvailabilityForSlot = exports.getBikeAvailabilityForSlot = /*#__PURE_
170
170
  * @returns {Promise<object>} - The result of the deletion operation.
171
171
  * @throws {Error} - If reservation not found or user is not authorized.
172
172
  */
173
- var cancelReservation = exports.cancelReservation = /*#__PURE__*/function () {
173
+ var cancelReservation = /*#__PURE__*/function () {
174
174
  var _ref4 = _asyncToGenerator(function* (reservationId, userId, userRole) {
175
175
  var reservation = yield _reservationModel.default.findById(reservationId);
176
176
  if (!reservation) {
@@ -194,4 +194,10 @@ var cancelReservation = exports.cancelReservation = /*#__PURE__*/function () {
194
194
  return function cancelReservation(_x7, _x8, _x9) {
195
195
  return _ref4.apply(this, arguments);
196
196
  };
197
- }();
197
+ }();
198
+ var _default = exports.default = {
199
+ getBikeAvailabilityForSlot,
200
+ createReservation,
201
+ cancelReservation,
202
+ isBikeReserved
203
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "goldstars-services",
3
- "version": "1.0.44",
3
+ "version": "1.0.45",
4
4
  "description": "This is the services layer for GoldStars",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {