@vibe-flats/booking-engine-common-server 1.0.149 → 1.0.150

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.
@@ -6,6 +6,12 @@ import { MarketDocument } from './markets';
6
6
  import { GuestDocument } from './guests';
7
7
  export type UnitReviewCategory = 'cleanliness' | 'communication' | 'checkin' | 'accuracy' | 'location' | 'value' | 'service';
8
8
  export type UnitReviewPlatform = 'direct' | 'airbnb' | 'vrbo' | 'booking' | 'expedia';
9
+ export declare const UNIT_TYPES: {
10
+ readonly SINGLE: "single";
11
+ readonly MULTI_PARENT: "multi-listing-parent";
12
+ readonly MULTI_CHILD: "multi-listing-child";
13
+ };
14
+ export type UnitType = (typeof UNIT_TYPES)[keyof typeof UNIT_TYPES];
9
15
  export interface UnitDocument extends mongoose.Document {
10
16
  name: string;
11
17
  code: number;
@@ -110,6 +116,8 @@ export interface UnitDocument extends mongoose.Document {
110
116
  salesBlockWarning: string;
111
117
  hasOpenExtensionLink: boolean;
112
118
  lengthOfStayType: 'monthly' | 'hybrid' | 'nightly';
119
+ type: UnitType;
120
+ parent?: UnitDocument;
113
121
  guesty?: {
114
122
  sync?: {
115
123
  name?: string;
@@ -23,8 +23,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.UnitModel = void 0;
26
+ exports.UnitModel = exports.UNIT_TYPES = void 0;
27
27
  const mongoose_1 = __importStar(require("mongoose"));
28
+ exports.UNIT_TYPES = {
29
+ SINGLE: 'single',
30
+ MULTI_PARENT: 'multi-listing-parent',
31
+ MULTI_CHILD: 'multi-listing-child'
32
+ };
28
33
  const schema = new mongoose_1.default.Schema({
29
34
  name: { type: String, required: true },
30
35
  code: { type: Number, required: true },
@@ -160,6 +165,8 @@ const schema = new mongoose_1.default.Schema({
160
165
  salesBlockWarning: { type: String, required: false },
161
166
  hasOpenExtensionLink: { type: Boolean, required: false },
162
167
  lengthOfStayType: { type: String, required: false },
168
+ type: { type: String, enum: Object.values(exports.UNIT_TYPES), required: true, default: exports.UNIT_TYPES.SINGLE },
169
+ parent: { type: mongoose_1.Schema.Types.ObjectId, ref: 'Unit', required: false },
163
170
  guesty: {
164
171
  type: new mongoose_1.default.Schema({
165
172
  sync: {
@@ -183,6 +190,7 @@ const schema = new mongoose_1.default.Schema({
183
190
  schema.index({ publicId: 1 });
184
191
  schema.index({ code: 1 });
185
192
  schema.index({ hubspotId: 1 });
193
+ schema.index({ parent: 1 });
186
194
  const UnitModel = (connection) => {
187
195
  return connection.model('Unit', schema);
188
196
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibe-flats/booking-engine-common-server",
3
- "version": "1.0.149",
3
+ "version": "1.0.150",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",