@vibe-flats/booking-engine-common-server 1.0.148 → 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.
|
@@ -9,7 +9,9 @@ export interface ChannelDocument extends mongoose.Document {
|
|
|
9
9
|
isExternal: boolean;
|
|
10
10
|
isActive: boolean;
|
|
11
11
|
excludeUtilities: boolean;
|
|
12
|
-
|
|
12
|
+
website: {
|
|
13
|
+
sourceOverride: string;
|
|
14
|
+
};
|
|
13
15
|
}
|
|
14
16
|
export declare const ChannelModel: (connection: mongoose.Connection) => mongoose.Model<ChannelDocument, {}, {}, {}, mongoose.Document<unknown, {}, ChannelDocument> & ChannelDocument & Required<{
|
|
15
17
|
_id: unknown;
|
|
@@ -48,9 +48,11 @@ const schema = new mongoose_1.default.Schema({
|
|
|
48
48
|
required: false,
|
|
49
49
|
default: false
|
|
50
50
|
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
website: {
|
|
52
|
+
sourceOverride: {
|
|
53
|
+
type: String,
|
|
54
|
+
required: false
|
|
55
|
+
}
|
|
54
56
|
}
|
|
55
57
|
}, {
|
|
56
58
|
timestamps: true
|
|
@@ -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
|
};
|