whitelabel-db 1.5.0 → 1.7.0

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
@@ -8,6 +8,7 @@ export { User } from './models/User';
8
8
  export { Project } from './models/Project';
9
9
  export { Booking } from './models/Booking';
10
10
  export { FlightBooking } from './models/FlightBooking';
11
+ export { ExperienceBooking } from './models/ExperienceBooking';
11
12
  export { Role } from './models/Role';
12
13
  export { HotelTranslation } from './models/HotelTranslation';
13
14
  export { Guest } from './models/Guest';
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.BookingLoyaltyRecord = exports.LoyaltyProgramTier = exports.LoyaltyProgram = exports.DeletedHotel = exports.CollectionItemCustomField = exports.CollectionType = exports.CollectionItem = exports.CollectionStatus = exports.Collection = exports.Creator = exports.AmenityTranslation = exports.RoomAmenity = exports.Amenity = exports.FacilityTranslation = exports.HotelFacility = exports.Facility = exports.AnalyticsSummary = exports.HotelRate = exports.Feedback = exports.Referral = exports.HotelAccessibility = exports.Guest = exports.HotelTranslation = exports.Role = exports.FlightBooking = exports.Booking = exports.Project = exports.User = exports.Hotel = exports.Country = exports.City = exports.Agency = exports.runMigrations = exports.connect = void 0;
3
+ exports.LiteApiUser = exports.LiteApiClientV3 = exports.LiteApiClient = exports.BookingLoyaltyRecord = exports.LoyaltyProgramTier = exports.LoyaltyProgram = exports.DeletedHotel = exports.CollectionItemCustomField = exports.CollectionType = exports.CollectionItem = exports.CollectionStatus = exports.Collection = exports.Creator = exports.AmenityTranslation = exports.RoomAmenity = exports.Amenity = exports.FacilityTranslation = exports.HotelFacility = exports.Facility = exports.AnalyticsSummary = exports.HotelRate = exports.Feedback = exports.Referral = exports.HotelAccessibility = exports.Guest = exports.HotelTranslation = exports.Role = exports.ExperienceBooking = exports.FlightBooking = 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");
@@ -21,6 +21,8 @@ var Booking_1 = require("./models/Booking");
21
21
  Object.defineProperty(exports, "Booking", { enumerable: true, get: function () { return Booking_1.Booking; } });
22
22
  var FlightBooking_1 = require("./models/FlightBooking");
23
23
  Object.defineProperty(exports, "FlightBooking", { enumerable: true, get: function () { return FlightBooking_1.FlightBooking; } });
24
+ var ExperienceBooking_1 = require("./models/ExperienceBooking");
25
+ Object.defineProperty(exports, "ExperienceBooking", { enumerable: true, get: function () { return ExperienceBooking_1.ExperienceBooking; } });
24
26
  var Role_1 = require("./models/Role");
25
27
  Object.defineProperty(exports, "Role", { enumerable: true, get: function () { return Role_1.Role; } });
26
28
  var HotelTranslation_1 = require("./models/HotelTranslation");
@@ -19,6 +19,7 @@ const City_1 = require("../models/City");
19
19
  const Country_1 = require("../models/Country");
20
20
  const Booking_1 = require("../models/Booking");
21
21
  const FlightBooking_1 = require("../models/FlightBooking");
22
+ const ExperienceBooking_1 = require("../models/ExperienceBooking");
22
23
  const Role_1 = require("../models/Role");
23
24
  const HotelTranslation_1 = require("../models/HotelTranslation");
24
25
  const Guest_1 = require("../models/Guest");
@@ -60,6 +61,7 @@ const connect = (connectionDetails) => __awaiter(void 0, void 0, void 0, functio
60
61
  Country_1.Country,
61
62
  Booking_1.Booking,
62
63
  FlightBooking_1.FlightBooking,
64
+ ExperienceBooking_1.ExperienceBooking,
63
65
  Role_1.Role,
64
66
  HotelTranslation_1.HotelTranslation,
65
67
  Guest_1.Guest,
@@ -0,0 +1,3 @@
1
+ import { QueryInterface } from 'sequelize';
2
+ export declare const up: (queryInterface: QueryInterface) => Promise<void>;
3
+ export declare const down: (queryInterface: QueryInterface) => Promise<void>;
@@ -0,0 +1,67 @@
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: Mirror the hotel `bookings` lifecycle for flights — the row is now
14
+ // created at PREBOOK time (before a bookingId exists), keyed by prebookId, then
15
+ // the bookingId is filled in at booking-creation. Adds a unique, indexed
16
+ // `prebookId` column and relaxes `bookingId` to nullable.
17
+ const sequelize_1 = require("sequelize");
18
+ const TABLE_NAME = 'flight_bookings';
19
+ const PREBOOK_ID_COLUMN = 'prebookId';
20
+ const up = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
21
+ const tableDescription = yield queryInterface.describeTable(TABLE_NAME);
22
+ const existingColumns = Object.keys(tableDescription);
23
+ if (!existingColumns.includes(PREBOOK_ID_COLUMN)) {
24
+ yield queryInterface.addColumn(TABLE_NAME, PREBOOK_ID_COLUMN, {
25
+ type: sequelize_1.DataTypes.STRING,
26
+ allowNull: true,
27
+ });
28
+ }
29
+ // bookingId is unknown until the booking is created — relax NOT NULL.
30
+ yield queryInterface.changeColumn(TABLE_NAME, 'bookingId', {
31
+ type: sequelize_1.DataTypes.STRING,
32
+ allowNull: true,
33
+ });
34
+ // Unique + lookup index on prebookId (fail gracefully if it already exists).
35
+ try {
36
+ yield queryInterface.addIndex(TABLE_NAME, [PREBOOK_ID_COLUMN], {
37
+ name: 'idx_flight_bookings_prebook_id',
38
+ unique: true,
39
+ });
40
+ }
41
+ catch (error) {
42
+ const message = error instanceof Error ? error.message : String(error);
43
+ if (!message.includes('already exists')) {
44
+ throw error;
45
+ }
46
+ }
47
+ });
48
+ exports.up = up;
49
+ const down = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
50
+ const tableDescription = yield queryInterface.describeTable(TABLE_NAME);
51
+ const existingColumns = Object.keys(tableDescription);
52
+ try {
53
+ yield queryInterface.removeIndex(TABLE_NAME, 'idx_flight_bookings_prebook_id');
54
+ }
55
+ catch (_a) {
56
+ // index may not exist — ignore
57
+ }
58
+ if (existingColumns.includes(PREBOOK_ID_COLUMN)) {
59
+ yield queryInterface.removeColumn(TABLE_NAME, PREBOOK_ID_COLUMN);
60
+ }
61
+ // Restore NOT NULL on bookingId. Note: only safe if no null rows remain.
62
+ yield queryInterface.changeColumn(TABLE_NAME, 'bookingId', {
63
+ type: sequelize_1.DataTypes.STRING,
64
+ allowNull: false,
65
+ });
66
+ });
67
+ exports.down = down;
@@ -0,0 +1,3 @@
1
+ import { QueryInterface } from 'sequelize';
2
+ export declare const up: (queryInterface: QueryInterface) => Promise<void>;
3
+ export declare const down: (queryInterface: QueryInterface) => Promise<void>;
@@ -0,0 +1,158 @@
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 TABLE_NAME = 'experience_bookings';
15
+ const PROJECT_ID_INDEX = 'experience_bookings_projectId_idx';
16
+ const PREBOOK_ID_INDEX = 'idx_experience_bookings_prebook_id';
17
+ const CONTACT_EMAIL_INDEX = 'idx_experience_bookings_contact_email';
18
+ const GUEST_ID_INDEX = 'idx_experience_bookings_guest_id';
19
+ const up = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
20
+ yield queryInterface.createTable(TABLE_NAME, {
21
+ id: {
22
+ type: sequelize_1.DataTypes.UUID,
23
+ primaryKey: true,
24
+ allowNull: false,
25
+ defaultValue: sequelize_1.DataTypes.UUIDV4,
26
+ },
27
+ prebookId: {
28
+ type: sequelize_1.DataTypes.STRING,
29
+ allowNull: true,
30
+ },
31
+ experienceBookingId: {
32
+ type: sequelize_1.DataTypes.STRING,
33
+ allowNull: true,
34
+ unique: true,
35
+ },
36
+ projectId: {
37
+ type: sequelize_1.DataTypes.UUID,
38
+ allowNull: false,
39
+ references: {
40
+ model: 'projects',
41
+ key: 'id',
42
+ },
43
+ onUpdate: 'CASCADE',
44
+ onDelete: 'CASCADE',
45
+ },
46
+ provider: {
47
+ type: sequelize_1.DataTypes.STRING,
48
+ allowNull: true,
49
+ },
50
+ providerBookingHash: {
51
+ type: sequelize_1.DataTypes.STRING,
52
+ allowNull: true,
53
+ },
54
+ liteApiBookingData: {
55
+ type: sequelize_1.DataTypes.JSONB,
56
+ allowNull: false,
57
+ defaultValue: {},
58
+ },
59
+ liteApiPrebookData: {
60
+ type: sequelize_1.DataTypes.JSONB,
61
+ allowNull: false,
62
+ defaultValue: {},
63
+ },
64
+ bookingInputData: {
65
+ type: sequelize_1.DataTypes.JSONB,
66
+ allowNull: false,
67
+ defaultValue: {},
68
+ },
69
+ paymentData: {
70
+ type: sequelize_1.DataTypes.JSONB,
71
+ allowNull: false,
72
+ defaultValue: {},
73
+ },
74
+ bookingStatus: {
75
+ type: sequelize_1.DataTypes.STRING,
76
+ allowNull: false,
77
+ defaultValue: '',
78
+ },
79
+ paymentStatus: {
80
+ type: sequelize_1.DataTypes.STRING,
81
+ allowNull: false,
82
+ defaultValue: '',
83
+ },
84
+ paymentProvider: {
85
+ type: sequelize_1.DataTypes.STRING,
86
+ allowNull: true,
87
+ },
88
+ paymentMethod: {
89
+ type: sequelize_1.DataTypes.STRING,
90
+ allowNull: true,
91
+ },
92
+ refundStatus: {
93
+ type: sequelize_1.DataTypes.STRING,
94
+ allowNull: true,
95
+ },
96
+ cancelledAt: {
97
+ type: sequelize_1.DataTypes.DATE,
98
+ allowNull: true,
99
+ },
100
+ contactEmail: {
101
+ type: sequelize_1.DataTypes.STRING,
102
+ allowNull: true,
103
+ },
104
+ guestId: {
105
+ type: sequelize_1.DataTypes.UUID,
106
+ allowNull: true,
107
+ references: {
108
+ model: 'guests',
109
+ key: 'id',
110
+ },
111
+ onUpdate: 'CASCADE',
112
+ onDelete: 'SET NULL',
113
+ },
114
+ bookingCreatedEmailSent: {
115
+ type: sequelize_1.DataTypes.BOOLEAN,
116
+ allowNull: false,
117
+ defaultValue: false,
118
+ },
119
+ voucherAvailableEmailSent: {
120
+ type: sequelize_1.DataTypes.BOOLEAN,
121
+ allowNull: false,
122
+ defaultValue: false,
123
+ },
124
+ cancelledEmailSent: {
125
+ type: sequelize_1.DataTypes.BOOLEAN,
126
+ allowNull: false,
127
+ defaultValue: false,
128
+ },
129
+ createdAt: {
130
+ type: sequelize_1.DataTypes.DATE,
131
+ allowNull: false,
132
+ defaultValue: sequelize_1.DataTypes.NOW,
133
+ },
134
+ updatedAt: {
135
+ type: sequelize_1.DataTypes.DATE,
136
+ allowNull: false,
137
+ defaultValue: sequelize_1.DataTypes.NOW,
138
+ },
139
+ });
140
+ yield queryInterface.addIndex(TABLE_NAME, ['projectId'], {
141
+ name: PROJECT_ID_INDEX,
142
+ });
143
+ yield queryInterface.addIndex(TABLE_NAME, ['prebookId'], {
144
+ name: PREBOOK_ID_INDEX,
145
+ unique: true,
146
+ });
147
+ yield queryInterface.addIndex(TABLE_NAME, ['contactEmail'], {
148
+ name: CONTACT_EMAIL_INDEX,
149
+ });
150
+ yield queryInterface.addIndex(TABLE_NAME, ['guestId'], {
151
+ name: GUEST_ID_INDEX,
152
+ });
153
+ });
154
+ exports.up = up;
155
+ const down = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
156
+ yield queryInterface.dropTable(TABLE_NAME);
157
+ });
158
+ exports.down = down;
@@ -0,0 +1,30 @@
1
+ import { Model } from 'sequelize-typescript';
2
+ import { Project } from './Project';
3
+ import { Guest } from './Guest';
4
+ export declare class ExperienceBooking extends Model<Partial<ExperienceBooking>> {
5
+ id: string;
6
+ prebookId?: string;
7
+ experienceBookingId?: string;
8
+ projectId: string;
9
+ project?: Project;
10
+ provider?: string;
11
+ providerBookingHash?: string;
12
+ liteApiBookingData?: object;
13
+ liteApiPrebookData?: object;
14
+ bookingInputData?: object;
15
+ paymentData?: object;
16
+ bookingStatus?: string;
17
+ paymentStatus?: string;
18
+ paymentProvider?: string;
19
+ paymentMethod?: string;
20
+ refundStatus?: string;
21
+ cancelledAt?: Date;
22
+ contactEmail?: string;
23
+ guestId?: string;
24
+ guest?: Guest;
25
+ bookingCreatedEmailSent: boolean;
26
+ voucherAvailableEmailSent: boolean;
27
+ cancelledEmailSent: boolean;
28
+ createdAt: Date;
29
+ updatedAt: Date;
30
+ }
@@ -0,0 +1,213 @@
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.ExperienceBooking = void 0;
13
+ const sequelize_typescript_1 = require("sequelize-typescript");
14
+ const Project_1 = require("./Project");
15
+ const Guest_1 = require("./Guest");
16
+ let ExperienceBooking = class ExperienceBooking extends sequelize_typescript_1.Model {
17
+ };
18
+ exports.ExperienceBooking = ExperienceBooking;
19
+ __decorate([
20
+ (0, sequelize_typescript_1.IsUUID)(4),
21
+ sequelize_typescript_1.PrimaryKey,
22
+ (0, sequelize_typescript_1.Column)({
23
+ type: sequelize_typescript_1.DataType.UUID,
24
+ defaultValue: sequelize_typescript_1.DataType.UUIDV4,
25
+ }),
26
+ __metadata("design:type", String)
27
+ ], ExperienceBooking.prototype, "id", void 0);
28
+ __decorate([
29
+ sequelize_typescript_1.Unique,
30
+ sequelize_typescript_1.Index,
31
+ (0, sequelize_typescript_1.Column)({
32
+ type: sequelize_typescript_1.DataType.STRING,
33
+ allowNull: true,
34
+ }),
35
+ __metadata("design:type", String)
36
+ ], ExperienceBooking.prototype, "prebookId", void 0);
37
+ __decorate([
38
+ sequelize_typescript_1.Unique,
39
+ (0, sequelize_typescript_1.Column)({
40
+ type: sequelize_typescript_1.DataType.STRING,
41
+ allowNull: true,
42
+ }),
43
+ __metadata("design:type", String)
44
+ ], ExperienceBooking.prototype, "experienceBookingId", void 0);
45
+ __decorate([
46
+ (0, sequelize_typescript_1.ForeignKey)(() => Project_1.Project),
47
+ sequelize_typescript_1.Index,
48
+ (0, sequelize_typescript_1.Column)({
49
+ type: sequelize_typescript_1.DataType.UUID,
50
+ allowNull: false,
51
+ }),
52
+ __metadata("design:type", String)
53
+ ], ExperienceBooking.prototype, "projectId", void 0);
54
+ __decorate([
55
+ (0, sequelize_typescript_1.BelongsTo)(() => Project_1.Project),
56
+ __metadata("design:type", Project_1.Project)
57
+ ], ExperienceBooking.prototype, "project", void 0);
58
+ __decorate([
59
+ (0, sequelize_typescript_1.Column)({
60
+ type: sequelize_typescript_1.DataType.STRING,
61
+ allowNull: true,
62
+ }),
63
+ __metadata("design:type", String)
64
+ ], ExperienceBooking.prototype, "provider", void 0);
65
+ __decorate([
66
+ (0, sequelize_typescript_1.Column)({
67
+ type: sequelize_typescript_1.DataType.STRING,
68
+ allowNull: true,
69
+ }),
70
+ __metadata("design:type", String)
71
+ ], ExperienceBooking.prototype, "providerBookingHash", void 0);
72
+ __decorate([
73
+ (0, sequelize_typescript_1.Column)({
74
+ type: sequelize_typescript_1.DataType.JSONB,
75
+ allowNull: false,
76
+ defaultValue: {},
77
+ }),
78
+ __metadata("design:type", Object)
79
+ ], ExperienceBooking.prototype, "liteApiBookingData", void 0);
80
+ __decorate([
81
+ (0, sequelize_typescript_1.Column)({
82
+ type: sequelize_typescript_1.DataType.JSONB,
83
+ allowNull: false,
84
+ defaultValue: {},
85
+ }),
86
+ __metadata("design:type", Object)
87
+ ], ExperienceBooking.prototype, "liteApiPrebookData", void 0);
88
+ __decorate([
89
+ (0, sequelize_typescript_1.Column)({
90
+ type: sequelize_typescript_1.DataType.JSONB,
91
+ allowNull: false,
92
+ defaultValue: {},
93
+ }),
94
+ __metadata("design:type", Object)
95
+ ], ExperienceBooking.prototype, "bookingInputData", void 0);
96
+ __decorate([
97
+ (0, sequelize_typescript_1.Column)({
98
+ type: sequelize_typescript_1.DataType.JSONB,
99
+ allowNull: false,
100
+ defaultValue: {},
101
+ }),
102
+ __metadata("design:type", Object)
103
+ ], ExperienceBooking.prototype, "paymentData", void 0);
104
+ __decorate([
105
+ (0, sequelize_typescript_1.Column)({
106
+ type: sequelize_typescript_1.DataType.STRING,
107
+ allowNull: false,
108
+ defaultValue: '',
109
+ }),
110
+ __metadata("design:type", String)
111
+ ], ExperienceBooking.prototype, "bookingStatus", void 0);
112
+ __decorate([
113
+ (0, sequelize_typescript_1.Column)({
114
+ type: sequelize_typescript_1.DataType.STRING,
115
+ allowNull: false,
116
+ defaultValue: '',
117
+ }),
118
+ __metadata("design:type", String)
119
+ ], ExperienceBooking.prototype, "paymentStatus", 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
+ ], ExperienceBooking.prototype, "paymentProvider", void 0);
127
+ __decorate([
128
+ (0, sequelize_typescript_1.Column)({
129
+ type: sequelize_typescript_1.DataType.STRING,
130
+ allowNull: true,
131
+ }),
132
+ __metadata("design:type", String)
133
+ ], ExperienceBooking.prototype, "paymentMethod", 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
+ ], ExperienceBooking.prototype, "refundStatus", void 0);
141
+ __decorate([
142
+ (0, sequelize_typescript_1.Column)({
143
+ type: sequelize_typescript_1.DataType.DATE,
144
+ allowNull: true,
145
+ }),
146
+ __metadata("design:type", Date)
147
+ ], ExperienceBooking.prototype, "cancelledAt", void 0);
148
+ __decorate([
149
+ sequelize_typescript_1.Index,
150
+ (0, sequelize_typescript_1.Column)({
151
+ type: sequelize_typescript_1.DataType.STRING,
152
+ allowNull: true,
153
+ }),
154
+ __metadata("design:type", String)
155
+ ], ExperienceBooking.prototype, "contactEmail", void 0);
156
+ __decorate([
157
+ (0, sequelize_typescript_1.ForeignKey)(() => Guest_1.Guest),
158
+ sequelize_typescript_1.Index,
159
+ (0, sequelize_typescript_1.Column)({
160
+ type: sequelize_typescript_1.DataType.UUID,
161
+ allowNull: true,
162
+ }),
163
+ __metadata("design:type", String)
164
+ ], ExperienceBooking.prototype, "guestId", void 0);
165
+ __decorate([
166
+ (0, sequelize_typescript_1.BelongsTo)(() => Guest_1.Guest),
167
+ __metadata("design:type", Guest_1.Guest)
168
+ ], ExperienceBooking.prototype, "guest", void 0);
169
+ __decorate([
170
+ (0, sequelize_typescript_1.Column)({
171
+ type: sequelize_typescript_1.DataType.BOOLEAN,
172
+ allowNull: false,
173
+ defaultValue: false,
174
+ }),
175
+ __metadata("design:type", Boolean)
176
+ ], ExperienceBooking.prototype, "bookingCreatedEmailSent", void 0);
177
+ __decorate([
178
+ (0, sequelize_typescript_1.Column)({
179
+ type: sequelize_typescript_1.DataType.BOOLEAN,
180
+ allowNull: false,
181
+ defaultValue: false,
182
+ }),
183
+ __metadata("design:type", Boolean)
184
+ ], ExperienceBooking.prototype, "voucherAvailableEmailSent", void 0);
185
+ __decorate([
186
+ (0, sequelize_typescript_1.Column)({
187
+ type: sequelize_typescript_1.DataType.BOOLEAN,
188
+ allowNull: false,
189
+ defaultValue: false,
190
+ }),
191
+ __metadata("design:type", Boolean)
192
+ ], ExperienceBooking.prototype, "cancelledEmailSent", void 0);
193
+ __decorate([
194
+ (0, sequelize_typescript_1.Column)({
195
+ type: sequelize_typescript_1.DataType.DATE,
196
+ allowNull: false,
197
+ defaultValue: sequelize_typescript_1.DataType.NOW,
198
+ }),
199
+ __metadata("design:type", Date)
200
+ ], ExperienceBooking.prototype, "createdAt", void 0);
201
+ __decorate([
202
+ (0, sequelize_typescript_1.Column)({
203
+ type: sequelize_typescript_1.DataType.DATE,
204
+ allowNull: false,
205
+ defaultValue: sequelize_typescript_1.DataType.NOW,
206
+ }),
207
+ __metadata("design:type", Date)
208
+ ], ExperienceBooking.prototype, "updatedAt", void 0);
209
+ exports.ExperienceBooking = ExperienceBooking = __decorate([
210
+ (0, sequelize_typescript_1.Table)({
211
+ tableName: 'experience_bookings',
212
+ })
213
+ ], ExperienceBooking);
@@ -3,7 +3,8 @@ import { Project } from './Project';
3
3
  import { Guest } from './Guest';
4
4
  export declare class FlightBooking extends Model<Partial<FlightBooking>> {
5
5
  id: string;
6
- bookingId: string;
6
+ prebookId?: string;
7
+ bookingId?: string;
7
8
  projectId: string;
8
9
  project?: Project;
9
10
  ticketedEmailSent: boolean;
@@ -27,9 +27,18 @@ __decorate([
27
27
  ], FlightBooking.prototype, "id", void 0);
28
28
  __decorate([
29
29
  sequelize_typescript_1.Unique,
30
+ sequelize_typescript_1.Index,
30
31
  (0, sequelize_typescript_1.Column)({
31
32
  type: sequelize_typescript_1.DataType.STRING,
32
- allowNull: false,
33
+ allowNull: true,
34
+ }),
35
+ __metadata("design:type", String)
36
+ ], FlightBooking.prototype, "prebookId", void 0);
37
+ __decorate([
38
+ sequelize_typescript_1.Unique,
39
+ (0, sequelize_typescript_1.Column)({
40
+ type: sequelize_typescript_1.DataType.STRING,
41
+ allowNull: true,
33
42
  }),
34
43
  __metadata("design:type", String)
35
44
  ], FlightBooking.prototype, "bookingId", void 0);
@@ -7,6 +7,7 @@ import { Creator } from './Creator';
7
7
  import { Collection } from './Collection';
8
8
  import { LoyaltyProgram } from './LoyaltyProgram';
9
9
  import { FlightBooking } from './FlightBooking';
10
+ import { ExperienceBooking } from './ExperienceBooking';
10
11
  export declare class Project extends Model<Partial<Project>> {
11
12
  id: string;
12
13
  name: string;
@@ -20,6 +21,7 @@ export declare class Project extends Model<Partial<Project>> {
20
21
  agency?: Agency;
21
22
  bookings?: Booking[];
22
23
  flightBookings?: FlightBooking[];
24
+ experienceBookings?: ExperienceBooking[];
23
25
  creators?: Creator[];
24
26
  collections?: Collection[];
25
27
  loyaltyPrograms?: LoyaltyProgram[];
@@ -23,6 +23,7 @@ const Creator_1 = require("./Creator");
23
23
  const Collection_1 = require("./Collection");
24
24
  const LoyaltyProgram_1 = require("./LoyaltyProgram");
25
25
  const FlightBooking_1 = require("./FlightBooking");
26
+ const ExperienceBooking_1 = require("./ExperienceBooking");
26
27
  const clients = {};
27
28
  const clientV3 = {};
28
29
  const defaultLiteApiEnvironment = process.env.COPILOT_ENVIRONMENT_NAME === 'production' ? 'production' : 'dev';
@@ -153,6 +154,10 @@ __decorate([
153
154
  (0, sequelize_typescript_1.HasMany)(() => FlightBooking_1.FlightBooking),
154
155
  __metadata("design:type", Array)
155
156
  ], Project.prototype, "flightBookings", void 0);
157
+ __decorate([
158
+ (0, sequelize_typescript_1.HasMany)(() => ExperienceBooking_1.ExperienceBooking),
159
+ __metadata("design:type", Array)
160
+ ], Project.prototype, "experienceBookings", void 0);
156
161
  __decorate([
157
162
  (0, sequelize_typescript_1.HasMany)(() => Creator_1.Creator),
158
163
  __metadata("design:type", Array)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whitelabel-db",
3
- "version": "1.5.0",
3
+ "version": "1.7.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",