whitelabel-db 1.2.6 → 1.3.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 +4 -1
- package/dist/index.js +8 -1
- package/dist/libs/database.js +6 -0
- package/dist/libs/liteapiv3.d.ts +246 -0
- package/dist/libs/liteapiv3.js +48 -0
- package/dist/models/BookingLoyaltyRecord.d.ts +21 -0
- package/dist/models/BookingLoyaltyRecord.js +150 -0
- package/dist/models/LoyaltyProgram.d.ts +23 -0
- package/dist/models/LoyaltyProgram.js +142 -0
- package/dist/models/LoyaltyProgramTier.d.ts +26 -0
- package/dist/models/LoyaltyProgramTier.js +134 -0
- package/dist/models/Project.d.ts +2 -0
- package/dist/models/Project.js +5 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -26,6 +26,9 @@ export { Collection, CollectionStatus } from './models/Collection';
|
|
|
26
26
|
export { CollectionItem, CollectionType } from './models/CollectionItem';
|
|
27
27
|
export { CollectionItemCustomField } from './models/CollectionItemCustomField';
|
|
28
28
|
export { DeletedHotel } from './models/DeletedHotel';
|
|
29
|
+
export { LoyaltyProgram } from './models/LoyaltyProgram';
|
|
30
|
+
export { LoyaltyProgramTier } from './models/LoyaltyProgramTier';
|
|
31
|
+
export { BookingLoyaltyRecord } from './models/BookingLoyaltyRecord';
|
|
29
32
|
export { LiteApiClient, HotelsRequest, AvailabilityResult, FullRateAvailabilityResult, RoomType, Rate, PrebookRateRequest, PrebookRate, CheckoutRequest, BookingInfo, CancelBooking, } from './libs/liteapi';
|
|
30
|
-
export { LiteApiClientV3, HotelsRequestV3, AvailabilityResultV3, FullRateAvailabilityResultV3, RoomTypeV3, RateV3, PrebookRateRequestV3, PrebookRateV3, CheckoutRequestV3, BookingInfoV3, CancelBookingV3, BookedRoomV3, OccupancyV3, GuestV3, GuestBookingV3, PromoCodeRequest, PromoCodeResponse, EsimplyPackage, Addon, AddonResponse, } from './libs/liteapiv3';
|
|
33
|
+
export { LiteApiClientV3, HotelsRequestV3, AvailabilityResultV3, FullRateAvailabilityResultV3, RoomTypeV3, RateV3, PrebookRateRequestV3, PrebookRateV3, CheckoutRequestV3, BookingInfoV3, CancelBookingV3, BookedRoomV3, OccupancyV3, GuestV3, GuestBookingV3, PromoCodeRequest, PromoCodeResponse, EsimplyPackage, Addon, AddonResponse, GetHotelRequestV3, HotelDataV3, HotelImageV3, CheckinCheckoutTimesV3, LocationV3, FacilityV3, RoomV3, BedTypeV3, RoomAmenityV3, RoomPhotoV3, PolicyV3, AccessibilityV3, AccessibilityAttributesV3, AccessibilityDisabilitiesV3, AccessibilityDisabilityScoresV3, SentimentAnalysisV3, SentimentCategoryV3, SemanticSearchRequestV3, SemanticSearchHotelV3, ConversationalHotelRequestV3, ConversationalHotelResponseV3, } from './libs/liteapiv3';
|
|
31
34
|
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.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.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.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");
|
|
@@ -61,6 +61,13 @@ var CollectionItemCustomField_1 = require("./models/CollectionItemCustomField");
|
|
|
61
61
|
Object.defineProperty(exports, "CollectionItemCustomField", { enumerable: true, get: function () { return CollectionItemCustomField_1.CollectionItemCustomField; } });
|
|
62
62
|
var DeletedHotel_1 = require("./models/DeletedHotel");
|
|
63
63
|
Object.defineProperty(exports, "DeletedHotel", { enumerable: true, get: function () { return DeletedHotel_1.DeletedHotel; } });
|
|
64
|
+
// Loyalty Program models
|
|
65
|
+
var LoyaltyProgram_1 = require("./models/LoyaltyProgram");
|
|
66
|
+
Object.defineProperty(exports, "LoyaltyProgram", { enumerable: true, get: function () { return LoyaltyProgram_1.LoyaltyProgram; } });
|
|
67
|
+
var LoyaltyProgramTier_1 = require("./models/LoyaltyProgramTier");
|
|
68
|
+
Object.defineProperty(exports, "LoyaltyProgramTier", { enumerable: true, get: function () { return LoyaltyProgramTier_1.LoyaltyProgramTier; } });
|
|
69
|
+
var BookingLoyaltyRecord_1 = require("./models/BookingLoyaltyRecord");
|
|
70
|
+
Object.defineProperty(exports, "BookingLoyaltyRecord", { enumerable: true, get: function () { return BookingLoyaltyRecord_1.BookingLoyaltyRecord; } });
|
|
64
71
|
var liteapi_1 = require("./libs/liteapi");
|
|
65
72
|
Object.defineProperty(exports, "LiteApiClient", { enumerable: true, get: function () { return liteapi_1.LiteApiClient; } });
|
|
66
73
|
var liteapiv3_1 = require("./libs/liteapiv3");
|
package/dist/libs/database.js
CHANGED
|
@@ -37,6 +37,9 @@ const Collection_1 = require("../models/Collection");
|
|
|
37
37
|
const CollectionItem_1 = require("../models/CollectionItem");
|
|
38
38
|
const CollectionItemCustomField_1 = require("../models/CollectionItemCustomField");
|
|
39
39
|
const DeletedHotel_1 = require("../models/DeletedHotel");
|
|
40
|
+
const LoyaltyProgram_1 = require("../models/LoyaltyProgram");
|
|
41
|
+
const LoyaltyProgramTier_1 = require("../models/LoyaltyProgramTier");
|
|
42
|
+
const BookingLoyaltyRecord_1 = require("../models/BookingLoyaltyRecord");
|
|
40
43
|
const migration_1 = require("./migration");
|
|
41
44
|
const connect = (connectionDetails) => __awaiter(void 0, void 0, void 0, function* () {
|
|
42
45
|
const connection = new sequelize_typescript_1.Sequelize({
|
|
@@ -73,6 +76,9 @@ const connect = (connectionDetails) => __awaiter(void 0, void 0, void 0, functio
|
|
|
73
76
|
CollectionItem_1.CollectionItem,
|
|
74
77
|
CollectionItemCustomField_1.CollectionItemCustomField,
|
|
75
78
|
DeletedHotel_1.DeletedHotel,
|
|
79
|
+
LoyaltyProgram_1.LoyaltyProgram,
|
|
80
|
+
LoyaltyProgramTier_1.LoyaltyProgramTier,
|
|
81
|
+
BookingLoyaltyRecord_1.BookingLoyaltyRecord,
|
|
76
82
|
],
|
|
77
83
|
});
|
|
78
84
|
try {
|
package/dist/libs/liteapiv3.d.ts
CHANGED
|
@@ -368,6 +368,249 @@ export interface EsimplyPackage {
|
|
|
368
368
|
originalAmount: number;
|
|
369
369
|
originalCurrency: string;
|
|
370
370
|
}
|
|
371
|
+
export interface SemanticSearchRequestV3 {
|
|
372
|
+
query: string;
|
|
373
|
+
limit?: number;
|
|
374
|
+
}
|
|
375
|
+
export interface SemanticSearchHotelV3 {
|
|
376
|
+
id: string;
|
|
377
|
+
name: string;
|
|
378
|
+
main_photo: string;
|
|
379
|
+
address: string;
|
|
380
|
+
city: string;
|
|
381
|
+
country: string;
|
|
382
|
+
tags: string[];
|
|
383
|
+
score: number;
|
|
384
|
+
persona: string;
|
|
385
|
+
style: string;
|
|
386
|
+
location_type: string;
|
|
387
|
+
story: string;
|
|
388
|
+
}
|
|
389
|
+
export interface ConversationalHotelRequestV3 {
|
|
390
|
+
hotelId: string;
|
|
391
|
+
query: string;
|
|
392
|
+
allowWebSearch?: boolean;
|
|
393
|
+
}
|
|
394
|
+
export interface ConversationalHotelResponseV3 {
|
|
395
|
+
answer: string;
|
|
396
|
+
citations: string[];
|
|
397
|
+
latency_ms: number;
|
|
398
|
+
search_used: boolean;
|
|
399
|
+
}
|
|
400
|
+
export interface GetHotelRequestV3 {
|
|
401
|
+
hotelId: string;
|
|
402
|
+
timeout?: number;
|
|
403
|
+
language?: string;
|
|
404
|
+
advancedAccessibilityOnly?: boolean;
|
|
405
|
+
}
|
|
406
|
+
export interface HotelImageV3 {
|
|
407
|
+
url: string;
|
|
408
|
+
urlHd: string;
|
|
409
|
+
caption: string;
|
|
410
|
+
order: number;
|
|
411
|
+
defaultImage: boolean;
|
|
412
|
+
}
|
|
413
|
+
export interface CheckinCheckoutTimesV3 {
|
|
414
|
+
checkout: string;
|
|
415
|
+
checkin: string;
|
|
416
|
+
}
|
|
417
|
+
export interface LocationV3 {
|
|
418
|
+
latitude: number;
|
|
419
|
+
longitude: number;
|
|
420
|
+
}
|
|
421
|
+
export interface FacilityV3 {
|
|
422
|
+
facilityId: number;
|
|
423
|
+
name: string;
|
|
424
|
+
}
|
|
425
|
+
export interface BedTypeV3 {
|
|
426
|
+
quantity: number;
|
|
427
|
+
bedType: string;
|
|
428
|
+
bedSize: string;
|
|
429
|
+
}
|
|
430
|
+
export interface RoomAmenityV3 {
|
|
431
|
+
amenitiesId: number;
|
|
432
|
+
name: string;
|
|
433
|
+
sort: number;
|
|
434
|
+
}
|
|
435
|
+
export interface RoomPhotoV3 {
|
|
436
|
+
url: string;
|
|
437
|
+
imageDescription: string;
|
|
438
|
+
imageClass1: string;
|
|
439
|
+
imageClass2: string;
|
|
440
|
+
failoverPhoto: string;
|
|
441
|
+
mainPhoto: boolean;
|
|
442
|
+
score: number;
|
|
443
|
+
classId: number;
|
|
444
|
+
classOrder: number;
|
|
445
|
+
hd_url: string;
|
|
446
|
+
}
|
|
447
|
+
export interface RoomV3 {
|
|
448
|
+
id: number;
|
|
449
|
+
roomName: string;
|
|
450
|
+
description: string;
|
|
451
|
+
roomSizeSquare: number;
|
|
452
|
+
roomSizeUnit: string;
|
|
453
|
+
hotelId: string;
|
|
454
|
+
maxAdults: number;
|
|
455
|
+
maxChildren: number;
|
|
456
|
+
maxOccupancy: number;
|
|
457
|
+
bedTypes: BedTypeV3[];
|
|
458
|
+
roomAmenities: RoomAmenityV3[];
|
|
459
|
+
photos: RoomPhotoV3[];
|
|
460
|
+
views: any[];
|
|
461
|
+
bedRelation: string;
|
|
462
|
+
}
|
|
463
|
+
export interface PolicyV3 {
|
|
464
|
+
policy_type: string;
|
|
465
|
+
name: string;
|
|
466
|
+
description: string;
|
|
467
|
+
child_allowed: string;
|
|
468
|
+
pets_allowed: string;
|
|
469
|
+
parking: string;
|
|
470
|
+
}
|
|
471
|
+
export interface AccessibilityAttributesV3 {
|
|
472
|
+
publicArea: {
|
|
473
|
+
hillLocated: boolean;
|
|
474
|
+
isRamp: boolean;
|
|
475
|
+
rampAngle: number;
|
|
476
|
+
rampLength: number;
|
|
477
|
+
entranceType: string;
|
|
478
|
+
entranceDoorWidth: number;
|
|
479
|
+
entranceLeveled: boolean;
|
|
480
|
+
distanceFromTheElevatorToTheAccessibleRoom: number;
|
|
481
|
+
roomMaxGuestsNumber: number;
|
|
482
|
+
petFriendly: string;
|
|
483
|
+
};
|
|
484
|
+
receptionAndRestaurant: {
|
|
485
|
+
receptionHearingAccessible: boolean;
|
|
486
|
+
receptionWheelchairAccessible: boolean;
|
|
487
|
+
restaurantWheelchairAccessible: boolean;
|
|
488
|
+
};
|
|
489
|
+
elevator: {
|
|
490
|
+
elevatorAudioSignals: boolean;
|
|
491
|
+
elevatorBrailleNumbers: boolean;
|
|
492
|
+
elevatorContrastingButtons: boolean;
|
|
493
|
+
elevatorVisualSigns: boolean;
|
|
494
|
+
liftsAccessible: boolean;
|
|
495
|
+
};
|
|
496
|
+
room: {
|
|
497
|
+
brailleRoomNumbers: boolean;
|
|
498
|
+
noticeableRoomNumber: boolean;
|
|
499
|
+
roomDoorPeephole: boolean;
|
|
500
|
+
roomKnockSign: boolean;
|
|
501
|
+
serviceFromTv: boolean;
|
|
502
|
+
hearingKit: boolean;
|
|
503
|
+
tvAlarmClock: boolean;
|
|
504
|
+
accessibleRoomConnectingDoors: boolean;
|
|
505
|
+
ttyHearingSpeechImpaired: boolean;
|
|
506
|
+
};
|
|
507
|
+
toiletAndShower: {
|
|
508
|
+
toiletBathroomDoorsIndicator: boolean;
|
|
509
|
+
toiletGrabbingHandles: boolean;
|
|
510
|
+
adjustableShowerHead: boolean;
|
|
511
|
+
bathroomBathtub: boolean;
|
|
512
|
+
bathroomEmergencyCord: boolean;
|
|
513
|
+
bathtubGrabbingHandles: boolean;
|
|
514
|
+
cabinUnderSink: boolean;
|
|
515
|
+
showerChair: string;
|
|
516
|
+
showerLevelFloor: boolean;
|
|
517
|
+
};
|
|
518
|
+
stairs: {
|
|
519
|
+
isHandrails: boolean;
|
|
520
|
+
isStairMarked: boolean;
|
|
521
|
+
};
|
|
522
|
+
poolAndSpa: {
|
|
523
|
+
isPoolHandrails: boolean;
|
|
524
|
+
liftInPool: boolean;
|
|
525
|
+
spaWheelchairAccessible: boolean;
|
|
526
|
+
};
|
|
527
|
+
parking: {
|
|
528
|
+
parkingWheelchairAccessible: boolean;
|
|
529
|
+
};
|
|
530
|
+
publicToilets: {
|
|
531
|
+
publicToiletsEmergencyCord: boolean;
|
|
532
|
+
publicToiletsGrabbingHandles: boolean;
|
|
533
|
+
publicToiletsVisualIndicators: boolean;
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
export interface AccessibilityDisabilitiesV3 {
|
|
537
|
+
crouchesCaneImpaired: boolean;
|
|
538
|
+
elderlyImpaired: boolean;
|
|
539
|
+
electricWheelchair: boolean;
|
|
540
|
+
hearingImpaired: boolean;
|
|
541
|
+
manualWheelchair: boolean;
|
|
542
|
+
visuallyImpaired: boolean;
|
|
543
|
+
wheelchairOrScooterImpaired: boolean;
|
|
544
|
+
}
|
|
545
|
+
export interface AccessibilityDisabilityScoresV3 {
|
|
546
|
+
crouchesCaneImpaired: number;
|
|
547
|
+
elderlyImpaired: number;
|
|
548
|
+
electricWheelchair: number;
|
|
549
|
+
hearingImpaired: number;
|
|
550
|
+
manualWheelchair: number;
|
|
551
|
+
visuallyImpaired: number;
|
|
552
|
+
wheelchairOrScooterImpaired: number;
|
|
553
|
+
}
|
|
554
|
+
export interface AccessibilityV3 {
|
|
555
|
+
certificateId: string;
|
|
556
|
+
certificateUrl: string;
|
|
557
|
+
certificateHtml: string;
|
|
558
|
+
attributes: AccessibilityAttributesV3;
|
|
559
|
+
totalDisabilityScore: number;
|
|
560
|
+
disabilities: AccessibilityDisabilitiesV3;
|
|
561
|
+
disabilityScores: AccessibilityDisabilityScoresV3;
|
|
562
|
+
}
|
|
563
|
+
export interface SentimentCategoryV3 {
|
|
564
|
+
name: string;
|
|
565
|
+
rating: number;
|
|
566
|
+
description: string;
|
|
567
|
+
}
|
|
568
|
+
export interface SentimentAnalysisV3 {
|
|
569
|
+
cons: string[];
|
|
570
|
+
pros: string[];
|
|
571
|
+
categories: SentimentCategoryV3[];
|
|
572
|
+
}
|
|
573
|
+
export interface HotelDataV3 {
|
|
574
|
+
id: string;
|
|
575
|
+
name: string;
|
|
576
|
+
hotelDescription: string;
|
|
577
|
+
hotelImportantInformation: string;
|
|
578
|
+
primaryId: string;
|
|
579
|
+
hotelMarkdownDescription: string;
|
|
580
|
+
checkinCheckoutTimes: CheckinCheckoutTimesV3;
|
|
581
|
+
hotelImages: HotelImageV3[];
|
|
582
|
+
main_photo: string;
|
|
583
|
+
thumbnail: string;
|
|
584
|
+
country: string;
|
|
585
|
+
city: string;
|
|
586
|
+
starRating: number;
|
|
587
|
+
location: LocationV3;
|
|
588
|
+
address: string;
|
|
589
|
+
hotelFacilities: string[];
|
|
590
|
+
zip: string;
|
|
591
|
+
chainId: number;
|
|
592
|
+
chain: string;
|
|
593
|
+
facilities: FacilityV3[];
|
|
594
|
+
rooms: RoomV3[];
|
|
595
|
+
phone: string;
|
|
596
|
+
fax: string;
|
|
597
|
+
email: string;
|
|
598
|
+
hotelType: string;
|
|
599
|
+
hotelTypeId: number;
|
|
600
|
+
airportCode: string;
|
|
601
|
+
rating: number;
|
|
602
|
+
reviewCount: number;
|
|
603
|
+
parking: string;
|
|
604
|
+
groupRoomMin: number;
|
|
605
|
+
childAllowed: boolean;
|
|
606
|
+
petsAllowed: boolean;
|
|
607
|
+
policies: PolicyV3[];
|
|
608
|
+
rohId: number;
|
|
609
|
+
accessibility: AccessibilityV3;
|
|
610
|
+
sentiment_analysis: SentimentAnalysisV3;
|
|
611
|
+
sentiment_updated_at: string;
|
|
612
|
+
deletedAt: string | null;
|
|
613
|
+
}
|
|
371
614
|
export declare class LiteApiClientV3 {
|
|
372
615
|
private apiKey;
|
|
373
616
|
private baseUrl;
|
|
@@ -403,4 +646,7 @@ export declare class LiteApiClientV3 {
|
|
|
403
646
|
currency: string;
|
|
404
647
|
guestId: number;
|
|
405
648
|
}): Promise<PromoCodeResponse>;
|
|
649
|
+
semanticSearchHotels(options: SemanticSearchRequestV3): Promise<SemanticSearchHotelV3[]>;
|
|
650
|
+
askHotel(options: ConversationalHotelRequestV3): Promise<ConversationalHotelResponseV3>;
|
|
651
|
+
getHotel(options: GetHotelRequestV3): Promise<HotelDataV3>;
|
|
406
652
|
}
|
package/dist/libs/liteapiv3.js
CHANGED
|
@@ -277,5 +277,53 @@ class LiteApiClientV3 {
|
|
|
277
277
|
})).data.data;
|
|
278
278
|
});
|
|
279
279
|
}
|
|
280
|
+
semanticSearchHotels(options) {
|
|
281
|
+
var _a;
|
|
282
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
283
|
+
return (yield (0, axios_1.default)({
|
|
284
|
+
url: `${this.baseUrl}/v3.0/data/hotels/semantic-search`,
|
|
285
|
+
params: {
|
|
286
|
+
query: options.query,
|
|
287
|
+
limit: (_a = options.limit) !== null && _a !== void 0 ? _a : 3,
|
|
288
|
+
},
|
|
289
|
+
headers: {
|
|
290
|
+
'X-API-Key': this.apiKey,
|
|
291
|
+
},
|
|
292
|
+
})).data.data;
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
askHotel(options) {
|
|
296
|
+
var _a;
|
|
297
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
298
|
+
return (yield (0, axios_1.default)({
|
|
299
|
+
url: `${this.baseUrl}/v3.0/data/hotel/ask`,
|
|
300
|
+
params: {
|
|
301
|
+
hotelId: options.hotelId,
|
|
302
|
+
query: options.query,
|
|
303
|
+
allowWebSearch: (_a = options.allowWebSearch) !== null && _a !== void 0 ? _a : false,
|
|
304
|
+
},
|
|
305
|
+
headers: {
|
|
306
|
+
'X-API-Key': this.apiKey,
|
|
307
|
+
},
|
|
308
|
+
})).data.data;
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
getHotel(options) {
|
|
312
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
313
|
+
return (yield (0, axios_1.default)({
|
|
314
|
+
url: `${this.baseUrl}/v3.0/data/hotel`,
|
|
315
|
+
params: {
|
|
316
|
+
hotelId: options.hotelId,
|
|
317
|
+
timeout: options.timeout,
|
|
318
|
+
language: options.language,
|
|
319
|
+
advancedAccessibilityOnly: options.advancedAccessibilityOnly,
|
|
320
|
+
},
|
|
321
|
+
headers: {
|
|
322
|
+
'X-API-Key': this.apiKey,
|
|
323
|
+
accept: 'application/json',
|
|
324
|
+
},
|
|
325
|
+
})).data.data;
|
|
326
|
+
});
|
|
327
|
+
}
|
|
280
328
|
}
|
|
281
329
|
exports.LiteApiClientV3 = LiteApiClientV3;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Model } from 'sequelize-typescript';
|
|
2
|
+
import { Booking } from './Booking';
|
|
3
|
+
import { LoyaltyProgram } from './LoyaltyProgram';
|
|
4
|
+
import { EarnRule } from './LoyaltyProgramTier';
|
|
5
|
+
export declare class BookingLoyaltyRecord extends Model<Partial<BookingLoyaltyRecord>> {
|
|
6
|
+
id: string;
|
|
7
|
+
bookingId: string;
|
|
8
|
+
booking?: Booking;
|
|
9
|
+
loyaltyProgramId: string;
|
|
10
|
+
loyaltyProgram?: LoyaltyProgram;
|
|
11
|
+
membershipIdentifier?: string;
|
|
12
|
+
tierAtBooking?: string;
|
|
13
|
+
pointsEarned?: number;
|
|
14
|
+
pointsBurned: number;
|
|
15
|
+
earnRuleApplied?: EarnRule;
|
|
16
|
+
calculationMethod?: 'partner' | 'wl';
|
|
17
|
+
earnMultiplier?: number;
|
|
18
|
+
partnerResponse?: object;
|
|
19
|
+
createdAt: Date;
|
|
20
|
+
updatedAt: Date;
|
|
21
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
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.BookingLoyaltyRecord = void 0;
|
|
13
|
+
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
14
|
+
const Booking_1 = require("./Booking");
|
|
15
|
+
const LoyaltyProgram_1 = require("./LoyaltyProgram");
|
|
16
|
+
let BookingLoyaltyRecord = class BookingLoyaltyRecord extends sequelize_typescript_1.Model {
|
|
17
|
+
};
|
|
18
|
+
exports.BookingLoyaltyRecord = BookingLoyaltyRecord;
|
|
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
|
+
], BookingLoyaltyRecord.prototype, "id", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, sequelize_typescript_1.ForeignKey)(() => Booking_1.Booking),
|
|
30
|
+
sequelize_typescript_1.Index,
|
|
31
|
+
(0, sequelize_typescript_1.Column)({
|
|
32
|
+
type: sequelize_typescript_1.DataType.UUID,
|
|
33
|
+
allowNull: false,
|
|
34
|
+
comment: 'Foreign key to booking table',
|
|
35
|
+
}),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], BookingLoyaltyRecord.prototype, "bookingId", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, sequelize_typescript_1.BelongsTo)(() => Booking_1.Booking),
|
|
40
|
+
__metadata("design:type", Booking_1.Booking)
|
|
41
|
+
], BookingLoyaltyRecord.prototype, "booking", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, sequelize_typescript_1.ForeignKey)(() => LoyaltyProgram_1.LoyaltyProgram),
|
|
44
|
+
sequelize_typescript_1.Index,
|
|
45
|
+
(0, sequelize_typescript_1.Column)({
|
|
46
|
+
type: sequelize_typescript_1.DataType.UUID,
|
|
47
|
+
allowNull: false,
|
|
48
|
+
}),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], BookingLoyaltyRecord.prototype, "loyaltyProgramId", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, sequelize_typescript_1.BelongsTo)(() => LoyaltyProgram_1.LoyaltyProgram),
|
|
53
|
+
__metadata("design:type", LoyaltyProgram_1.LoyaltyProgram)
|
|
54
|
+
], BookingLoyaltyRecord.prototype, "loyaltyProgram", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, sequelize_typescript_1.Column)({
|
|
57
|
+
type: sequelize_typescript_1.DataType.STRING,
|
|
58
|
+
allowNull: true,
|
|
59
|
+
comment: 'Membership number supplied at booking',
|
|
60
|
+
}),
|
|
61
|
+
__metadata("design:type", String)
|
|
62
|
+
], BookingLoyaltyRecord.prototype, "membershipIdentifier", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, sequelize_typescript_1.Column)({
|
|
65
|
+
type: sequelize_typescript_1.DataType.STRING,
|
|
66
|
+
allowNull: true,
|
|
67
|
+
comment: 'Tier returned by partner at booking (optional)',
|
|
68
|
+
}),
|
|
69
|
+
__metadata("design:type", String)
|
|
70
|
+
], BookingLoyaltyRecord.prototype, "tierAtBooking", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, sequelize_typescript_1.Column)({
|
|
73
|
+
type: sequelize_typescript_1.DataType.INTEGER,
|
|
74
|
+
allowNull: true,
|
|
75
|
+
comment: 'Final points awarded (from partner or WL calc)',
|
|
76
|
+
}),
|
|
77
|
+
__metadata("design:type", Number)
|
|
78
|
+
], BookingLoyaltyRecord.prototype, "pointsEarned", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, sequelize_typescript_1.Column)({
|
|
81
|
+
type: sequelize_typescript_1.DataType.INTEGER,
|
|
82
|
+
allowNull: false,
|
|
83
|
+
defaultValue: 0,
|
|
84
|
+
comment: 'Future: points burned for this booking',
|
|
85
|
+
}),
|
|
86
|
+
__metadata("design:type", Number)
|
|
87
|
+
], BookingLoyaltyRecord.prototype, "pointsBurned", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, sequelize_typescript_1.Column)({
|
|
90
|
+
type: sequelize_typescript_1.DataType.JSONB,
|
|
91
|
+
allowNull: true,
|
|
92
|
+
comment: 'Snapshot of the earnRule used (includes tier overrides)',
|
|
93
|
+
}),
|
|
94
|
+
__metadata("design:type", Object)
|
|
95
|
+
], BookingLoyaltyRecord.prototype, "earnRuleApplied", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
(0, sequelize_typescript_1.Column)({
|
|
98
|
+
type: sequelize_typescript_1.DataType.STRING,
|
|
99
|
+
allowNull: true,
|
|
100
|
+
comment: 'Indicates whether pointsEarned came from "partner" or "wl"',
|
|
101
|
+
}),
|
|
102
|
+
__metadata("design:type", String)
|
|
103
|
+
], BookingLoyaltyRecord.prototype, "calculationMethod", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, sequelize_typescript_1.Column)({
|
|
106
|
+
type: sequelize_typescript_1.DataType.DECIMAL(10, 4),
|
|
107
|
+
allowNull: true,
|
|
108
|
+
comment: 'Legacy multiplier (kept for backward compat)',
|
|
109
|
+
}),
|
|
110
|
+
__metadata("design:type", Number)
|
|
111
|
+
], BookingLoyaltyRecord.prototype, "earnMultiplier", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
(0, sequelize_typescript_1.Column)({
|
|
114
|
+
type: sequelize_typescript_1.DataType.JSONB,
|
|
115
|
+
allowNull: true,
|
|
116
|
+
comment: 'Raw partner API response',
|
|
117
|
+
}),
|
|
118
|
+
__metadata("design:type", Object)
|
|
119
|
+
], BookingLoyaltyRecord.prototype, "partnerResponse", void 0);
|
|
120
|
+
__decorate([
|
|
121
|
+
(0, sequelize_typescript_1.Column)({
|
|
122
|
+
type: sequelize_typescript_1.DataType.DATE,
|
|
123
|
+
allowNull: false,
|
|
124
|
+
defaultValue: sequelize_typescript_1.DataType.NOW,
|
|
125
|
+
}),
|
|
126
|
+
__metadata("design:type", Date)
|
|
127
|
+
], BookingLoyaltyRecord.prototype, "createdAt", void 0);
|
|
128
|
+
__decorate([
|
|
129
|
+
(0, sequelize_typescript_1.Column)({
|
|
130
|
+
type: sequelize_typescript_1.DataType.DATE,
|
|
131
|
+
allowNull: false,
|
|
132
|
+
defaultValue: sequelize_typescript_1.DataType.NOW,
|
|
133
|
+
}),
|
|
134
|
+
__metadata("design:type", Date)
|
|
135
|
+
], BookingLoyaltyRecord.prototype, "updatedAt", void 0);
|
|
136
|
+
exports.BookingLoyaltyRecord = BookingLoyaltyRecord = __decorate([
|
|
137
|
+
(0, sequelize_typescript_1.Table)({
|
|
138
|
+
tableName: 'booking_loyalty_record',
|
|
139
|
+
indexes: [
|
|
140
|
+
{
|
|
141
|
+
fields: ['bookingId'],
|
|
142
|
+
name: 'idx_booking_loyalty_record_booking_id',
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
fields: ['loyaltyProgramId'],
|
|
146
|
+
name: 'idx_booking_loyalty_record_program_id',
|
|
147
|
+
},
|
|
148
|
+
],
|
|
149
|
+
})
|
|
150
|
+
], BookingLoyaltyRecord);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Model } from 'sequelize-typescript';
|
|
2
|
+
import { Project } from './Project';
|
|
3
|
+
import { LoyaltyProgramTier } from './LoyaltyProgramTier';
|
|
4
|
+
import { BookingLoyaltyRecord } from './BookingLoyaltyRecord';
|
|
5
|
+
export declare class LoyaltyProgram extends Model<Partial<LoyaltyProgram>> {
|
|
6
|
+
id: string;
|
|
7
|
+
projectId: string;
|
|
8
|
+
project?: Project;
|
|
9
|
+
name: string;
|
|
10
|
+
rewardType?: string;
|
|
11
|
+
validationMethod?: string;
|
|
12
|
+
minTransactionValue?: number;
|
|
13
|
+
rewardValueCurrency?: number;
|
|
14
|
+
rewardCurrency?: string;
|
|
15
|
+
rewardValuePoints?: number;
|
|
16
|
+
pointsAccrualTiming?: string;
|
|
17
|
+
settings?: object;
|
|
18
|
+
appearance?: object;
|
|
19
|
+
tiers?: LoyaltyProgramTier[];
|
|
20
|
+
bookingLoyaltyRecords?: BookingLoyaltyRecord[];
|
|
21
|
+
createdAt: Date;
|
|
22
|
+
updatedAt: Date;
|
|
23
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
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.LoyaltyProgram = void 0;
|
|
13
|
+
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
14
|
+
const Project_1 = require("./Project");
|
|
15
|
+
const LoyaltyProgramTier_1 = require("./LoyaltyProgramTier");
|
|
16
|
+
const BookingLoyaltyRecord_1 = require("./BookingLoyaltyRecord");
|
|
17
|
+
let LoyaltyProgram = class LoyaltyProgram extends sequelize_typescript_1.Model {
|
|
18
|
+
};
|
|
19
|
+
exports.LoyaltyProgram = LoyaltyProgram;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, sequelize_typescript_1.IsUUID)(4),
|
|
22
|
+
sequelize_typescript_1.PrimaryKey,
|
|
23
|
+
(0, sequelize_typescript_1.Column)({
|
|
24
|
+
type: sequelize_typescript_1.DataType.UUID,
|
|
25
|
+
defaultValue: sequelize_typescript_1.DataType.UUIDV4,
|
|
26
|
+
}),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], LoyaltyProgram.prototype, "id", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, sequelize_typescript_1.ForeignKey)(() => Project_1.Project),
|
|
31
|
+
sequelize_typescript_1.Index,
|
|
32
|
+
(0, sequelize_typescript_1.Column)({
|
|
33
|
+
type: sequelize_typescript_1.DataType.UUID,
|
|
34
|
+
allowNull: false,
|
|
35
|
+
}),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], LoyaltyProgram.prototype, "projectId", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, sequelize_typescript_1.BelongsTo)(() => Project_1.Project),
|
|
40
|
+
__metadata("design:type", Project_1.Project)
|
|
41
|
+
], LoyaltyProgram.prototype, "project", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, sequelize_typescript_1.Column)({
|
|
44
|
+
type: sequelize_typescript_1.DataType.STRING,
|
|
45
|
+
allowNull: false,
|
|
46
|
+
}),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], LoyaltyProgram.prototype, "name", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, sequelize_typescript_1.Column)({
|
|
51
|
+
type: sequelize_typescript_1.DataType.STRING,
|
|
52
|
+
allowNull: true,
|
|
53
|
+
}),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], LoyaltyProgram.prototype, "rewardType", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, sequelize_typescript_1.Column)({
|
|
58
|
+
type: sequelize_typescript_1.DataType.STRING,
|
|
59
|
+
allowNull: true,
|
|
60
|
+
}),
|
|
61
|
+
__metadata("design:type", String)
|
|
62
|
+
], LoyaltyProgram.prototype, "validationMethod", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, sequelize_typescript_1.Column)({
|
|
65
|
+
type: sequelize_typescript_1.DataType.DECIMAL(20, 2),
|
|
66
|
+
allowNull: true,
|
|
67
|
+
}),
|
|
68
|
+
__metadata("design:type", Number)
|
|
69
|
+
], LoyaltyProgram.prototype, "minTransactionValue", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, sequelize_typescript_1.Column)({
|
|
72
|
+
type: sequelize_typescript_1.DataType.DECIMAL(20, 2),
|
|
73
|
+
allowNull: true,
|
|
74
|
+
comment: 'Program-level currency unit per point',
|
|
75
|
+
}),
|
|
76
|
+
__metadata("design:type", Number)
|
|
77
|
+
], LoyaltyProgram.prototype, "rewardValueCurrency", 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
|
+
], LoyaltyProgram.prototype, "rewardCurrency", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, sequelize_typescript_1.Column)({
|
|
87
|
+
type: sequelize_typescript_1.DataType.INTEGER,
|
|
88
|
+
allowNull: true,
|
|
89
|
+
comment: 'Program-level points per unit',
|
|
90
|
+
}),
|
|
91
|
+
__metadata("design:type", Number)
|
|
92
|
+
], LoyaltyProgram.prototype, "rewardValuePoints", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
(0, sequelize_typescript_1.Column)({
|
|
95
|
+
type: sequelize_typescript_1.DataType.STRING,
|
|
96
|
+
allowNull: true,
|
|
97
|
+
}),
|
|
98
|
+
__metadata("design:type", String)
|
|
99
|
+
], LoyaltyProgram.prototype, "pointsAccrualTiming", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, sequelize_typescript_1.Column)({
|
|
102
|
+
type: sequelize_typescript_1.DataType.JSONB,
|
|
103
|
+
allowNull: true,
|
|
104
|
+
}),
|
|
105
|
+
__metadata("design:type", Object)
|
|
106
|
+
], LoyaltyProgram.prototype, "settings", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
(0, sequelize_typescript_1.Column)({
|
|
109
|
+
type: sequelize_typescript_1.DataType.JSONB,
|
|
110
|
+
allowNull: true,
|
|
111
|
+
}),
|
|
112
|
+
__metadata("design:type", Object)
|
|
113
|
+
], LoyaltyProgram.prototype, "appearance", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, sequelize_typescript_1.HasMany)(() => LoyaltyProgramTier_1.LoyaltyProgramTier),
|
|
116
|
+
__metadata("design:type", Array)
|
|
117
|
+
], LoyaltyProgram.prototype, "tiers", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
(0, sequelize_typescript_1.HasMany)(() => BookingLoyaltyRecord_1.BookingLoyaltyRecord),
|
|
120
|
+
__metadata("design:type", Array)
|
|
121
|
+
], LoyaltyProgram.prototype, "bookingLoyaltyRecords", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
(0, sequelize_typescript_1.Column)({
|
|
124
|
+
type: sequelize_typescript_1.DataType.DATE,
|
|
125
|
+
allowNull: false,
|
|
126
|
+
defaultValue: sequelize_typescript_1.DataType.NOW,
|
|
127
|
+
}),
|
|
128
|
+
__metadata("design:type", Date)
|
|
129
|
+
], LoyaltyProgram.prototype, "createdAt", void 0);
|
|
130
|
+
__decorate([
|
|
131
|
+
(0, sequelize_typescript_1.Column)({
|
|
132
|
+
type: sequelize_typescript_1.DataType.DATE,
|
|
133
|
+
allowNull: false,
|
|
134
|
+
defaultValue: sequelize_typescript_1.DataType.NOW,
|
|
135
|
+
}),
|
|
136
|
+
__metadata("design:type", Date)
|
|
137
|
+
], LoyaltyProgram.prototype, "updatedAt", void 0);
|
|
138
|
+
exports.LoyaltyProgram = LoyaltyProgram = __decorate([
|
|
139
|
+
(0, sequelize_typescript_1.Table)({
|
|
140
|
+
tableName: 'loyalty_program',
|
|
141
|
+
})
|
|
142
|
+
], LoyaltyProgram);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Model } from 'sequelize-typescript';
|
|
2
|
+
import { LoyaltyProgram } from './LoyaltyProgram';
|
|
3
|
+
export interface EarnRule {
|
|
4
|
+
type: 'multiplier' | 'static' | 'additive' | 'combined' | 'tierValueOverride';
|
|
5
|
+
multiplier?: number;
|
|
6
|
+
staticPoints?: number;
|
|
7
|
+
additivePoints?: number;
|
|
8
|
+
tierRewardValueCurrency?: number;
|
|
9
|
+
tierRewardValuePoints?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare class LoyaltyProgramTier extends Model<Partial<LoyaltyProgramTier>> {
|
|
12
|
+
id: string;
|
|
13
|
+
programId: string;
|
|
14
|
+
program?: LoyaltyProgram;
|
|
15
|
+
name: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
pointsRequired?: number;
|
|
18
|
+
nightsStayedRequired?: number;
|
|
19
|
+
bookingsCompletedRequired?: number;
|
|
20
|
+
earnRule?: EarnRule;
|
|
21
|
+
icon?: string;
|
|
22
|
+
color?: string;
|
|
23
|
+
displayOrder: number;
|
|
24
|
+
createdAt: Date;
|
|
25
|
+
updatedAt: Date;
|
|
26
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
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.LoyaltyProgramTier = void 0;
|
|
13
|
+
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
14
|
+
const LoyaltyProgram_1 = require("./LoyaltyProgram");
|
|
15
|
+
let LoyaltyProgramTier = class LoyaltyProgramTier extends sequelize_typescript_1.Model {
|
|
16
|
+
};
|
|
17
|
+
exports.LoyaltyProgramTier = LoyaltyProgramTier;
|
|
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
|
+
], LoyaltyProgramTier.prototype, "id", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, sequelize_typescript_1.ForeignKey)(() => LoyaltyProgram_1.LoyaltyProgram),
|
|
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
|
+
], LoyaltyProgramTier.prototype, "programId", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, sequelize_typescript_1.BelongsTo)(() => LoyaltyProgram_1.LoyaltyProgram),
|
|
38
|
+
__metadata("design:type", LoyaltyProgram_1.LoyaltyProgram)
|
|
39
|
+
], LoyaltyProgramTier.prototype, "program", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, sequelize_typescript_1.Column)({
|
|
42
|
+
type: sequelize_typescript_1.DataType.STRING,
|
|
43
|
+
allowNull: false,
|
|
44
|
+
}),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], LoyaltyProgramTier.prototype, "name", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, sequelize_typescript_1.Column)({
|
|
49
|
+
type: sequelize_typescript_1.DataType.TEXT,
|
|
50
|
+
allowNull: true,
|
|
51
|
+
}),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], LoyaltyProgramTier.prototype, "description", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, sequelize_typescript_1.Column)({
|
|
56
|
+
type: sequelize_typescript_1.DataType.INTEGER,
|
|
57
|
+
allowNull: true,
|
|
58
|
+
comment: 'Display-only qualification rule',
|
|
59
|
+
}),
|
|
60
|
+
__metadata("design:type", Number)
|
|
61
|
+
], LoyaltyProgramTier.prototype, "pointsRequired", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, sequelize_typescript_1.Column)({
|
|
64
|
+
type: sequelize_typescript_1.DataType.INTEGER,
|
|
65
|
+
allowNull: true,
|
|
66
|
+
comment: 'Display-only qualification rule',
|
|
67
|
+
}),
|
|
68
|
+
__metadata("design:type", Number)
|
|
69
|
+
], LoyaltyProgramTier.prototype, "nightsStayedRequired", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, sequelize_typescript_1.Column)({
|
|
72
|
+
type: sequelize_typescript_1.DataType.INTEGER,
|
|
73
|
+
allowNull: true,
|
|
74
|
+
comment: 'Display-only qualification rule',
|
|
75
|
+
}),
|
|
76
|
+
__metadata("design:type", Number)
|
|
77
|
+
], LoyaltyProgramTier.prototype, "bookingsCompletedRequired", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, sequelize_typescript_1.Column)({
|
|
80
|
+
type: sequelize_typescript_1.DataType.JSONB,
|
|
81
|
+
allowNull: true,
|
|
82
|
+
comment: 'Tier-level earn rules with optional overrides (type: multiplier|static|additive|combined|tierValueOverride)',
|
|
83
|
+
}),
|
|
84
|
+
__metadata("design:type", Object)
|
|
85
|
+
], LoyaltyProgramTier.prototype, "earnRule", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, sequelize_typescript_1.Column)({
|
|
88
|
+
type: sequelize_typescript_1.DataType.STRING,
|
|
89
|
+
allowNull: true,
|
|
90
|
+
}),
|
|
91
|
+
__metadata("design:type", String)
|
|
92
|
+
], LoyaltyProgramTier.prototype, "icon", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
(0, sequelize_typescript_1.Column)({
|
|
95
|
+
type: sequelize_typescript_1.DataType.STRING,
|
|
96
|
+
allowNull: true,
|
|
97
|
+
}),
|
|
98
|
+
__metadata("design:type", String)
|
|
99
|
+
], LoyaltyProgramTier.prototype, "color", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, sequelize_typescript_1.Column)({
|
|
102
|
+
type: sequelize_typescript_1.DataType.INTEGER,
|
|
103
|
+
allowNull: false,
|
|
104
|
+
defaultValue: 0,
|
|
105
|
+
}),
|
|
106
|
+
__metadata("design:type", Number)
|
|
107
|
+
], LoyaltyProgramTier.prototype, "displayOrder", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, sequelize_typescript_1.Column)({
|
|
110
|
+
type: sequelize_typescript_1.DataType.DATE,
|
|
111
|
+
allowNull: false,
|
|
112
|
+
defaultValue: sequelize_typescript_1.DataType.NOW,
|
|
113
|
+
}),
|
|
114
|
+
__metadata("design:type", Date)
|
|
115
|
+
], LoyaltyProgramTier.prototype, "createdAt", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
(0, sequelize_typescript_1.Column)({
|
|
118
|
+
type: sequelize_typescript_1.DataType.DATE,
|
|
119
|
+
allowNull: false,
|
|
120
|
+
defaultValue: sequelize_typescript_1.DataType.NOW,
|
|
121
|
+
}),
|
|
122
|
+
__metadata("design:type", Date)
|
|
123
|
+
], LoyaltyProgramTier.prototype, "updatedAt", void 0);
|
|
124
|
+
exports.LoyaltyProgramTier = LoyaltyProgramTier = __decorate([
|
|
125
|
+
(0, sequelize_typescript_1.Table)({
|
|
126
|
+
tableName: 'loyalty_program_tier',
|
|
127
|
+
indexes: [
|
|
128
|
+
{
|
|
129
|
+
fields: ['programId', 'displayOrder'],
|
|
130
|
+
name: 'idx_loyalty_program_tier_program_display_order',
|
|
131
|
+
},
|
|
132
|
+
],
|
|
133
|
+
})
|
|
134
|
+
], LoyaltyProgramTier);
|
package/dist/models/Project.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { LiteApiClientV3 } from '../libs/liteapiv3';
|
|
|
5
5
|
import { Booking } from './Booking';
|
|
6
6
|
import { Creator } from './Creator';
|
|
7
7
|
import { Collection } from './Collection';
|
|
8
|
+
import { LoyaltyProgram } from './LoyaltyProgram';
|
|
8
9
|
export declare class Project extends Model<Partial<Project>> {
|
|
9
10
|
id: string;
|
|
10
11
|
name: string;
|
|
@@ -19,6 +20,7 @@ export declare class Project extends Model<Partial<Project>> {
|
|
|
19
20
|
bookings?: Booking[];
|
|
20
21
|
creators?: Creator[];
|
|
21
22
|
collections?: Collection[];
|
|
23
|
+
loyaltyPrograms?: LoyaltyProgram[];
|
|
22
24
|
preferences?: object;
|
|
23
25
|
appearance?: object;
|
|
24
26
|
isActive?: boolean;
|
package/dist/models/Project.js
CHANGED
|
@@ -21,6 +21,7 @@ const liteapiv3_1 = require("../libs/liteapiv3");
|
|
|
21
21
|
const Booking_1 = require("./Booking");
|
|
22
22
|
const Creator_1 = require("./Creator");
|
|
23
23
|
const Collection_1 = require("./Collection");
|
|
24
|
+
const LoyaltyProgram_1 = require("./LoyaltyProgram");
|
|
24
25
|
const clients = {};
|
|
25
26
|
const clientV3 = {};
|
|
26
27
|
const defaultLiteApiEnvironment = process.env.COPILOT_ENVIRONMENT_NAME === 'production' ? 'production' : 'dev';
|
|
@@ -155,6 +156,10 @@ __decorate([
|
|
|
155
156
|
(0, sequelize_typescript_1.HasMany)(() => Collection_1.Collection),
|
|
156
157
|
__metadata("design:type", Array)
|
|
157
158
|
], Project.prototype, "collections", void 0);
|
|
159
|
+
__decorate([
|
|
160
|
+
(0, sequelize_typescript_1.HasMany)(() => LoyaltyProgram_1.LoyaltyProgram),
|
|
161
|
+
__metadata("design:type", Array)
|
|
162
|
+
], Project.prototype, "loyaltyPrograms", void 0);
|
|
158
163
|
__decorate([
|
|
159
164
|
(0, sequelize_typescript_1.Column)({
|
|
160
165
|
type: sequelize_typescript_1.DataType.JSONB,
|