tripstorekrabi-shared 1.17.2 → 1.17.3

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 (2) hide show
  1. package/package.json +1 -1
  2. package/price.js +14 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tripstorekrabi-shared",
3
- "version": "1.17.2",
3
+ "version": "1.17.3",
4
4
  "description": "Shared library for Trip Store Krabi",
5
5
  "author": "Stefan Sommer <tonprince@gmail.com>",
6
6
  "repository": {
package/price.js CHANGED
@@ -1,4 +1,4 @@
1
- import { getBookingType } from "./utils.js";
1
+ import { CUSTOM_MEETING_POINT, TELL_HOTEL_LATER_STARTING_POINT, getBookingType } from "./utils.js";
2
2
 
3
3
  export const MAX_PAX = 100;
4
4
  export const PAY_ON_TOUR = 'Pay on tour';
@@ -18,11 +18,6 @@ export const EXTRA_PAYMENT_CATEGORIES = [STARTING_POINT_EXTRA_PAYMENT,
18
18
  ADD_ON_EXTRA_PAYMENT,
19
19
  PRODUCT_CHANGE_EXTRA_PAYMENT,
20
20
  OTHER_EXTRA_PAYMENT];
21
- export const CUSTOM_MEETING_POINT = {
22
- id: 0,
23
- name: 'Custom meeting point',
24
- value: '',
25
- };
26
21
 
27
22
  const SELLING_MODE = 0;
28
23
  const PARTNER_MODE = 1;
@@ -386,7 +381,19 @@ function calculateStartEndPointPrice(people, startEndPoint, options = { mode: SE
386
381
  }
387
382
 
388
383
  export function findStartingPoint(product, startingPointId, useDefault = true) {
389
- return [...product.startingPoints, CUSTOM_MEETING_POINT].find((item) => item.id === startingPointId) ?? (useDefault ? product.startingPoints[0] : null);
384
+ return [
385
+ ...product.startingPoints,
386
+ {
387
+ id: TELL_HOTEL_LATER_STARTING_POINT.id,
388
+ name: TELL_HOTEL_LATER_STARTING_POINT.description,
389
+ value: '',
390
+ },
391
+ {
392
+ id: CUSTOM_MEETING_POINT.id,
393
+ name: CUSTOM_MEETING_POINT.description,
394
+ value: '',
395
+ },
396
+ ].find((item) => item.id === startingPointId) ?? (useDefault ? product.startingPoints[0] : null);
390
397
  }
391
398
 
392
399
  export function findEndPoint(product, endPointId, useDefault = true) {