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

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.
@@ -55,7 +55,6 @@ export interface UnitDocument extends mongoose.Document {
55
55
  type: string;
56
56
  value: number;
57
57
  multiplier: 'PER_NIGHT' | 'PER_STAY' | 'PER_GUEST' | 'PER_GUEST_PER_NIGHT';
58
- isOptional: boolean;
59
58
  isPercentage: boolean;
60
59
  }[];
61
60
  urls: {
@@ -83,7 +83,6 @@ const schema = new mongoose_1.default.Schema({
83
83
  type: { type: String, required: true },
84
84
  value: { type: Number, required: true },
85
85
  multiplier: { type: String, required: true },
86
- isOptional: { type: Boolean, required: true },
87
86
  isPercentage: { type: Boolean, required: true },
88
87
  _id: false
89
88
  }
@@ -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.91",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",