@vibe-flats/booking-engine-common-server 1.0.84 → 1.0.90

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.
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.guestyPrice = void 0;
4
4
  const app_1 = require("../config/app");
5
5
  const guestyPrice = (obj) => {
6
- var _a;
7
6
  //
8
7
  const { unit, stay, excludeCleaning } = obj;
9
8
  const nights = stay.length;
@@ -11,7 +10,7 @@ const guestyPrice = (obj) => {
11
10
  // Apply multiplier: Guesty's approach to monthly pricing
12
11
  const rent = +(stay.reduce((acc, stay) => acc + stay.price, 0) * multiplier).toFixed(0);
13
12
  const cleaning = excludeCleaning ? 0 : unit.prices.cleaningFee;
14
- const utilities = (((_a = unit.fees.find(fee => fee.name.trim() === app_1.COMMON_SERVER.guesty.invoiceItems.utilities)) === null || _a === void 0 ? void 0 : _a.value) || 0) * nights;
13
+ const utilities = unit.prices.utilities * nights;
15
14
  const total = rent + utilities + cleaning;
16
15
  const discount = nights >= app_1.COMMON_SERVER.priceFactor.monthly && unit.prices.monthlyPriceFactor !== 1
17
16
  ? total * (1 - unit.prices.monthlyPriceFactor)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibe-flats/booking-engine-common-server",
3
- "version": "1.0.84",
3
+ "version": "1.0.90",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",