whitelabel-db 1.1.52 → 1.1.54
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/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/migrations/004-add-hotels-columns.d.ts +3 -0
- package/dist/migrations/004-add-hotels-columns.js +54 -0
- package/dist/migrations/005-add-translations-columns.d.ts +3 -0
- package/dist/migrations/005-add-translations-columns.js +103 -0
- package/dist/migrations/006-add-rates-columns.d.ts +3 -0
- package/dist/migrations/006-add-rates-columns.js +49 -0
- package/dist/migrations/007-add-user-columns copy.d.ts +3 -0
- package/dist/migrations/007-add-user-columns copy.js +55 -0
- package/dist/migrations/007-add-user-columns.d.ts +3 -0
- package/dist/migrations/007-add-user-columns.js +55 -0
- package/dist/migrations/008-update-hotel-accessibility-columns.d.ts +3 -0
- package/dist/migrations/008-update-hotel-accessibility-columns.js +42 -0
- package/dist/models/Hotel.d.ts +3 -0
- package/dist/models/Hotel.js +21 -0
- package/dist/models/HotelAccessibility.js +1 -1
- package/dist/models/HotelTranslation.d.ts +4 -0
- package/dist/models/HotelTranslation.js +32 -3
- package/dist/models/User.d.ts +4 -0
- package/dist/models/User.js +28 -0
- 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/Search.d.ts +0 -8
|
@@ -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;
|
|
@@ -0,0 +1,54 @@
|
|
|
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
|
+
// Purpose: Add markdownDescription, importantInfo, hotelType columns to static_hotels table.
|
|
14
|
+
const sequelize_1 = require("sequelize");
|
|
15
|
+
const columns = [
|
|
16
|
+
{ name: 'markdownDescription', type: sequelize_1.DataTypes.TEXT, allowNull: true },
|
|
17
|
+
{ name: 'importantInfo', type: sequelize_1.DataTypes.TEXT, allowNull: true },
|
|
18
|
+
{
|
|
19
|
+
name: 'hotelType',
|
|
20
|
+
type: sequelize_1.DataTypes.STRING,
|
|
21
|
+
allowNull: true,
|
|
22
|
+
},
|
|
23
|
+
];
|
|
24
|
+
const up = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
|
|
25
|
+
try {
|
|
26
|
+
// Add all columns in parallel
|
|
27
|
+
yield Promise.all(columns.map((column) => queryInterface.addColumn('static_hotels', column.name, {
|
|
28
|
+
type: column.type,
|
|
29
|
+
allowNull: column.allowNull,
|
|
30
|
+
})));
|
|
31
|
+
console.log('All columns added successfully.');
|
|
32
|
+
console.log('All columns added successfully.');
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
console.error('Error while adding columns:', error.message);
|
|
36
|
+
throw error; // Re-throw to ensure migration failure is logged and handled.
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
exports.up = up;
|
|
40
|
+
const down = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
|
+
try {
|
|
42
|
+
// Remove columns
|
|
43
|
+
for (const column of columns.reverse()) {
|
|
44
|
+
console.log(`Removing column: ${column.name}`);
|
|
45
|
+
yield queryInterface.removeColumn('static_hotels', column.name);
|
|
46
|
+
}
|
|
47
|
+
console.log('All columns removed successfully.');
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
console.error('Error while removing columns:', error.message);
|
|
51
|
+
throw error; // Re-throw to ensure migration failure is logged and handled.
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
exports.down = down;
|
|
@@ -0,0 +1,103 @@
|
|
|
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 columnsToAdd = [
|
|
15
|
+
{ name: 'hotelType', type: sequelize_1.DataTypes.STRING, allowNull: true },
|
|
16
|
+
{ name: 'parking', type: sequelize_1.DataTypes.STRING, allowNull: true },
|
|
17
|
+
{
|
|
18
|
+
name: 'createdAt',
|
|
19
|
+
type: sequelize_1.DataTypes.DATE,
|
|
20
|
+
allowNull: false,
|
|
21
|
+
defaultValue: new Date(),
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'updatedAt',
|
|
25
|
+
type: sequelize_1.DataTypes.DATE,
|
|
26
|
+
allowNull: false,
|
|
27
|
+
defaultValue: new Date(),
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
const up = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
|
+
try {
|
|
32
|
+
// Add new columns in parallel
|
|
33
|
+
yield Promise.all(columnsToAdd.map((column) => queryInterface.addColumn('static_hotels_translations', column.name, {
|
|
34
|
+
type: column.type,
|
|
35
|
+
allowNull: column.allowNull,
|
|
36
|
+
defaultValue: column === null || column === void 0 ? void 0 : column.defaultValue,
|
|
37
|
+
})));
|
|
38
|
+
console.log('New columns added successfully.');
|
|
39
|
+
// Modify existing columns
|
|
40
|
+
yield Promise.all([
|
|
41
|
+
queryInterface.changeColumn('static_hotels_translations', 'name', {
|
|
42
|
+
type: sequelize_1.DataTypes.STRING,
|
|
43
|
+
allowNull: true,
|
|
44
|
+
}),
|
|
45
|
+
queryInterface.changeColumn('static_hotels_translations', 'city', {
|
|
46
|
+
type: sequelize_1.DataTypes.STRING,
|
|
47
|
+
allowNull: true,
|
|
48
|
+
}),
|
|
49
|
+
queryInterface.changeColumn('static_hotels_translations', 'country', {
|
|
50
|
+
type: sequelize_1.DataTypes.STRING,
|
|
51
|
+
allowNull: true,
|
|
52
|
+
}),
|
|
53
|
+
queryInterface.changeColumn('static_hotels_translations', 'id', {
|
|
54
|
+
type: sequelize_1.DataTypes.UUID,
|
|
55
|
+
allowNull: false,
|
|
56
|
+
defaultValue: sequelize_1.DataTypes.UUIDV4,
|
|
57
|
+
primaryKey: true,
|
|
58
|
+
}),
|
|
59
|
+
]);
|
|
60
|
+
console.log('Column constraints updated successfully.');
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
console.error('Error in migration:', error.message);
|
|
64
|
+
throw error;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
exports.up = up;
|
|
68
|
+
const down = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
|
|
69
|
+
try {
|
|
70
|
+
// Revert constraint changes
|
|
71
|
+
yield Promise.all([
|
|
72
|
+
queryInterface.changeColumn('static_hotels_translations', 'name', {
|
|
73
|
+
type: sequelize_1.DataTypes.STRING,
|
|
74
|
+
allowNull: false,
|
|
75
|
+
}),
|
|
76
|
+
queryInterface.changeColumn('static_hotels_translations', 'city', {
|
|
77
|
+
type: sequelize_1.DataTypes.STRING,
|
|
78
|
+
allowNull: false,
|
|
79
|
+
}),
|
|
80
|
+
queryInterface.changeColumn('static_hotels_translations', 'country', {
|
|
81
|
+
type: sequelize_1.DataTypes.STRING,
|
|
82
|
+
allowNull: false,
|
|
83
|
+
}),
|
|
84
|
+
queryInterface.changeColumn('static_hotels_translations', 'id', {
|
|
85
|
+
type: sequelize_1.DataTypes.UUID,
|
|
86
|
+
allowNull: false,
|
|
87
|
+
primaryKey: true,
|
|
88
|
+
}),
|
|
89
|
+
]);
|
|
90
|
+
console.log('Reverted column constraints.');
|
|
91
|
+
// Remove newly added columns
|
|
92
|
+
for (const column of columnsToAdd.reverse()) {
|
|
93
|
+
console.log(`Removing column: ${column.name}`);
|
|
94
|
+
yield queryInterface.removeColumn('static_hotels_translations', column.name);
|
|
95
|
+
}
|
|
96
|
+
console.log('All columns removed successfully.');
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
console.error('Error in rollback:', error.message);
|
|
100
|
+
throw error;
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
exports.down = down;
|
|
@@ -0,0 +1,49 @@
|
|
|
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
|
+
// Purpose: Add amountTotal, boardType columns to hotel_rates table.
|
|
14
|
+
const sequelize_1 = require("sequelize");
|
|
15
|
+
const columns = [
|
|
16
|
+
{ name: 'amountTotal', type: sequelize_1.DataTypes.FLOAT, allowNull: true },
|
|
17
|
+
{ name: 'boardType', type: sequelize_1.DataTypes.STRING(10), allowNull: false },
|
|
18
|
+
];
|
|
19
|
+
const up = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
+
try {
|
|
21
|
+
// Add all columns in parallel
|
|
22
|
+
yield Promise.all(columns.map((column) => queryInterface.addColumn('hotel_rates', column.name, {
|
|
23
|
+
type: column.type,
|
|
24
|
+
allowNull: column.allowNull,
|
|
25
|
+
})));
|
|
26
|
+
console.log('All columns added successfully.');
|
|
27
|
+
console.log('All columns added successfully.');
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
console.error('Error while adding columns:', error.message);
|
|
31
|
+
throw error; // Re-throw to ensure migration failure is logged and handled.
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
exports.up = up;
|
|
35
|
+
const down = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
|
+
try {
|
|
37
|
+
// Remove columns
|
|
38
|
+
for (const column of columns.reverse()) {
|
|
39
|
+
console.log(`Removing column: ${column.name}`);
|
|
40
|
+
yield queryInterface.removeColumn('hotel_rates', column.name);
|
|
41
|
+
}
|
|
42
|
+
console.log('All columns removed successfully.');
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
console.error('Error while removing columns:', error.message);
|
|
46
|
+
throw error; // Re-throw to ensure migration failure is logged and handled.
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
exports.down = down;
|
|
@@ -0,0 +1,55 @@
|
|
|
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
|
+
// Purpose: Add amountTotal, boardType columns to users table.
|
|
14
|
+
const sequelize_1 = require("sequelize");
|
|
15
|
+
const columns = [
|
|
16
|
+
{
|
|
17
|
+
name: 'isVerified',
|
|
18
|
+
type: sequelize_1.DataTypes.BOOLEAN,
|
|
19
|
+
allowNull: true,
|
|
20
|
+
},
|
|
21
|
+
{ name: 'firstName', type: sequelize_1.DataTypes.STRING, allowNull: true },
|
|
22
|
+
{ name: 'lastName', type: sequelize_1.DataTypes.STRING, allowNull: true },
|
|
23
|
+
{ name: 'phoneNo', type: sequelize_1.DataTypes.STRING, allowNull: true },
|
|
24
|
+
];
|
|
25
|
+
const up = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
|
|
26
|
+
try {
|
|
27
|
+
// Add all columns in parallel
|
|
28
|
+
yield Promise.all(columns.map((column) => queryInterface.addColumn('users', column.name, {
|
|
29
|
+
type: column.type,
|
|
30
|
+
allowNull: column.allowNull,
|
|
31
|
+
})));
|
|
32
|
+
console.log('All columns added successfully.');
|
|
33
|
+
console.log('All columns added successfully.');
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
console.error('Error while adding columns:', error.message);
|
|
37
|
+
throw error; // Re-throw to ensure migration failure is logged and handled.
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
exports.up = up;
|
|
41
|
+
const down = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
|
|
42
|
+
try {
|
|
43
|
+
// Remove columns
|
|
44
|
+
for (const column of columns.reverse()) {
|
|
45
|
+
console.log(`Removing column: ${column.name}`);
|
|
46
|
+
yield queryInterface.removeColumn('users', column.name);
|
|
47
|
+
}
|
|
48
|
+
console.log('All columns removed successfully.');
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
console.error('Error while removing columns:', error.message);
|
|
52
|
+
throw error; // Re-throw to ensure migration failure is logged and handled.
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
exports.down = down;
|
|
@@ -0,0 +1,55 @@
|
|
|
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
|
+
// Purpose: Add amountTotal, boardType columns to users table.
|
|
14
|
+
const sequelize_1 = require("sequelize");
|
|
15
|
+
const columns = [
|
|
16
|
+
{
|
|
17
|
+
name: 'isVerified',
|
|
18
|
+
type: sequelize_1.DataTypes.BOOLEAN,
|
|
19
|
+
allowNull: true,
|
|
20
|
+
},
|
|
21
|
+
{ name: 'firstName', type: sequelize_1.DataTypes.STRING, allowNull: true },
|
|
22
|
+
{ name: 'lastName', type: sequelize_1.DataTypes.STRING, allowNull: true },
|
|
23
|
+
{ name: 'phoneNo', type: sequelize_1.DataTypes.STRING, allowNull: true },
|
|
24
|
+
];
|
|
25
|
+
const up = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
|
|
26
|
+
try {
|
|
27
|
+
// Add all columns in parallel
|
|
28
|
+
yield Promise.all(columns.map((column) => queryInterface.addColumn('users', column.name, {
|
|
29
|
+
type: column.type,
|
|
30
|
+
allowNull: column.allowNull,
|
|
31
|
+
})));
|
|
32
|
+
console.log('All columns added successfully.');
|
|
33
|
+
console.log('All columns added successfully.');
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
console.error('Error while adding columns:', error.message);
|
|
37
|
+
throw error; // Re-throw to ensure migration failure is logged and handled.
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
exports.up = up;
|
|
41
|
+
const down = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
|
|
42
|
+
try {
|
|
43
|
+
// Remove columns
|
|
44
|
+
for (const column of columns.reverse()) {
|
|
45
|
+
console.log(`Removing column: ${column.name}`);
|
|
46
|
+
yield queryInterface.removeColumn('users', column.name);
|
|
47
|
+
}
|
|
48
|
+
console.log('All columns removed successfully.');
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
console.error('Error while removing columns:', error.message);
|
|
52
|
+
throw error; // Re-throw to ensure migration failure is logged and handled.
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
exports.down = down;
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
// Purpose: Update certificateHtml column in static_hotels_accessibility table from string to text
|
|
14
|
+
const sequelize_1 = require("sequelize");
|
|
15
|
+
const up = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
try {
|
|
17
|
+
yield queryInterface.changeColumn('static_hotels_accessibility', 'certificateHtml', {
|
|
18
|
+
type: sequelize_1.DataTypes.TEXT,
|
|
19
|
+
allowNull: true,
|
|
20
|
+
});
|
|
21
|
+
console.log('certificateHtml column has been changed successfully.');
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
console.error('Error while adding columns or indexes:', error.message);
|
|
25
|
+
throw error; // Re-throw to ensure migration failure is logged and handled.
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
exports.up = up;
|
|
29
|
+
const down = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
|
|
30
|
+
try {
|
|
31
|
+
yield queryInterface.changeColumn('static_hotels_accessibility', 'certificateHtml', {
|
|
32
|
+
type: sequelize_1.DataTypes.STRING,
|
|
33
|
+
allowNull: true,
|
|
34
|
+
});
|
|
35
|
+
console.log('certificateHtml column has been changed successfully.');
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
console.error('Error while removing columns or indexes:', error.message);
|
|
39
|
+
throw error; // Re-throw to ensure migration failure is logged and handled.
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
exports.down = down;
|
package/dist/models/Hotel.d.ts
CHANGED
|
@@ -65,6 +65,8 @@ export declare class Hotel extends Model<Partial<Hotel>> {
|
|
|
65
65
|
id: string;
|
|
66
66
|
name: string;
|
|
67
67
|
hotelDescription: string;
|
|
68
|
+
markdownDescription: string;
|
|
69
|
+
importantInfo: string;
|
|
68
70
|
currency: string;
|
|
69
71
|
country: string;
|
|
70
72
|
city: string;
|
|
@@ -78,6 +80,7 @@ export declare class Hotel extends Model<Partial<Hotel>> {
|
|
|
78
80
|
main_photo: string;
|
|
79
81
|
thumbnail: string;
|
|
80
82
|
hotelTypeId: number;
|
|
83
|
+
hotelType: string;
|
|
81
84
|
chainId: number;
|
|
82
85
|
airportCode: string;
|
|
83
86
|
stars: number;
|
package/dist/models/Hotel.js
CHANGED
|
@@ -38,6 +38,20 @@ __decorate([
|
|
|
38
38
|
}),
|
|
39
39
|
__metadata("design:type", String)
|
|
40
40
|
], Hotel.prototype, "hotelDescription", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, sequelize_typescript_1.Column)({
|
|
43
|
+
type: sequelize_typescript_1.DataType.TEXT,
|
|
44
|
+
allowNull: true,
|
|
45
|
+
}),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], Hotel.prototype, "markdownDescription", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, sequelize_typescript_1.Column)({
|
|
50
|
+
type: sequelize_typescript_1.DataType.TEXT,
|
|
51
|
+
allowNull: false,
|
|
52
|
+
}),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], Hotel.prototype, "importantInfo", void 0);
|
|
41
55
|
__decorate([
|
|
42
56
|
(0, sequelize_typescript_1.Column)({
|
|
43
57
|
type: sequelize_typescript_1.DataType.STRING,
|
|
@@ -135,6 +149,13 @@ __decorate([
|
|
|
135
149
|
}),
|
|
136
150
|
__metadata("design:type", Number)
|
|
137
151
|
], Hotel.prototype, "hotelTypeId", void 0);
|
|
152
|
+
__decorate([
|
|
153
|
+
(0, sequelize_typescript_1.Column)({
|
|
154
|
+
type: sequelize_typescript_1.DataType.STRING,
|
|
155
|
+
allowNull: true,
|
|
156
|
+
}),
|
|
157
|
+
__metadata("design:type", String)
|
|
158
|
+
], Hotel.prototype, "hotelType", void 0);
|
|
138
159
|
__decorate([
|
|
139
160
|
sequelize_typescript_1.Index,
|
|
140
161
|
(0, sequelize_typescript_1.Column)({
|
|
@@ -427,7 +427,7 @@ __decorate([
|
|
|
427
427
|
], HotelAccessibility.prototype, "certificateUrl", void 0);
|
|
428
428
|
__decorate([
|
|
429
429
|
(0, sequelize_typescript_1.Column)({
|
|
430
|
-
type: sequelize_typescript_1.DataType.
|
|
430
|
+
type: sequelize_typescript_1.DataType.TEXT,
|
|
431
431
|
allowNull: true,
|
|
432
432
|
}),
|
|
433
433
|
__metadata("design:type", String)
|
|
@@ -21,6 +21,7 @@ __decorate([
|
|
|
21
21
|
(0, sequelize_typescript_1.Column)({
|
|
22
22
|
type: sequelize_typescript_1.DataType.UUID,
|
|
23
23
|
allowNull: false,
|
|
24
|
+
defaultValue: sequelize_typescript_1.DataType.UUIDV4,
|
|
24
25
|
}),
|
|
25
26
|
__metadata("design:type", String)
|
|
26
27
|
], HotelTranslation.prototype, "id", void 0);
|
|
@@ -47,7 +48,7 @@ __decorate([
|
|
|
47
48
|
__decorate([
|
|
48
49
|
(0, sequelize_typescript_1.Column)({
|
|
49
50
|
type: sequelize_typescript_1.DataType.STRING(512),
|
|
50
|
-
allowNull:
|
|
51
|
+
allowNull: true,
|
|
51
52
|
}),
|
|
52
53
|
__metadata("design:type", String)
|
|
53
54
|
], HotelTranslation.prototype, "name", void 0);
|
|
@@ -76,7 +77,7 @@ __decorate([
|
|
|
76
77
|
sequelize_typescript_1.Index,
|
|
77
78
|
(0, sequelize_typescript_1.Column)({
|
|
78
79
|
type: sequelize_typescript_1.DataType.STRING,
|
|
79
|
-
allowNull:
|
|
80
|
+
allowNull: true,
|
|
80
81
|
}),
|
|
81
82
|
__metadata("design:type", String)
|
|
82
83
|
], HotelTranslation.prototype, "country", void 0);
|
|
@@ -84,7 +85,7 @@ __decorate([
|
|
|
84
85
|
sequelize_typescript_1.Index,
|
|
85
86
|
(0, sequelize_typescript_1.Column)({
|
|
86
87
|
type: sequelize_typescript_1.DataType.STRING,
|
|
87
|
-
allowNull:
|
|
88
|
+
allowNull: true,
|
|
88
89
|
}),
|
|
89
90
|
__metadata("design:type", String)
|
|
90
91
|
], HotelTranslation.prototype, "city", void 0);
|
|
@@ -116,6 +117,13 @@ __decorate([
|
|
|
116
117
|
}),
|
|
117
118
|
__metadata("design:type", Array)
|
|
118
119
|
], HotelTranslation.prototype, "rooms", void 0);
|
|
120
|
+
__decorate([
|
|
121
|
+
(0, sequelize_typescript_1.Column)({
|
|
122
|
+
type: sequelize_typescript_1.DataType.STRING,
|
|
123
|
+
allowNull: true,
|
|
124
|
+
}),
|
|
125
|
+
__metadata("design:type", String)
|
|
126
|
+
], HotelTranslation.prototype, "hotelType", void 0);
|
|
119
127
|
__decorate([
|
|
120
128
|
(0, sequelize_typescript_1.Column)({
|
|
121
129
|
type: sequelize_typescript_1.DataType.ARRAY(sequelize_typescript_1.DataType.JSONB),
|
|
@@ -123,6 +131,27 @@ __decorate([
|
|
|
123
131
|
}),
|
|
124
132
|
__metadata("design:type", Array)
|
|
125
133
|
], HotelTranslation.prototype, "reviews", void 0);
|
|
134
|
+
__decorate([
|
|
135
|
+
(0, sequelize_typescript_1.Column)({
|
|
136
|
+
type: sequelize_typescript_1.DataType.STRING,
|
|
137
|
+
allowNull: true,
|
|
138
|
+
}),
|
|
139
|
+
__metadata("design:type", String)
|
|
140
|
+
], HotelTranslation.prototype, "parking", void 0);
|
|
141
|
+
__decorate([
|
|
142
|
+
(0, sequelize_typescript_1.Column)({
|
|
143
|
+
type: sequelize_typescript_1.DataType.DATE,
|
|
144
|
+
allowNull: false,
|
|
145
|
+
}),
|
|
146
|
+
__metadata("design:type", Date)
|
|
147
|
+
], HotelTranslation.prototype, "createdAt", void 0);
|
|
148
|
+
__decorate([
|
|
149
|
+
(0, sequelize_typescript_1.Column)({
|
|
150
|
+
type: sequelize_typescript_1.DataType.DATE,
|
|
151
|
+
allowNull: false,
|
|
152
|
+
}),
|
|
153
|
+
__metadata("design:type", Date)
|
|
154
|
+
], HotelTranslation.prototype, "updatedAt", void 0);
|
|
126
155
|
exports.HotelTranslation = HotelTranslation = __decorate([
|
|
127
156
|
(0, sequelize_typescript_1.Table)({
|
|
128
157
|
tableName: 'static_hotels_translations',
|
package/dist/models/User.d.ts
CHANGED
|
@@ -4,12 +4,16 @@ import { Role } from './Role';
|
|
|
4
4
|
export declare class User extends Model<Partial<User>> {
|
|
5
5
|
id: string;
|
|
6
6
|
email: string;
|
|
7
|
+
firstName: string;
|
|
8
|
+
lastName: string;
|
|
9
|
+
phoneNo: string;
|
|
7
10
|
password: string;
|
|
8
11
|
agencyId?: string;
|
|
9
12
|
agency?: Agency;
|
|
10
13
|
roleId?: number;
|
|
11
14
|
otp?: string;
|
|
12
15
|
role?: Role;
|
|
16
|
+
isVerified: boolean;
|
|
13
17
|
static checkEmail(email: string): Promise<void>;
|
|
14
18
|
generateSession(secret: string): string;
|
|
15
19
|
}
|
package/dist/models/User.js
CHANGED
|
@@ -61,6 +61,27 @@ __decorate([
|
|
|
61
61
|
}),
|
|
62
62
|
__metadata("design:type", String)
|
|
63
63
|
], User.prototype, "email", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, sequelize_typescript_1.Column)({
|
|
66
|
+
type: sequelize_typescript_1.DataType.STRING,
|
|
67
|
+
allowNull: true,
|
|
68
|
+
}),
|
|
69
|
+
__metadata("design:type", String)
|
|
70
|
+
], User.prototype, "firstName", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, sequelize_typescript_1.Column)({
|
|
73
|
+
type: sequelize_typescript_1.DataType.STRING,
|
|
74
|
+
allowNull: true,
|
|
75
|
+
}),
|
|
76
|
+
__metadata("design:type", String)
|
|
77
|
+
], User.prototype, "lastName", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, sequelize_typescript_1.Column)({
|
|
80
|
+
type: sequelize_typescript_1.DataType.STRING,
|
|
81
|
+
allowNull: true,
|
|
82
|
+
}),
|
|
83
|
+
__metadata("design:type", String)
|
|
84
|
+
], User.prototype, "phoneNo", void 0);
|
|
64
85
|
__decorate([
|
|
65
86
|
(0, sequelize_typescript_1.Column)({
|
|
66
87
|
type: sequelize_typescript_1.DataType.STRING,
|
|
@@ -100,6 +121,13 @@ __decorate([
|
|
|
100
121
|
(0, sequelize_typescript_1.BelongsTo)(() => Role_1.Role),
|
|
101
122
|
__metadata("design:type", Role_1.Role)
|
|
102
123
|
], User.prototype, "role", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
(0, sequelize_typescript_1.Column)({
|
|
126
|
+
type: sequelize_typescript_1.DataType.BOOLEAN,
|
|
127
|
+
defaultValue: true,
|
|
128
|
+
}),
|
|
129
|
+
__metadata("design:type", Boolean)
|
|
130
|
+
], User.prototype, "isVerified", void 0);
|
|
103
131
|
exports.User = User = User_1 = __decorate([
|
|
104
132
|
(0, sequelize_typescript_1.Table)({
|
|
105
133
|
tableName: 'users',
|
|
@@ -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