tripstorekrabi-shared 1.24.1 → 1.24.2
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.
- package/package.json +4 -4
- package/price.js +2 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tripstorekrabi-shared",
|
|
3
|
-
"version": "1.24.
|
|
3
|
+
"version": "1.24.2",
|
|
4
4
|
"description": "Shared library for Trip Store Krabi",
|
|
5
5
|
"author": "Stefan Sommer <tonprince@gmail.com>",
|
|
6
6
|
"repository": {
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"./telegram": "./telegram.js"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"dayjs": "^1.11.
|
|
21
|
-
"libphonenumber-js": "^1.
|
|
22
|
-
"nanoid": "^5.1.
|
|
20
|
+
"dayjs": "^1.11.21",
|
|
21
|
+
"libphonenumber-js": "^1.13.4",
|
|
22
|
+
"nanoid": "^5.1.11"
|
|
23
23
|
},
|
|
24
24
|
"scripts": {
|
|
25
25
|
"deploy": "npm publish"
|
package/price.js
CHANGED
|
@@ -121,11 +121,10 @@ export function calculateInflatedSellingPrice(price, config, forceInflation = fa
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
function calculateProductPrice(booking, pricing, options = { mode: SELLING_MODE }) {
|
|
124
|
-
const activeRevision = getActiveRevision(booking.date, pricing);
|
|
124
|
+
const activeRevision = getActiveRevision(booking.date, pricing) || pricing;
|
|
125
125
|
|
|
126
126
|
if (!activeRevision) {
|
|
127
|
-
|
|
128
|
-
return 0;
|
|
127
|
+
throw new Error(`Pricing fail-safe triggered: No active or standard pricing found for booking date ${booking.date}.`);
|
|
129
128
|
}
|
|
130
129
|
|
|
131
130
|
let activeVolumes = activeRevision.volumes || [];
|