whitelabel-db 1.1.22 → 1.1.23
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/models/Booking.d.ts +3 -0
- package/dist/models/Booking.js +14 -0
- package/dist/models/Guest.d.ts +2 -0
- package/dist/models/Guest.js +5 -0
- package/package.json +1 -1
package/dist/models/Booking.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Model } from 'sequelize-typescript';
|
|
2
2
|
import { Project } from './Project';
|
|
3
3
|
import { OccupancyV3 } from '../libs/liteapiv3';
|
|
4
|
+
import { Guest } from './Guest';
|
|
4
5
|
export declare class Booking extends Model<Partial<Booking>> {
|
|
5
6
|
id: string;
|
|
6
7
|
prebookId: string;
|
|
@@ -15,4 +16,6 @@ export declare class Booking extends Model<Partial<Booking>> {
|
|
|
15
16
|
bookingStatus?: string;
|
|
16
17
|
liteApiVersion?: string;
|
|
17
18
|
occupancies?: OccupancyV3[];
|
|
19
|
+
guestId?: string;
|
|
20
|
+
guest?: Guest;
|
|
18
21
|
}
|
package/dist/models/Booking.js
CHANGED
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.Booking = void 0;
|
|
13
13
|
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
14
14
|
const Project_1 = require("./Project");
|
|
15
|
+
const Guest_1 = require("./Guest");
|
|
15
16
|
let Booking = class Booking extends sequelize_typescript_1.Model {
|
|
16
17
|
};
|
|
17
18
|
exports.Booking = Booking;
|
|
@@ -119,6 +120,19 @@ __decorate([
|
|
|
119
120
|
}),
|
|
120
121
|
__metadata("design:type", Array)
|
|
121
122
|
], Booking.prototype, "occupancies", void 0);
|
|
123
|
+
__decorate([
|
|
124
|
+
(0, sequelize_typescript_1.ForeignKey)(() => Guest_1.Guest),
|
|
125
|
+
sequelize_typescript_1.Index,
|
|
126
|
+
(0, sequelize_typescript_1.Column)({
|
|
127
|
+
type: sequelize_typescript_1.DataType.UUID,
|
|
128
|
+
allowNull: true,
|
|
129
|
+
}),
|
|
130
|
+
__metadata("design:type", String)
|
|
131
|
+
], Booking.prototype, "guestId", void 0);
|
|
132
|
+
__decorate([
|
|
133
|
+
(0, sequelize_typescript_1.BelongsTo)(() => Guest_1.Guest),
|
|
134
|
+
__metadata("design:type", Guest_1.Guest)
|
|
135
|
+
], Booking.prototype, "guest", void 0);
|
|
122
136
|
exports.Booking = Booking = __decorate([
|
|
123
137
|
(0, sequelize_typescript_1.Table)({
|
|
124
138
|
tableName: 'bookings',
|
package/dist/models/Guest.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Model } from 'sequelize-typescript';
|
|
2
2
|
import { Project } from './Project';
|
|
3
3
|
import { VoucherResponse } from '../libs/liteapiv3';
|
|
4
|
+
import { Booking } from './Booking';
|
|
4
5
|
export declare class Guest extends Model<Partial<Guest>> {
|
|
5
6
|
id: string;
|
|
6
7
|
firstName: string;
|
|
@@ -17,6 +18,7 @@ export declare class Guest extends Model<Partial<Guest>> {
|
|
|
17
18
|
vouchers: VoucherResponse[];
|
|
18
19
|
favoriteHotelIds: string[];
|
|
19
20
|
project?: Project;
|
|
21
|
+
bookings?: Booking[];
|
|
20
22
|
static checkEmail(email: string, projectId: string): Promise<void>;
|
|
21
23
|
generateSession(secret: string): string;
|
|
22
24
|
}
|
package/dist/models/Guest.js
CHANGED
|
@@ -26,6 +26,7 @@ exports.Guest = void 0;
|
|
|
26
26
|
const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
|
|
27
27
|
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
28
28
|
const Project_1 = require("./Project");
|
|
29
|
+
const Booking_1 = require("./Booking");
|
|
29
30
|
let Guest = Guest_1 = class Guest extends sequelize_typescript_1.Model {
|
|
30
31
|
static checkEmail(email, projectId) {
|
|
31
32
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -150,6 +151,10 @@ __decorate([
|
|
|
150
151
|
(0, sequelize_typescript_1.BelongsTo)(() => Project_1.Project),
|
|
151
152
|
__metadata("design:type", Project_1.Project)
|
|
152
153
|
], Guest.prototype, "project", void 0);
|
|
154
|
+
__decorate([
|
|
155
|
+
(0, sequelize_typescript_1.HasMany)(() => Booking_1.Booking),
|
|
156
|
+
__metadata("design:type", Array)
|
|
157
|
+
], Guest.prototype, "bookings", void 0);
|
|
153
158
|
exports.Guest = Guest = Guest_1 = __decorate([
|
|
154
159
|
(0, sequelize_typescript_1.Table)({
|
|
155
160
|
tableName: 'guests',
|