@vibe-flats/booking-engine-common-server 1.0.129 → 1.0.131

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.
@@ -29,6 +29,9 @@ export declare const COMMON_SERVER: {
29
29
  };
30
30
  channels: {
31
31
  direct: string;
32
+ airbnb: string;
33
+ vrbo: string;
34
+ bookingcom: string;
32
35
  };
33
36
  stages: {
34
37
  inquiry: {
@@ -31,7 +31,10 @@ exports.COMMON_SERVER = {
31
31
  guest: 41
32
32
  },
33
33
  channels: {
34
- direct: 'Direct'
34
+ direct: 'Direct',
35
+ airbnb: 'Airbnb',
36
+ vrbo: 'Vrbo',
37
+ bookingcom: 'Booking.com'
35
38
  },
36
39
  stages: {
37
40
  inquiry: {
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibe-flats/booking-engine-common-server",
3
- "version": "1.0.129",
3
+ "version": "1.0.131",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",