whitelabel-db 1.0.12 → 1.0.14

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.
package/dist/index.d.ts CHANGED
@@ -5,4 +5,5 @@ export { Country } from './models/Country';
5
5
  export { Hotel } from './models/Hotel';
6
6
  export { User } from './models/User';
7
7
  export { Project } from './models/Project';
8
- export { LiteApiClient, HotelsRequest, AvailabilityResult, FullRateAvailabilityResult, RoomType, Rate, PrebookRateRequest, PrebookRate, CheckoutRequest, Booking, } from './libs/liteapi';
8
+ export { Booking } from './models/Booking';
9
+ export { LiteApiClient, HotelsRequest, AvailabilityResult, FullRateAvailabilityResult, RoomType, Rate, PrebookRateRequest, PrebookRate, CheckoutRequest, BookingInfo, } from './libs/liteapi';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LiteApiClient = exports.Project = exports.User = exports.Hotel = exports.Country = exports.City = exports.Agency = exports.connect = void 0;
3
+ exports.LiteApiClient = exports.Booking = exports.Project = exports.User = exports.Hotel = exports.Country = exports.City = exports.Agency = exports.connect = void 0;
4
4
  var database_1 = require("./libs/database");
5
5
  Object.defineProperty(exports, "connect", { enumerable: true, get: function () { return database_1.connect; } });
6
6
  var Agency_1 = require("./models/Agency");
@@ -15,5 +15,7 @@ var User_1 = require("./models/User");
15
15
  Object.defineProperty(exports, "User", { enumerable: true, get: function () { return User_1.User; } });
16
16
  var Project_1 = require("./models/Project");
17
17
  Object.defineProperty(exports, "Project", { enumerable: true, get: function () { return Project_1.Project; } });
18
+ var Booking_1 = require("./models/Booking");
19
+ Object.defineProperty(exports, "Booking", { enumerable: true, get: function () { return Booking_1.Booking; } });
18
20
  var liteapi_1 = require("./libs/liteapi");
19
21
  Object.defineProperty(exports, "LiteApiClient", { enumerable: true, get: function () { return liteapi_1.LiteApiClient; } });
@@ -17,6 +17,7 @@ const Project_1 = require("../models/Project");
17
17
  const Hotel_1 = require("../models/Hotel");
18
18
  const City_1 = require("../models/City");
19
19
  const Country_1 = require("../models/Country");
20
+ const Booking_1 = require("../models/Booking");
20
21
  const connect = (connectionDetails) => __awaiter(void 0, void 0, void 0, function* () {
21
22
  const connection = new sequelize_typescript_1.Sequelize({
22
23
  dialect: 'postgres',
@@ -25,7 +26,7 @@ const connect = (connectionDetails) => __awaiter(void 0, void 0, void 0, functio
25
26
  password: connectionDetails.password,
26
27
  database: connectionDetails.dbname,
27
28
  logging: false,
28
- models: [User_1.User, Agency_1.Agency, Project_1.Project, Hotel_1.Hotel, City_1.City, Country_1.Country],
29
+ models: [User_1.User, Agency_1.Agency, Project_1.Project, Hotel_1.Hotel, City_1.City, Country_1.Country, Booking_1.Booking],
29
30
  });
30
31
  return connection
31
32
  .authenticate()
@@ -107,7 +107,7 @@ export interface BookedRoom {
107
107
  retailRate: RetailRate;
108
108
  };
109
109
  }
110
- export interface Booking {
110
+ export interface BookingInfo {
111
111
  bookingId: string;
112
112
  clientReference: string;
113
113
  supplierBookingId: string;
@@ -142,5 +142,5 @@ export declare class LiteApiClient {
142
142
  getHotelById(hotelId: string): Promise<AvailabilityResult>;
143
143
  getHotelsFullRate(options: HotelsRequest): Promise<FullRateAvailabilityResult[]>;
144
144
  preBookedHotelRate(options: PrebookRateRequest): Promise<PrebookRate>;
145
- bookHotelRate(options: CheckoutRequest): Promise<Booking>;
145
+ bookHotelRate(options: CheckoutRequest): Promise<BookingInfo>;
146
146
  }
@@ -0,0 +1,9 @@
1
+ import { Model } from 'sequelize-typescript';
2
+ export declare class Booking extends Model<Partial<Booking>> {
3
+ id: string;
4
+ prebookId: string;
5
+ liteApiPrebookData?: object;
6
+ liteApiBookingData?: object;
7
+ bookingInputData?: object;
8
+ projectId?: string;
9
+ }
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.Booking = void 0;
13
+ const sequelize_typescript_1 = require("sequelize-typescript");
14
+ let Booking = class Booking extends sequelize_typescript_1.Model {
15
+ };
16
+ exports.Booking = Booking;
17
+ __decorate([
18
+ (0, sequelize_typescript_1.IsUUID)(4),
19
+ sequelize_typescript_1.PrimaryKey,
20
+ (0, sequelize_typescript_1.Column)({
21
+ type: sequelize_typescript_1.DataType.UUID,
22
+ defaultValue: sequelize_typescript_1.DataType.UUIDV4,
23
+ }),
24
+ __metadata("design:type", String)
25
+ ], Booking.prototype, "id", void 0);
26
+ __decorate([
27
+ sequelize_typescript_1.Unique,
28
+ sequelize_typescript_1.Index,
29
+ (0, sequelize_typescript_1.Column)({
30
+ type: sequelize_typescript_1.DataType.STRING,
31
+ allowNull: false,
32
+ defaultValue: 0,
33
+ }),
34
+ __metadata("design:type", String)
35
+ ], Booking.prototype, "prebookId", void 0);
36
+ __decorate([
37
+ (0, sequelize_typescript_1.Column)({
38
+ type: sequelize_typescript_1.DataType.JSONB,
39
+ allowNull: false,
40
+ defaultValue: {},
41
+ }),
42
+ __metadata("design:type", Object)
43
+ ], Booking.prototype, "liteApiPrebookData", void 0);
44
+ __decorate([
45
+ (0, sequelize_typescript_1.Column)({
46
+ type: sequelize_typescript_1.DataType.JSONB,
47
+ allowNull: false,
48
+ defaultValue: {},
49
+ }),
50
+ __metadata("design:type", Object)
51
+ ], Booking.prototype, "liteApiBookingData", void 0);
52
+ __decorate([
53
+ (0, sequelize_typescript_1.Column)({
54
+ type: sequelize_typescript_1.DataType.JSONB,
55
+ allowNull: false,
56
+ defaultValue: {},
57
+ }),
58
+ __metadata("design:type", Object)
59
+ ], Booking.prototype, "bookingInputData", void 0);
60
+ __decorate([
61
+ (0, sequelize_typescript_1.Column)({
62
+ type: sequelize_typescript_1.DataType.UUID,
63
+ allowNull: false,
64
+ }),
65
+ __metadata("design:type", String)
66
+ ], Booking.prototype, "projectId", void 0);
67
+ exports.Booking = Booking = __decorate([
68
+ (0, sequelize_typescript_1.Table)({
69
+ tableName: 'booking',
70
+ })
71
+ ], Booking);
@@ -28,4 +28,43 @@ export declare class Hotel extends Model<Partial<Hotel>> {
28
28
  hotelImages: HotelImage[];
29
29
  hotelFacilities: string[];
30
30
  rate: AvailabilityResult;
31
+ phone: string;
32
+ rating: number;
33
+ facilities: {
34
+ id: number;
35
+ name: string;
36
+ }[];
37
+ policies: {
38
+ type: number;
39
+ name: string;
40
+ description: string;
41
+ }[];
42
+ rooms: {
43
+ id: number;
44
+ name: string;
45
+ description: string;
46
+ size: number;
47
+ adults: number;
48
+ children: number;
49
+ occupancy: number;
50
+ photos: {
51
+ url: string;
52
+ caption: string;
53
+ }[];
54
+ room_amenities: {
55
+ id: number;
56
+ name: string;
57
+ }[];
58
+ }[];
59
+ reviewsCount: number;
60
+ reviews: {
61
+ average_score: number;
62
+ name: string;
63
+ date: string;
64
+ headline: string;
65
+ language: string;
66
+ country: string;
67
+ pros: string;
68
+ cons: string;
69
+ }[];
31
70
  }
@@ -127,6 +127,56 @@ __decorate([
127
127
  }),
128
128
  __metadata("design:type", Array)
129
129
  ], Hotel.prototype, "hotelFacilities", void 0);
130
+ __decorate([
131
+ (0, sequelize_typescript_1.Column)({
132
+ type: sequelize_typescript_1.DataType.STRING(32),
133
+ allowNull: false,
134
+ }),
135
+ __metadata("design:type", String)
136
+ ], Hotel.prototype, "phone", void 0);
137
+ __decorate([
138
+ (0, sequelize_typescript_1.Column)({
139
+ type: sequelize_typescript_1.DataType.INTEGER,
140
+ allowNull: false,
141
+ defaultValue: 0,
142
+ }),
143
+ __metadata("design:type", Number)
144
+ ], Hotel.prototype, "rating", void 0);
145
+ __decorate([
146
+ (0, sequelize_typescript_1.Column)({
147
+ type: sequelize_typescript_1.DataType.JSONB,
148
+ allowNull: true,
149
+ }),
150
+ __metadata("design:type", Array)
151
+ ], Hotel.prototype, "facilities", void 0);
152
+ __decorate([
153
+ (0, sequelize_typescript_1.Column)({
154
+ type: sequelize_typescript_1.DataType.JSONB,
155
+ allowNull: true,
156
+ }),
157
+ __metadata("design:type", Array)
158
+ ], Hotel.prototype, "policies", void 0);
159
+ __decorate([
160
+ (0, sequelize_typescript_1.Column)({
161
+ allowNull: true,
162
+ }),
163
+ __metadata("design:type", Array)
164
+ ], Hotel.prototype, "rooms", void 0);
165
+ __decorate([
166
+ (0, sequelize_typescript_1.Column)({
167
+ type: sequelize_typescript_1.DataType.INTEGER,
168
+ allowNull: false,
169
+ defaultValue: 0,
170
+ }),
171
+ __metadata("design:type", Number)
172
+ ], Hotel.prototype, "reviewsCount", void 0);
173
+ __decorate([
174
+ (0, sequelize_typescript_1.Column)({
175
+ type: sequelize_typescript_1.DataType.JSONB,
176
+ allowNull: true,
177
+ }),
178
+ __metadata("design:type", Array)
179
+ ], Hotel.prototype, "reviews", void 0);
130
180
  exports.Hotel = Hotel = __decorate([
131
181
  (0, sequelize_typescript_1.Table)({
132
182
  tableName: 'static_hotels',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whitelabel-db",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",