whitelabel-db 1.1.46 → 1.1.48
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 +0 -1
- package/dist/index.js +1 -3
- package/dist/libs/database.js +0 -2
- package/dist/libs/liteapiv3.d.ts +10 -0
- package/dist/libs/liteapiv3.js +23 -0
- package/dist/migrations/001-add-guest-voucherCount.d.ts +3 -0
- package/dist/migrations/001-add-guest-voucherCount.js +47 -0
- package/dist/migrations/002-add-table-user1.d.ts +3 -0
- package/dist/migrations/002-add-table-user1.js +58 -0
- package/dist/models/Feedback.js +3 -3
- package/dist/models/UserRole.d.ts +6 -0
- package/dist/models/{Search.js → UserRole.js} +19 -34
- package/dist/models/Voucher.d.ts +23 -0
- package/dist/models/Voucher.js +162 -0
- package/package.json +1 -1
- package/dist/models/HotelRate.d.ts +0 -9
- package/dist/models/HotelRate.js +0 -66
- package/dist/models/Search.d.ts +0 -8
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,6 @@ export { Guest } from './models/Guest';
|
|
|
13
13
|
export { HotelAccessibility } from './models/HotelAccessibility';
|
|
14
14
|
export { Referral } from './models/Referral';
|
|
15
15
|
export { Feedback } from './models/Feedback';
|
|
16
|
-
export { HotelRate } from './models/HotelRate';
|
|
17
16
|
export { LiteApiClient, HotelsRequest, AvailabilityResult, FullRateAvailabilityResult, RoomType, Rate, PrebookRateRequest, PrebookRate, CheckoutRequest, BookingInfo, CancelBooking, } from './libs/liteapi';
|
|
18
17
|
export { LiteApiClientV3, HotelsRequestV3, AvailabilityResultV3, FullRateAvailabilityResultV3, RoomTypeV3, RateV3, PrebookRateRequestV3, PrebookRateV3, CheckoutRequestV3, BookingInfoV3, CancelBookingV3, BookedRoomV3, OccupancyV3, GuestV3, GuestBookingV3, VoucherRequest, VoucherResponse, EsimplyPackage, Addon, AddonResponse, } from './libs/liteapiv3';
|
|
19
18
|
export { LiteApiUser, LiteApiUserRequest } from './libs/liteapiuser';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LiteApiUser = exports.LiteApiClientV3 = exports.LiteApiClient = exports.
|
|
3
|
+
exports.LiteApiUser = exports.LiteApiClientV3 = exports.LiteApiClient = exports.Feedback = exports.Referral = exports.HotelAccessibility = exports.Guest = exports.HotelTranslation = exports.Role = exports.Booking = exports.Project = exports.User = exports.Hotel = exports.Country = exports.City = exports.Agency = exports.runMigrations = 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 migration_1 = require("./libs/migration");
|
|
@@ -31,8 +31,6 @@ var Referral_1 = require("./models/Referral");
|
|
|
31
31
|
Object.defineProperty(exports, "Referral", { enumerable: true, get: function () { return Referral_1.Referral; } });
|
|
32
32
|
var Feedback_1 = require("./models/Feedback");
|
|
33
33
|
Object.defineProperty(exports, "Feedback", { enumerable: true, get: function () { return Feedback_1.Feedback; } });
|
|
34
|
-
var HotelRate_1 = require("./models/HotelRate");
|
|
35
|
-
Object.defineProperty(exports, "HotelRate", { enumerable: true, get: function () { return HotelRate_1.HotelRate; } });
|
|
36
34
|
var liteapi_1 = require("./libs/liteapi");
|
|
37
35
|
Object.defineProperty(exports, "LiteApiClient", { enumerable: true, get: function () { return liteapi_1.LiteApiClient; } });
|
|
38
36
|
var liteapiv3_1 = require("./libs/liteapiv3");
|
package/dist/libs/database.js
CHANGED
|
@@ -24,7 +24,6 @@ const Guest_1 = require("../models/Guest");
|
|
|
24
24
|
const HotelAccessibility_1 = require("../models/HotelAccessibility");
|
|
25
25
|
const Referral_1 = require("../models/Referral");
|
|
26
26
|
const Feedback_1 = require("../models/Feedback");
|
|
27
|
-
const HotelRate_1 = require("../models/HotelRate");
|
|
28
27
|
const connect = (connectionDetails) => __awaiter(void 0, void 0, void 0, function* () {
|
|
29
28
|
const connection = new sequelize_typescript_1.Sequelize({
|
|
30
29
|
dialect: 'postgres',
|
|
@@ -47,7 +46,6 @@ const connect = (connectionDetails) => __awaiter(void 0, void 0, void 0, functio
|
|
|
47
46
|
HotelAccessibility_1.HotelAccessibility,
|
|
48
47
|
Referral_1.Referral,
|
|
49
48
|
Feedback_1.Feedback,
|
|
50
|
-
HotelRate_1.HotelRate,
|
|
51
49
|
],
|
|
52
50
|
});
|
|
53
51
|
return connection
|
package/dist/libs/liteapiv3.d.ts
CHANGED
|
@@ -323,6 +323,7 @@ export interface VoucherResponse {
|
|
|
323
323
|
deleted_at: string | null;
|
|
324
324
|
user_id: number;
|
|
325
325
|
terms_and_conditions: string | null;
|
|
326
|
+
category?: string;
|
|
326
327
|
}
|
|
327
328
|
export interface VoucherRequest {
|
|
328
329
|
voucher_code: string;
|
|
@@ -371,4 +372,13 @@ export declare class LiteApiClientV3 {
|
|
|
371
372
|
getEsimplyPackages(options: {
|
|
372
373
|
countryCode: string;
|
|
373
374
|
}): Promise<EsimplyPackage[]>;
|
|
375
|
+
getGuestPoints(guestId: number): Promise<{
|
|
376
|
+
currentPoints: number;
|
|
377
|
+
upcomingPoints: number;
|
|
378
|
+
}>;
|
|
379
|
+
redeemGuestPoints(data: {
|
|
380
|
+
points: number;
|
|
381
|
+
currency: string;
|
|
382
|
+
guestId: number;
|
|
383
|
+
}): Promise<VoucherResponse>;
|
|
374
384
|
}
|
package/dist/libs/liteapiv3.js
CHANGED
|
@@ -174,5 +174,28 @@ class LiteApiClientV3 {
|
|
|
174
174
|
})).data.data;
|
|
175
175
|
});
|
|
176
176
|
}
|
|
177
|
+
getGuestPoints(guestId) {
|
|
178
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
179
|
+
return (yield (0, axios_1.default)({
|
|
180
|
+
url: `${this.baseUrl}/v3.0/guests/${guestId}/loyalty-points`,
|
|
181
|
+
headers: {
|
|
182
|
+
'X-API-Key': this.apiKey,
|
|
183
|
+
},
|
|
184
|
+
})).data.data;
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
redeemGuestPoints(data) {
|
|
188
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
189
|
+
return (yield (0, axios_1.default)({
|
|
190
|
+
method: 'post',
|
|
191
|
+
url: `${this.baseUrl}/v3.0/guests/${data.guestId}/loyalty-points/redeem`,
|
|
192
|
+
data,
|
|
193
|
+
headers: {
|
|
194
|
+
'X-API-Key': this.apiKey,
|
|
195
|
+
'content-type': 'application/json',
|
|
196
|
+
},
|
|
197
|
+
})).data.data;
|
|
198
|
+
});
|
|
199
|
+
}
|
|
177
200
|
}
|
|
178
201
|
exports.LiteApiClientV3 = LiteApiClientV3;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.down = exports.up = void 0;
|
|
13
|
+
const sequelize_1 = require("sequelize");
|
|
14
|
+
const up = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
+
try {
|
|
16
|
+
yield queryInterface.addColumn('guests', 'voucherCount', {
|
|
17
|
+
type: sequelize_1.DataTypes.INTEGER,
|
|
18
|
+
allowNull: true,
|
|
19
|
+
defaultValue: 0,
|
|
20
|
+
});
|
|
21
|
+
console.log('Column voucherCount added successfully.');
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
if (error.message.includes('already exists')) {
|
|
25
|
+
console.log('Column voucherCount already exists, skipping.');
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
throw error; // Re-throw other errors
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
exports.up = up;
|
|
33
|
+
const down = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
|
|
34
|
+
try {
|
|
35
|
+
yield queryInterface.removeColumn('guests', 'voucherCount');
|
|
36
|
+
console.log('Column voucherCount removed successfully.');
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
if (error.message.includes('does not exist')) {
|
|
40
|
+
console.log('Column voucherCount does not exist, skipping.');
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
throw error; // Re-throw other errors
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
exports.down = down;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.down = exports.up = void 0;
|
|
13
|
+
const sequelize_1 = require("sequelize");
|
|
14
|
+
const up = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
+
try {
|
|
16
|
+
// create table user 1 with name and email column
|
|
17
|
+
yield queryInterface.createTable('user1', {
|
|
18
|
+
id: {
|
|
19
|
+
type: sequelize_1.DataTypes.UUID,
|
|
20
|
+
primaryKey: true,
|
|
21
|
+
defaultValue: sequelize_1.DataTypes.UUIDV4,
|
|
22
|
+
},
|
|
23
|
+
name: {
|
|
24
|
+
type: sequelize_1.DataTypes.STRING,
|
|
25
|
+
allowNull: false,
|
|
26
|
+
},
|
|
27
|
+
email: {
|
|
28
|
+
type: sequelize_1.DataTypes.STRING,
|
|
29
|
+
allowNull: false,
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
console.log('Table user1 created successfully.');
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
if (error.message.includes('already exists')) {
|
|
36
|
+
console.log('Table user1 already exists, skipping.');
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
throw error; // Re-throw other errors
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
exports.up = up;
|
|
44
|
+
const down = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
|
|
45
|
+
try {
|
|
46
|
+
yield queryInterface.dropTable('user1');
|
|
47
|
+
console.log('Table user1 dropped successfully.');
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
if (error.message.includes('does not exist')) {
|
|
51
|
+
console.log('Table user1 does not exist, skipping.');
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
throw error; // Re-throw other errors
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
exports.down = down;
|
package/dist/models/Feedback.js
CHANGED
|
@@ -44,21 +44,21 @@ __decorate([
|
|
|
44
44
|
__decorate([
|
|
45
45
|
(0, sequelize_typescript_1.Column)({
|
|
46
46
|
type: sequelize_typescript_1.DataType.TEXT,
|
|
47
|
-
allowNull:
|
|
47
|
+
allowNull: true,
|
|
48
48
|
}),
|
|
49
49
|
__metadata("design:type", String)
|
|
50
50
|
], Feedback.prototype, "description", void 0);
|
|
51
51
|
__decorate([
|
|
52
52
|
(0, sequelize_typescript_1.Column)({
|
|
53
53
|
type: sequelize_typescript_1.DataType.TEXT,
|
|
54
|
-
allowNull:
|
|
54
|
+
allowNull: true,
|
|
55
55
|
}),
|
|
56
56
|
__metadata("design:type", String)
|
|
57
57
|
], Feedback.prototype, "summary", void 0);
|
|
58
58
|
__decorate([
|
|
59
59
|
(0, sequelize_typescript_1.Column)({
|
|
60
60
|
type: sequelize_typescript_1.DataType.TEXT,
|
|
61
|
-
allowNull:
|
|
61
|
+
allowNull: true,
|
|
62
62
|
}),
|
|
63
63
|
__metadata("design:type", String)
|
|
64
64
|
], Feedback.prototype, "imageIssue", void 0);
|
|
@@ -9,53 +9,38 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.UserRole = void 0;
|
|
13
|
+
const sequelize_1 = require("sequelize");
|
|
13
14
|
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
14
|
-
let
|
|
15
|
+
let UserRole = class UserRole extends sequelize_typescript_1.Model {
|
|
15
16
|
};
|
|
16
|
-
exports.
|
|
17
|
+
exports.UserRole = UserRole;
|
|
17
18
|
__decorate([
|
|
18
19
|
sequelize_typescript_1.PrimaryKey,
|
|
19
|
-
sequelize_typescript_1.Index,
|
|
20
20
|
(0, sequelize_typescript_1.Column)({
|
|
21
|
-
type:
|
|
22
|
-
}),
|
|
23
|
-
__metadata("design:type", String)
|
|
24
|
-
], Search.prototype, "id", void 0);
|
|
25
|
-
__decorate([
|
|
26
|
-
(0, sequelize_typescript_1.Column)({
|
|
27
|
-
type: sequelize_typescript_1.DataType.INTEGER,
|
|
21
|
+
type: sequelize_1.NUMBER,
|
|
28
22
|
allowNull: false,
|
|
29
|
-
|
|
23
|
+
autoIncrement: true,
|
|
30
24
|
}),
|
|
31
|
-
__metadata("design:type",
|
|
32
|
-
],
|
|
33
|
-
__decorate([
|
|
34
|
-
sequelize_typescript_1.Unique,
|
|
35
|
-
sequelize_typescript_1.Index,
|
|
36
|
-
(0, sequelize_typescript_1.Column)({
|
|
37
|
-
type: sequelize_typescript_1.DataType.DATE,
|
|
38
|
-
}),
|
|
39
|
-
__metadata("design:type", Date)
|
|
40
|
-
], Search.prototype, "cacheUpdatedAt", void 0);
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], UserRole.prototype, "id", void 0);
|
|
41
27
|
__decorate([
|
|
42
28
|
sequelize_typescript_1.Unique,
|
|
43
|
-
sequelize_typescript_1.Index,
|
|
44
29
|
(0, sequelize_typescript_1.Column)({
|
|
45
|
-
type: sequelize_typescript_1.DataType.
|
|
30
|
+
type: sequelize_typescript_1.DataType.STRING,
|
|
31
|
+
allowNull: false,
|
|
46
32
|
}),
|
|
47
|
-
__metadata("design:type",
|
|
48
|
-
],
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], UserRole.prototype, "name", void 0);
|
|
49
35
|
__decorate([
|
|
50
36
|
(0, sequelize_typescript_1.Column)({
|
|
51
|
-
type: sequelize_typescript_1.DataType.
|
|
52
|
-
allowNull:
|
|
53
|
-
defaultValue: {},
|
|
37
|
+
type: sequelize_typescript_1.DataType.STRING,
|
|
38
|
+
allowNull: true,
|
|
54
39
|
}),
|
|
55
|
-
__metadata("design:type",
|
|
56
|
-
],
|
|
57
|
-
exports.
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], UserRole.prototype, "description", void 0);
|
|
42
|
+
exports.UserRole = UserRole = __decorate([
|
|
58
43
|
(0, sequelize_typescript_1.Table)({
|
|
59
|
-
tableName: '
|
|
44
|
+
tableName: 'user_roles',
|
|
60
45
|
})
|
|
61
|
-
],
|
|
46
|
+
], UserRole);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Model } from 'sequelize-typescript';
|
|
2
|
+
import { Guest } from './Guest';
|
|
3
|
+
export declare class Voucher extends Model<Partial<Voucher>> {
|
|
4
|
+
id: string;
|
|
5
|
+
guestId: string;
|
|
6
|
+
status: string;
|
|
7
|
+
guest?: Guest;
|
|
8
|
+
createdAt: Date;
|
|
9
|
+
updatedAt: Date;
|
|
10
|
+
liteApiUserId: number;
|
|
11
|
+
currency: string;
|
|
12
|
+
usagesLimit: number;
|
|
13
|
+
remainingUses: number;
|
|
14
|
+
validityStart: Date;
|
|
15
|
+
validityEnd: Date;
|
|
16
|
+
voucherCode: string;
|
|
17
|
+
discountType: string;
|
|
18
|
+
discountValue: number;
|
|
19
|
+
maximumDiscountAmount: number;
|
|
20
|
+
termsAndConditions: string;
|
|
21
|
+
voucherType: string;
|
|
22
|
+
minimumSpend: number;
|
|
23
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
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.Voucher = void 0;
|
|
13
|
+
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
14
|
+
const Guest_1 = require("./Guest");
|
|
15
|
+
let Voucher = class Voucher extends sequelize_typescript_1.Model {
|
|
16
|
+
};
|
|
17
|
+
exports.Voucher = Voucher;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, sequelize_typescript_1.IsUUID)(4),
|
|
20
|
+
sequelize_typescript_1.PrimaryKey,
|
|
21
|
+
(0, sequelize_typescript_1.Column)({
|
|
22
|
+
type: sequelize_typescript_1.DataType.UUID,
|
|
23
|
+
defaultValue: sequelize_typescript_1.DataType.UUIDV4,
|
|
24
|
+
}),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], Voucher.prototype, "id", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, sequelize_typescript_1.ForeignKey)(() => Guest_1.Guest),
|
|
29
|
+
sequelize_typescript_1.Index,
|
|
30
|
+
(0, sequelize_typescript_1.Column)({
|
|
31
|
+
type: sequelize_typescript_1.DataType.UUID,
|
|
32
|
+
allowNull: false,
|
|
33
|
+
}),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], Voucher.prototype, "guestId", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, sequelize_typescript_1.Column)({
|
|
38
|
+
type: sequelize_typescript_1.DataType.STRING,
|
|
39
|
+
allowNull: false,
|
|
40
|
+
}),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], Voucher.prototype, "status", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, sequelize_typescript_1.BelongsTo)(() => Guest_1.Guest, 'guestId'),
|
|
45
|
+
__metadata("design:type", Guest_1.Guest)
|
|
46
|
+
], Voucher.prototype, "guest", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, sequelize_typescript_1.Column)({
|
|
49
|
+
type: sequelize_typescript_1.DataType.DATE,
|
|
50
|
+
allowNull: false,
|
|
51
|
+
defaultValue: new Date(),
|
|
52
|
+
}),
|
|
53
|
+
__metadata("design:type", Date)
|
|
54
|
+
], Voucher.prototype, "createdAt", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, sequelize_typescript_1.Column)({
|
|
57
|
+
type: sequelize_typescript_1.DataType.DATE,
|
|
58
|
+
allowNull: false,
|
|
59
|
+
defaultValue: new Date(),
|
|
60
|
+
}),
|
|
61
|
+
__metadata("design:type", Date)
|
|
62
|
+
], Voucher.prototype, "updatedAt", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
sequelize_typescript_1.Index,
|
|
65
|
+
(0, sequelize_typescript_1.Column)({
|
|
66
|
+
type: sequelize_typescript_1.DataType.INTEGER,
|
|
67
|
+
allowNull: false,
|
|
68
|
+
}),
|
|
69
|
+
__metadata("design:type", Number)
|
|
70
|
+
], Voucher.prototype, "liteApiUserId", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, sequelize_typescript_1.Column)({
|
|
73
|
+
type: sequelize_typescript_1.DataType.STRING,
|
|
74
|
+
allowNull: false,
|
|
75
|
+
}),
|
|
76
|
+
__metadata("design:type", String)
|
|
77
|
+
], Voucher.prototype, "currency", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, sequelize_typescript_1.Column)({
|
|
80
|
+
type: sequelize_typescript_1.DataType.INTEGER,
|
|
81
|
+
allowNull: false,
|
|
82
|
+
}),
|
|
83
|
+
__metadata("design:type", Number)
|
|
84
|
+
], Voucher.prototype, "usagesLimit", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, sequelize_typescript_1.Column)({
|
|
87
|
+
type: sequelize_typescript_1.DataType.INTEGER,
|
|
88
|
+
allowNull: true,
|
|
89
|
+
}),
|
|
90
|
+
__metadata("design:type", Number)
|
|
91
|
+
], Voucher.prototype, "remainingUses", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, sequelize_typescript_1.Column)({
|
|
94
|
+
type: sequelize_typescript_1.DataType.DATE,
|
|
95
|
+
allowNull: false,
|
|
96
|
+
}),
|
|
97
|
+
__metadata("design:type", Date)
|
|
98
|
+
], Voucher.prototype, "validityStart", void 0);
|
|
99
|
+
__decorate([
|
|
100
|
+
(0, sequelize_typescript_1.Column)({
|
|
101
|
+
type: sequelize_typescript_1.DataType.DATE,
|
|
102
|
+
allowNull: false,
|
|
103
|
+
}),
|
|
104
|
+
__metadata("design:type", Date)
|
|
105
|
+
], Voucher.prototype, "validityEnd", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
sequelize_typescript_1.Index,
|
|
108
|
+
(0, sequelize_typescript_1.Column)({
|
|
109
|
+
type: sequelize_typescript_1.DataType.STRING,
|
|
110
|
+
allowNull: false,
|
|
111
|
+
}),
|
|
112
|
+
__metadata("design:type", String)
|
|
113
|
+
], Voucher.prototype, "voucherCode", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, sequelize_typescript_1.Column)({
|
|
116
|
+
type: sequelize_typescript_1.DataType.STRING,
|
|
117
|
+
allowNull: false,
|
|
118
|
+
}),
|
|
119
|
+
__metadata("design:type", String)
|
|
120
|
+
], Voucher.prototype, "discountType", void 0);
|
|
121
|
+
__decorate([
|
|
122
|
+
(0, sequelize_typescript_1.Column)({
|
|
123
|
+
type: sequelize_typescript_1.DataType.DECIMAL(10, 2),
|
|
124
|
+
allowNull: false,
|
|
125
|
+
}),
|
|
126
|
+
__metadata("design:type", Number)
|
|
127
|
+
], Voucher.prototype, "discountValue", void 0);
|
|
128
|
+
__decorate([
|
|
129
|
+
(0, sequelize_typescript_1.Column)({
|
|
130
|
+
type: sequelize_typescript_1.DataType.DECIMAL(10, 2),
|
|
131
|
+
allowNull: true,
|
|
132
|
+
}),
|
|
133
|
+
__metadata("design:type", Number)
|
|
134
|
+
], Voucher.prototype, "maximumDiscountAmount", void 0);
|
|
135
|
+
__decorate([
|
|
136
|
+
(0, sequelize_typescript_1.Column)({
|
|
137
|
+
type: sequelize_typescript_1.DataType.TEXT,
|
|
138
|
+
allowNull: true,
|
|
139
|
+
}),
|
|
140
|
+
__metadata("design:type", String)
|
|
141
|
+
], Voucher.prototype, "termsAndConditions", void 0);
|
|
142
|
+
__decorate([
|
|
143
|
+
sequelize_typescript_1.Index,
|
|
144
|
+
(0, sequelize_typescript_1.Column)({
|
|
145
|
+
type: sequelize_typescript_1.DataType.STRING,
|
|
146
|
+
allowNull: false,
|
|
147
|
+
}),
|
|
148
|
+
__metadata("design:type", String)
|
|
149
|
+
], Voucher.prototype, "voucherType", void 0);
|
|
150
|
+
__decorate([
|
|
151
|
+
(0, sequelize_typescript_1.Column)({
|
|
152
|
+
type: sequelize_typescript_1.DataType.DECIMAL(10, 2),
|
|
153
|
+
allowNull: false,
|
|
154
|
+
defaultValue: 0,
|
|
155
|
+
}),
|
|
156
|
+
__metadata("design:type", Number)
|
|
157
|
+
], Voucher.prototype, "minimumSpend", void 0);
|
|
158
|
+
exports.Voucher = Voucher = __decorate([
|
|
159
|
+
(0, sequelize_typescript_1.Table)({
|
|
160
|
+
tableName: 'vouchers',
|
|
161
|
+
})
|
|
162
|
+
], Voucher);
|
package/package.json
CHANGED
package/dist/models/HotelRate.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
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.HotelRate = void 0;
|
|
13
|
-
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
14
|
-
let HotelRate = class HotelRate extends sequelize_typescript_1.Model {
|
|
15
|
-
};
|
|
16
|
-
exports.HotelRate = HotelRate;
|
|
17
|
-
__decorate([
|
|
18
|
-
sequelize_typescript_1.Index,
|
|
19
|
-
(0, sequelize_typescript_1.Column)({
|
|
20
|
-
type: sequelize_typescript_1.DataType.STRING,
|
|
21
|
-
allowNull: false,
|
|
22
|
-
}),
|
|
23
|
-
__metadata("design:type", String)
|
|
24
|
-
], HotelRate.prototype, "hotelId", void 0);
|
|
25
|
-
__decorate([
|
|
26
|
-
sequelize_typescript_1.Index,
|
|
27
|
-
(0, sequelize_typescript_1.Column)({
|
|
28
|
-
type: sequelize_typescript_1.DataType.STRING(10),
|
|
29
|
-
allowNull: false,
|
|
30
|
-
}),
|
|
31
|
-
__metadata("design:type", String)
|
|
32
|
-
], HotelRate.prototype, "checkin", void 0);
|
|
33
|
-
__decorate([
|
|
34
|
-
sequelize_typescript_1.Index,
|
|
35
|
-
(0, sequelize_typescript_1.Column)({
|
|
36
|
-
type: sequelize_typescript_1.DataType.STRING(10),
|
|
37
|
-
allowNull: false,
|
|
38
|
-
}),
|
|
39
|
-
__metadata("design:type", String)
|
|
40
|
-
], HotelRate.prototype, "checkout", void 0);
|
|
41
|
-
__decorate([
|
|
42
|
-
sequelize_typescript_1.Index,
|
|
43
|
-
(0, sequelize_typescript_1.Column)({
|
|
44
|
-
type: sequelize_typescript_1.DataType.SMALLINT,
|
|
45
|
-
allowNull: false,
|
|
46
|
-
}),
|
|
47
|
-
__metadata("design:type", Number)
|
|
48
|
-
], HotelRate.prototype, "nights", void 0);
|
|
49
|
-
__decorate([
|
|
50
|
-
(0, sequelize_typescript_1.Column)({
|
|
51
|
-
type: sequelize_typescript_1.DataType.FLOAT,
|
|
52
|
-
allowNull: true,
|
|
53
|
-
}),
|
|
54
|
-
__metadata("design:type", Number)
|
|
55
|
-
], HotelRate.prototype, "roomId", void 0);
|
|
56
|
-
__decorate([
|
|
57
|
-
(0, sequelize_typescript_1.Column)({
|
|
58
|
-
type: sequelize_typescript_1.DataType.BOOLEAN,
|
|
59
|
-
}),
|
|
60
|
-
__metadata("design:type", Boolean)
|
|
61
|
-
], HotelRate.prototype, "refundable", void 0);
|
|
62
|
-
exports.HotelRate = HotelRate = __decorate([
|
|
63
|
-
(0, sequelize_typescript_1.Table)({
|
|
64
|
-
tableName: 'hotel_rates',
|
|
65
|
-
})
|
|
66
|
-
], HotelRate);
|