@vibe-flats/booking-engine-common-server 1.0.129 → 1.0.130
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,14 @@
|
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
|
+
export interface ChannelDocument extends mongoose.Document {
|
|
3
|
+
name: string;
|
|
4
|
+
publicId: string;
|
|
5
|
+
guestyId: string;
|
|
6
|
+
markup: number;
|
|
7
|
+
color: string;
|
|
8
|
+
isDefault: boolean;
|
|
9
|
+
isExternal: boolean;
|
|
10
|
+
isActive: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const ChannelModel: (connection: mongoose.Connection) => mongoose.Model<ChannelDocument, {}, {}, {}, mongoose.Document<unknown, {}, ChannelDocument> & ChannelDocument & Required<{
|
|
13
|
+
_id: unknown;
|
|
14
|
+
}>, any>;
|
|
@@ -0,0 +1,53 @@
|
|
|
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.ChannelModel = void 0;
|
|
7
|
+
const mongoose_1 = __importDefault(require("mongoose"));
|
|
8
|
+
const schema = new mongoose_1.default.Schema({
|
|
9
|
+
name: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: true
|
|
12
|
+
},
|
|
13
|
+
publicId: {
|
|
14
|
+
// Should correlate to the unit urls key
|
|
15
|
+
type: String,
|
|
16
|
+
required: true
|
|
17
|
+
},
|
|
18
|
+
guestyId: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: true
|
|
21
|
+
},
|
|
22
|
+
markup: {
|
|
23
|
+
type: Number,
|
|
24
|
+
required: true,
|
|
25
|
+
default: 0
|
|
26
|
+
},
|
|
27
|
+
color: {
|
|
28
|
+
type: String,
|
|
29
|
+
required: true
|
|
30
|
+
},
|
|
31
|
+
isDefault: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
required: true,
|
|
34
|
+
default: false
|
|
35
|
+
},
|
|
36
|
+
isExternal: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
required: true,
|
|
39
|
+
default: true
|
|
40
|
+
},
|
|
41
|
+
isActive: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
required: true,
|
|
44
|
+
default: true
|
|
45
|
+
}
|
|
46
|
+
}, {
|
|
47
|
+
timestamps: true
|
|
48
|
+
});
|
|
49
|
+
// export const ChannelModel = mongoose.model<ChannelDocument>('Channel', schema);
|
|
50
|
+
const ChannelModel = (connection) => {
|
|
51
|
+
return connection.model('Channel', schema);
|
|
52
|
+
};
|
|
53
|
+
exports.ChannelModel = ChannelModel;
|
|
@@ -24,4 +24,7 @@ export declare const unitsModels: (connection: mongoose.Connection) => {
|
|
|
24
24
|
GuestModel: mongoose.Model<import("./models/guests").GuestDocument, {}, {}, {}, mongoose.Document<unknown, {}, import("./models/guests").GuestDocument> & import("./models/guests").GuestDocument & Required<{
|
|
25
25
|
_id: unknown;
|
|
26
26
|
}>, any>;
|
|
27
|
+
ChannelModel: mongoose.Model<import("./models/channels").ChannelDocument, {}, {}, {}, mongoose.Document<unknown, {}, import("./models/channels").ChannelDocument> & import("./models/channels").ChannelDocument & Required<{
|
|
28
|
+
_id: unknown;
|
|
29
|
+
}>, any>;
|
|
27
30
|
};
|
|
@@ -9,6 +9,7 @@ const areas_1 = require("./models/areas");
|
|
|
9
9
|
const markets_1 = require("./models/markets");
|
|
10
10
|
const guests_1 = require("./models/guests");
|
|
11
11
|
const units_distances_1 = require("./models/units-distances");
|
|
12
|
+
const channels_1 = require("./models/channels");
|
|
12
13
|
const unitsModels = (connection) => ({
|
|
13
14
|
MarketModel: (0, markets_1.MarketModel)(connection),
|
|
14
15
|
CityModel: (0, cities_1.CityModel)(connection),
|
|
@@ -17,6 +18,7 @@ const unitsModels = (connection) => ({
|
|
|
17
18
|
AvailabilityModel: (0, availability_1.AvailabilityModel)(connection),
|
|
18
19
|
BuildingModel: (0, building_1.BuildingModel)(connection),
|
|
19
20
|
AreaModel: (0, areas_1.AreaModel)(connection),
|
|
20
|
-
GuestModel: (0, guests_1.GuestModel)(connection)
|
|
21
|
+
GuestModel: (0, guests_1.GuestModel)(connection),
|
|
22
|
+
ChannelModel: (0, channels_1.ChannelModel)(connection)
|
|
21
23
|
});
|
|
22
24
|
exports.unitsModels = unitsModels;
|