tripstorekrabi-shared 1.22.6 → 1.22.8

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/availability.js CHANGED
@@ -34,7 +34,7 @@ export function isAvailable(availability, date, schedule, options = {}) {
34
34
  return false;
35
35
  }
36
36
 
37
- if (available && options.gygApi === true && (!availability.gyg?.connectedToApi || !availability.gyg?.available)) {
37
+ if (available && options.gygApi === true && (availability.gygConnections ?? []).length === 0) {
38
38
  return false;
39
39
  }
40
40
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tripstorekrabi-shared",
3
- "version": "1.22.6",
3
+ "version": "1.22.8",
4
4
  "description": "Shared library for Trip Store Krabi",
5
5
  "author": "Stefan Sommer <tonprince@gmail.com>",
6
6
  "repository": {
package/price.js CHANGED
@@ -47,14 +47,17 @@ function calculateSellingPrice(commissionRate = 0, price) {
47
47
  );
48
48
  }
49
49
 
50
- export function calculateInflatedSellingPrice(price, config) {
51
- if (!config || !config.inflatedPrices) {
50
+ export function calculateInflatedSellingPrice(price, config, forceInflation = false) {
51
+ if (!config || (!config.inflatedPrices && !forceInflation)) {
52
52
  return price;
53
53
  }
54
54
 
55
55
  const discountRate = Number(config.discount) || 0;
56
56
 
57
- if (!isFinite(discountRate)) return price;
57
+ if (discountRate === 0 || !isFinite(discountRate)) {
58
+ return price;
59
+ }
60
+
58
61
  const denominator = 100 - discountRate;
59
62
 
60
63
  if (denominator <= 0) {