ti2-tourplan 1.0.61 → 1.0.62

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.
Files changed (3) hide show
  1. package/index.js +45 -45
  2. package/index.test.js +1 -1
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -597,54 +597,54 @@ class BuyerPlugin {
597
597
  }
598
598
  */
599
599
  const SCheckPass = Boolean(SCheck);
600
- const ACheckPass = (() => {
601
- /*
602
- FROM TP DOCS:
603
- Each integer in the list gives the availability for one of the days in the range requested,
604
- from the start date through to the end date. The integer values are to be interpreted as
605
- follows:
606
- Greater than 0 means that inventory is available, with the integer specifying the
607
- number of units available. For options with a service type of Y , the inventory is in
608
- units of rooms. For other service types, the inventory is in units of pax.
609
- -1 Not available.
610
- -2 Available on free sell.
611
- -3 Available on request.
612
- Note: A return value of 0 or something less than -3 is impossible.
613
- */
614
- const optAvail = parseInt(R.pathOr('-4', ['OptAvail'], ACheck), 10);
615
- if (optAvail === -1) {
616
- return {
617
- available: false,
618
- };
619
- }
620
- if (optAvail === -2) {
621
- return {
622
- available: true,
623
- type: 'free sell',
624
- };
625
- }
626
- if (optAvail === -3) {
627
- return {
628
- available: true,
629
- type: 'on request',
630
- };
631
- }
632
- if (optAvail > 0) {
633
- return {
634
- available: true,
635
- type: 'inventory',
636
- quantity: optAvail,
637
- };
638
- }
639
- return {
640
- available: false,
641
- };
642
- })();
600
+ // const ACheckPass = (() => {
601
+ // /*
602
+ // FROM TP DOCS:
603
+ // Each integer in the list gives the availability for one of the days in the range requested,
604
+ // from the start date through to the end date. The integer values are to be interpreted as
605
+ // follows:
606
+ // Greater than 0 means that inventory is available, with the integer specifying the
607
+ // number of units available. For options with a service type of Y , the inventory is in
608
+ // units of rooms. For other service types, the inventory is in units of pax.
609
+ // -1 Not available.
610
+ // -2 Available on free sell.
611
+ // -3 Available on request.
612
+ // Note: A return value of 0 or something less than -3 is impossible.
613
+ // */
614
+ // const optAvail = parseInt(R.pathOr('-4', ['OptAvail'], ACheck), 10);
615
+ // if (optAvail === -1) {
616
+ // return {
617
+ // available: false,
618
+ // };
619
+ // }
620
+ // if (optAvail === -2) {
621
+ // return {
622
+ // available: true,
623
+ // type: 'free sell',
624
+ // };
625
+ // }
626
+ // if (optAvail === -3) {
627
+ // return {
628
+ // available: true,
629
+ // type: 'on request',
630
+ // };
631
+ // }
632
+ // if (optAvail > 0) {
633
+ // return {
634
+ // available: true,
635
+ // type: 'inventory',
636
+ // quantity: optAvail,
637
+ // };
638
+ // }
639
+ // return {
640
+ // available: false,
641
+ // };
642
+ // })();
643
643
  let OptStayResults = R.pathOr([], ['OptStayResults'], SCheck);
644
644
  if (!Array.isArray(OptStayResults)) OptStayResults = [OptStayResults];
645
645
  return {
646
- bookable: Boolean(SCheckPass || ACheckPass.available),
647
- type: ACheckPass.type,
646
+ bookable: Boolean(SCheckPass),
647
+ type: 'inventory',
648
648
  rates: OptStayResults.map(rate => {
649
649
  let externalRateText = R.pathOr('', ['ExternalRateDetails', 'ExtOptionDescr'], rate);
650
650
  const extRatePlanDescr = R.pathOr('', ['ExternalRateDetails', 'ExtRatePlanDescr'], rate);
package/index.test.js CHANGED
@@ -235,7 +235,7 @@ describe('search tests', () => {
235
235
  expect(retVal.rates.length).toBeGreaterThan(0);
236
236
  expect(retVal.type).toBe('inventory');
237
237
  });
238
- it('searchAvailabilityForItinerary - bookable - on request', async () => {
238
+ it.skip('searchAvailabilityForItinerary - bookable - on request', async () => {
239
239
  axios.mockImplementation(getFixture);
240
240
  const retVal = await app.searchAvailabilityForItinerary({
241
241
  axios,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ti2-tourplan",
3
- "version": "1.0.61",
3
+ "version": "1.0.62",
4
4
  "description": "Tourplan's TI2 Plugin",
5
5
  "main": "index.js",
6
6
  "scripts": {