tripstorekrabi-shared 1.13.57 → 1.13.59

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/booking.js +11 -5
  2. package/package.json +1 -1
  3. package/product.js +2 -1
package/booking.js CHANGED
@@ -2,7 +2,7 @@ import dayjs from "dayjs";
2
2
  import advancedFormat from 'dayjs/plugin/advancedFormat.js';
3
3
  import utc from "dayjs/plugin/utc.js";
4
4
  import timezone from "dayjs/plugin/timezone.js";
5
- import { calculateTotalOperatorPrice } from './price.js';
5
+ import { PAY_ON_TOUR, calculateTotalOperatorPrice } from './price.js';
6
6
 
7
7
  dayjs.extend(advancedFormat);
8
8
  dayjs.extend(utc);
@@ -225,8 +225,9 @@ export function getStartingPointMessage(booking, product) {
225
225
  booking.specialRequirements.toUpperCase();
226
226
  }
227
227
 
228
- if (booking.nationalParkFee == 'Pay on tour') {
229
- text += '\n\nAs stated on the website, there is an entrance fee';
228
+ let payOnTour = [];
229
+ if (booking.nationalParkFee == PAY_ON_TOUR) {
230
+ text += 'As stated on the website, there is an entrance fee';
230
231
 
231
232
  if (product?.nationalPark) {
232
233
  text += ' to ' + product?.nationalPark.title;
@@ -242,8 +243,13 @@ export function getStartingPointMessage(booking, product) {
242
243
  ' THB per child';
243
244
  }
244
245
 
245
- text +=
246
- ' to be paid at point of entry. Please bring the required amount in cash to the trip.';
246
+ payOnTour.push(` • ${text}`);
247
+ }
248
+
249
+ let extraPayments = Object.values(booking.extraPayments).filter((item) => !item.disabled && item.paymentMethod === PAY_ON_TOUR).map((item) => ` • ${item.description}: ${item.price} THB`);
250
+ payOnTour = [...payOnTour, ...extraPayments];
251
+ if (payOnTour.length > 0) {
252
+ text += '\n\nTO BE PAID ON TOUR:\n' + payOnTour.join("\n");
247
253
  }
248
254
 
249
255
  return text;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tripstorekrabi-shared",
3
- "version": "1.13.57",
3
+ "version": "1.13.59",
4
4
  "description": "Shared library for Trip Store Krabi",
5
5
  "author": "Stefan Sommer <tonprince@gmail.com>",
6
6
  "repository": {
package/product.js CHANGED
@@ -14,7 +14,8 @@ export function buildIndex(id, product) {
14
14
  url: product.url,
15
15
  price: calculateProductSellingPrice({ adults: countMinPeople(product.pricing), children: 0, infants: 0 }, product.pricing) / countMinPeople(product.pricing),
16
16
  priceType: product.pricing.type,
17
- availability: product.availability
17
+ availability: product.availability,
18
+ live: product.live
18
19
  };
19
20
 
20
21
  if (product.shortName) {