ti2 1.0.98 → 1.0.99

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.
@@ -450,14 +450,19 @@ const createBooking = plugins => async (req, res, next) => {
450
450
  assert(userAppKeys, 'could not find the app key');
451
451
  const token = await userAppKeys.token;
452
452
  const func = (app.createBooking || app.addServiceToItinerary).bind(app);
453
- const results = await func({
454
- axios,
455
- token,
456
- payload,
457
- typeDefsAndQueries,
458
- requestId: req.requestId,
459
- });
460
-
453
+ let results;
454
+ if (payload.mock) {
455
+ results = { mock: true, success: true, bookingId: '1234567890' };
456
+ } else {
457
+ results = await func({
458
+ axios,
459
+ token,
460
+ payload,
461
+ typeDefsAndQueries,
462
+ requestId: req.requestId,
463
+ });
464
+ }
465
+ console.log(`emitting bookingsCreateBooking event for ${appKey}, user ${userId}, hint ${hint}, results: ${JSON.stringify(results)}`);
461
466
  app.events.emit('bookingsCreateBooking', {
462
467
  userId,
463
468
  hint,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ti2",
3
- "version": "1.0.98",
3
+ "version": "1.0.99",
4
4
  "description": "Tourist Industry Exchange (TI2)",
5
5
  "main": "index.js",
6
6
  "scripts": {