@vibe-flats/booking-engine-common-server 1.0.98 → 1.0.101
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.
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
|
+
export interface GuestDocument extends mongoose.Document {
|
|
3
|
+
firstName: string;
|
|
4
|
+
lastName: string;
|
|
5
|
+
externalId: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const GuestModel: (connection: mongoose.Connection) => mongoose.Model<GuestDocument, {}, {}, {}, mongoose.Document<unknown, {}, GuestDocument> & GuestDocument & Required<{
|
|
8
|
+
_id: unknown;
|
|
9
|
+
}>, any>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.GuestModel = void 0;
|
|
7
|
+
const mongoose_1 = __importDefault(require("mongoose"));
|
|
8
|
+
const schema = new mongoose_1.default.Schema({
|
|
9
|
+
firstName: { type: String, required: true },
|
|
10
|
+
lastName: { type: String, required: true },
|
|
11
|
+
externalId: { type: String, required: true }
|
|
12
|
+
}, {
|
|
13
|
+
timestamps: true,
|
|
14
|
+
versionKey: false
|
|
15
|
+
});
|
|
16
|
+
const GuestModel = (connection) => {
|
|
17
|
+
return connection.model('Guest', schema);
|
|
18
|
+
};
|
|
19
|
+
exports.GuestModel = GuestModel;
|
|
@@ -3,6 +3,7 @@ import { AreaDocument } from './areas';
|
|
|
3
3
|
import { BuildingDocument } from './building';
|
|
4
4
|
import { CityDocument } from './cities';
|
|
5
5
|
import { MarketDocument } from './markets';
|
|
6
|
+
import { GuestDocument } from './guests';
|
|
6
7
|
export type UnitReviewCategory = 'cleanliness' | 'communication' | 'checkin' | 'accuracy' | 'location' | 'value' | 'service';
|
|
7
8
|
export type UnitReviewPlatform = 'direct' | 'airbnb' | 'vrbo' | 'booking';
|
|
8
9
|
export interface UnitDocument extends mongoose.Document {
|
|
@@ -89,15 +90,13 @@ export interface UnitDocument extends mongoose.Document {
|
|
|
89
90
|
reservationId: string;
|
|
90
91
|
externalId: string;
|
|
91
92
|
platform: UnitReviewPlatform;
|
|
92
|
-
guest:
|
|
93
|
-
firstName: string;
|
|
94
|
-
lastName: string;
|
|
95
|
-
};
|
|
93
|
+
guest: GuestDocument;
|
|
96
94
|
categories: {
|
|
97
95
|
name: UnitReviewCategory;
|
|
98
96
|
rating: number;
|
|
99
97
|
}[];
|
|
100
98
|
}[];
|
|
99
|
+
salesBlockWarning: string;
|
|
101
100
|
}
|
|
102
101
|
export declare const UnitModel: (connection: mongoose.Connection) => mongoose.Model<UnitDocument, {}, {}, {}, mongoose.Document<unknown, {}, UnitDocument> & UnitDocument & Required<{
|
|
103
102
|
_id: unknown;
|
|
@@ -129,14 +129,7 @@ const schema = new mongoose_1.default.Schema({
|
|
|
129
129
|
reservationId: { type: String, required: true },
|
|
130
130
|
externalId: { type: String, required: true },
|
|
131
131
|
platform: { type: String, required: true },
|
|
132
|
-
guest: {
|
|
133
|
-
type: new mongoose_1.default.Schema({
|
|
134
|
-
firstName: { type: String, required: true },
|
|
135
|
-
lastName: { type: String, required: true }
|
|
136
|
-
}),
|
|
137
|
-
required: true,
|
|
138
|
-
_id: false
|
|
139
|
-
},
|
|
132
|
+
guest: { type: mongoose_1.Schema.Types.ObjectId, ref: 'Guest', required: true },
|
|
140
133
|
categories: {
|
|
141
134
|
type: [
|
|
142
135
|
{
|
|
@@ -151,7 +144,8 @@ const schema = new mongoose_1.default.Schema({
|
|
|
151
144
|
],
|
|
152
145
|
required: false,
|
|
153
146
|
_id: false
|
|
154
|
-
}
|
|
147
|
+
},
|
|
148
|
+
salesBlockWarning: { type: String, required: false }
|
|
155
149
|
}, {
|
|
156
150
|
timestamps: true,
|
|
157
151
|
versionKey: false,
|
|
@@ -18,4 +18,7 @@ export declare const unitsModels: (connection: mongoose.Connection) => {
|
|
|
18
18
|
AreaModel: mongoose.Model<import("./models/areas").AreaDocument, {}, {}, {}, mongoose.Document<unknown, {}, import("./models/areas").AreaDocument> & import("./models/areas").AreaDocument & Required<{
|
|
19
19
|
_id: unknown;
|
|
20
20
|
}>, any>;
|
|
21
|
+
GuestModel: mongoose.Model<import("./models/guests").GuestDocument, {}, {}, {}, mongoose.Document<unknown, {}, import("./models/guests").GuestDocument> & import("./models/guests").GuestDocument & Required<{
|
|
22
|
+
_id: unknown;
|
|
23
|
+
}>, any>;
|
|
21
24
|
};
|
|
@@ -7,12 +7,14 @@ const availability_1 = require("./models/availability");
|
|
|
7
7
|
const building_1 = require("./models/building");
|
|
8
8
|
const areas_1 = require("./models/areas");
|
|
9
9
|
const markets_1 = require("./models/markets");
|
|
10
|
+
const guests_1 = require("./models/guests");
|
|
10
11
|
const unitsModels = (connection) => ({
|
|
11
12
|
MarketModel: (0, markets_1.MarketModel)(connection),
|
|
12
13
|
CityModel: (0, cities_1.CityModel)(connection),
|
|
13
14
|
UnitModel: (0, units_1.UnitModel)(connection),
|
|
14
15
|
AvailabilityModel: (0, availability_1.AvailabilityModel)(connection),
|
|
15
16
|
BuildingModel: (0, building_1.BuildingModel)(connection),
|
|
16
|
-
AreaModel: (0, areas_1.AreaModel)(connection)
|
|
17
|
+
AreaModel: (0, areas_1.AreaModel)(connection),
|
|
18
|
+
GuestModel: (0, guests_1.GuestModel)(connection)
|
|
17
19
|
});
|
|
18
20
|
exports.unitsModels = unitsModels;
|