@vibe-flats/booking-engine-common-server 1.0.29 → 1.0.31
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.
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import mongoose from 'mongoose';
|
|
2
2
|
export interface CityDocument extends mongoose.Document {
|
|
3
3
|
name: string;
|
|
4
|
+
externalName: string;
|
|
4
5
|
publicId: string;
|
|
6
|
+
slug: string;
|
|
5
7
|
}
|
|
6
8
|
export declare const CityModel: (connection: mongoose.Connection) => mongoose.Model<CityDocument, {}, {}, {}, mongoose.Document<unknown, {}, CityDocument> & CityDocument & Required<{
|
|
7
9
|
_id: unknown;
|
|
@@ -17,9 +17,14 @@ const schema = new mongoose_1.default.Schema({
|
|
|
17
17
|
publicId: {
|
|
18
18
|
type: String,
|
|
19
19
|
required: true
|
|
20
|
+
},
|
|
21
|
+
slug: {
|
|
22
|
+
type: String,
|
|
23
|
+
required: false
|
|
20
24
|
}
|
|
21
25
|
});
|
|
22
26
|
schema.index({ publicId: 1 });
|
|
27
|
+
schema.index({ slug: 1 }, { unique: true });
|
|
23
28
|
schema.index({ externalName: 1 });
|
|
24
29
|
const CityModel = (connection) => {
|
|
25
30
|
return connection.model('City', schema);
|
|
@@ -33,7 +33,7 @@ export interface UnitDocument extends mongoose.Document {
|
|
|
33
33
|
gym: boolean;
|
|
34
34
|
parking: 'no | free | paid';
|
|
35
35
|
pool: boolean;
|
|
36
|
-
|
|
36
|
+
amenities: string[];
|
|
37
37
|
checkin: string;
|
|
38
38
|
checkout: string;
|
|
39
39
|
areaSquareFeet: number;
|
|
@@ -58,6 +58,7 @@ export interface UnitDocument extends mongoose.Document {
|
|
|
58
58
|
vrbo: string;
|
|
59
59
|
booking: string;
|
|
60
60
|
};
|
|
61
|
+
slug: string;
|
|
61
62
|
}
|
|
62
63
|
export declare const UnitModel: (connection: mongoose.Connection) => mongoose.Model<UnitDocument, {}, {}, {}, mongoose.Document<unknown, {}, UnitDocument> & UnitDocument & Required<{
|
|
63
64
|
_id: unknown;
|
|
@@ -60,7 +60,7 @@ const schema = new mongoose_1.default.Schema({
|
|
|
60
60
|
gym: { type: Boolean, required: true },
|
|
61
61
|
parking: { type: String, required: true },
|
|
62
62
|
pool: { type: Boolean, required: true },
|
|
63
|
-
|
|
63
|
+
amenities: [{ type: String, required: true }],
|
|
64
64
|
checkin: { type: String, required: true },
|
|
65
65
|
checkout: { type: String, required: true },
|
|
66
66
|
areaSquareFeet: { type: Number, required: false },
|
|
@@ -92,7 +92,8 @@ const schema = new mongoose_1.default.Schema({
|
|
|
92
92
|
}),
|
|
93
93
|
required: false,
|
|
94
94
|
_id: false
|
|
95
|
-
}
|
|
95
|
+
},
|
|
96
|
+
slug: { type: String, required: false }
|
|
96
97
|
}, {
|
|
97
98
|
timestamps: true,
|
|
98
99
|
versionKey: false,
|
|
@@ -102,6 +103,7 @@ const schema = new mongoose_1.default.Schema({
|
|
|
102
103
|
schema.index({ publicId: 1 });
|
|
103
104
|
schema.index({ code: 1 });
|
|
104
105
|
schema.index({ hubspotId: 1 });
|
|
106
|
+
schema.index({ slug: 1 }, { unique: true });
|
|
105
107
|
const UnitModel = (connection) => {
|
|
106
108
|
return connection.model('Unit', schema);
|
|
107
109
|
};
|