@dv4resi/dvss-backend-module-offering-im 0.0.21 → 0.0.22
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 +174 -53
- package/dist/index.js +436 -106
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1207,9 +1207,9 @@ var Table = class Table2 {
|
|
|
1207
1207
|
[IsDrizzleTable] = true;
|
|
1208
1208
|
/** @internal */
|
|
1209
1209
|
[ExtraConfigBuilder] = void 0;
|
|
1210
|
-
constructor(name,
|
|
1210
|
+
constructor(name, schema5, baseName) {
|
|
1211
1211
|
this[TableName] = this[OriginalName] = name;
|
|
1212
|
-
this[Schema] =
|
|
1212
|
+
this[Schema] = schema5;
|
|
1213
1213
|
this[BaseName] = baseName;
|
|
1214
1214
|
}
|
|
1215
1215
|
};
|
|
@@ -2185,11 +2185,11 @@ var View = class View2 {
|
|
|
2185
2185
|
static [entityKind] = "View";
|
|
2186
2186
|
/** @internal */
|
|
2187
2187
|
[ViewBaseConfig];
|
|
2188
|
-
constructor({ name: name2, schema:
|
|
2188
|
+
constructor({ name: name2, schema: schema5, selectedFields, query }) {
|
|
2189
2189
|
this[ViewBaseConfig] = {
|
|
2190
2190
|
name: name2,
|
|
2191
2191
|
originalName: name2,
|
|
2192
|
-
schema:
|
|
2192
|
+
schema: schema5,
|
|
2193
2193
|
selectedFields,
|
|
2194
2194
|
query,
|
|
2195
2195
|
isExisting: !query,
|
|
@@ -2284,7 +2284,7 @@ function getTableColumns(table) {
|
|
|
2284
2284
|
}
|
|
2285
2285
|
__name(getTableColumns, "getTableColumns");
|
|
2286
2286
|
|
|
2287
|
-
// ../../packages/dvss-integration-libs/src/integration-common-utils/dao/integration-
|
|
2287
|
+
// ../../packages/dvss-integration-libs/src/integration-common-utils/dao/integration-booking.dao.ts
|
|
2288
2288
|
function _ts_decorate10(decorators, target, key, desc2) {
|
|
2289
2289
|
var c = arguments.length, r = c < 3 ? target : desc2 === null ? desc2 = Object.getOwnPropertyDescriptor(target, key) : desc2, d;
|
|
2290
2290
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc2);
|
|
@@ -2302,6 +2302,76 @@ function _ts_param(paramIndex, decorator) {
|
|
|
2302
2302
|
};
|
|
2303
2303
|
}
|
|
2304
2304
|
__name(_ts_param, "_ts_param");
|
|
2305
|
+
exports.IntegrationBookingDao = class IntegrationBookingDao {
|
|
2306
|
+
static {
|
|
2307
|
+
__name(this, "IntegrationBookingDao");
|
|
2308
|
+
}
|
|
2309
|
+
conn;
|
|
2310
|
+
logger;
|
|
2311
|
+
fileName = "integration-booking.dao";
|
|
2312
|
+
constructor(conn, logger) {
|
|
2313
|
+
this.conn = conn;
|
|
2314
|
+
this.logger = logger;
|
|
2315
|
+
}
|
|
2316
|
+
async getOfferingBookingOccurrence(input) {
|
|
2317
|
+
this.logger.debug(input.loggedInUserId, this.getOfferingBookingOccurrence.name, this.fileName, "Getting offering booking occurrence with input: ", input);
|
|
2318
|
+
const conditions = [
|
|
2319
|
+
isNull(dvssBackendModuleDatastore.schema.offeringBookingOccurrence.deletedAt),
|
|
2320
|
+
eq(dvssBackendModuleDatastore.schema.offeringBookingOccurrence.id, input.offeringBookingOccurrenceId),
|
|
2321
|
+
isNull(dvssBackendModuleDatastore.schema.offeringBooking.deletedAt),
|
|
2322
|
+
isNull(dvssBackendModuleDatastore.schema.offering.deletedAt)
|
|
2323
|
+
];
|
|
2324
|
+
if (input.offeringBookingId != null) {
|
|
2325
|
+
conditions.push(eq(dvssBackendModuleDatastore.schema.offeringBooking.id, input.offeringBookingId));
|
|
2326
|
+
}
|
|
2327
|
+
const result = await this.conn.select({
|
|
2328
|
+
offeringBookingOccurrence: dvssBackendModuleDatastore.schema.offeringBookingOccurrence,
|
|
2329
|
+
offering: dvssBackendModuleDatastore.schema.offering,
|
|
2330
|
+
offeringIntentId: dvssBackendModuleDatastore.schema.offeringBooking.offeringIntentId
|
|
2331
|
+
}).from(dvssBackendModuleDatastore.schema.offeringBookingOccurrence).innerJoin(dvssBackendModuleDatastore.schema.offeringBooking, eq(dvssBackendModuleDatastore.schema.offeringBookingOccurrence.offeringBookingId, dvssBackendModuleDatastore.schema.offeringBooking.id)).innerJoin(dvssBackendModuleDatastore.schema.offering, eq(dvssBackendModuleDatastore.schema.offeringBooking.offeringId, dvssBackendModuleDatastore.schema.offering.id)).where(and(...conditions)).limit(1);
|
|
2332
|
+
if (!result[0] || result[0].offeringIntentId == null) return void 0;
|
|
2333
|
+
return {
|
|
2334
|
+
offeringBookingOccurrence: result[0].offeringBookingOccurrence,
|
|
2335
|
+
offering: result[0].offering,
|
|
2336
|
+
offeringIntentId: result[0].offeringIntentId
|
|
2337
|
+
};
|
|
2338
|
+
}
|
|
2339
|
+
/**
|
|
2340
|
+
* Fetches offering intent by id.
|
|
2341
|
+
*/
|
|
2342
|
+
async getOfferingIntent(input) {
|
|
2343
|
+
const row = await this.conn.query.offeringIntent.findFirst({
|
|
2344
|
+
where: and(isNull(dvssBackendModuleDatastore.schema.offeringIntent.deletedAt), eq(dvssBackendModuleDatastore.schema.offeringIntent.id, input.offeringIntentId))
|
|
2345
|
+
});
|
|
2346
|
+
return row ?? void 0;
|
|
2347
|
+
}
|
|
2348
|
+
};
|
|
2349
|
+
exports.IntegrationBookingDao = _ts_decorate10([
|
|
2350
|
+
common.Injectable(),
|
|
2351
|
+
_ts_param(0, common.Inject(dvssBackendModuleDatastore.appConstants.DB_CONNECTION)),
|
|
2352
|
+
_ts_metadata7("design:type", Function),
|
|
2353
|
+
_ts_metadata7("design:paramtypes", [
|
|
2354
|
+
typeof MySql2Database === "undefined" ? Object : MySql2Database,
|
|
2355
|
+
typeof dvssBackendModuleUtility.LoggerService === "undefined" ? Object : dvssBackendModuleUtility.LoggerService
|
|
2356
|
+
])
|
|
2357
|
+
], exports.IntegrationBookingDao);
|
|
2358
|
+
function _ts_decorate11(decorators, target, key, desc2) {
|
|
2359
|
+
var c = arguments.length, r = c < 3 ? target : desc2 === null ? desc2 = Object.getOwnPropertyDescriptor(target, key) : desc2, d;
|
|
2360
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc2);
|
|
2361
|
+
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;
|
|
2362
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2363
|
+
}
|
|
2364
|
+
__name(_ts_decorate11, "_ts_decorate");
|
|
2365
|
+
function _ts_metadata8(k, v) {
|
|
2366
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
2367
|
+
}
|
|
2368
|
+
__name(_ts_metadata8, "_ts_metadata");
|
|
2369
|
+
function _ts_param2(paramIndex, decorator) {
|
|
2370
|
+
return function(target, key) {
|
|
2371
|
+
decorator(target, key, paramIndex);
|
|
2372
|
+
};
|
|
2373
|
+
}
|
|
2374
|
+
__name(_ts_param2, "_ts_param");
|
|
2305
2375
|
exports.IntegrationCommonDao = class IntegrationCommonDao {
|
|
2306
2376
|
static {
|
|
2307
2377
|
__name(this, "IntegrationCommonDao");
|
|
@@ -2360,32 +2430,32 @@ exports.IntegrationCommonDao = class IntegrationCommonDao {
|
|
|
2360
2430
|
return dvssBackendModuleUtility.DEFAULT_TIMEZONE;
|
|
2361
2431
|
}
|
|
2362
2432
|
};
|
|
2363
|
-
exports.IntegrationCommonDao =
|
|
2433
|
+
exports.IntegrationCommonDao = _ts_decorate11([
|
|
2364
2434
|
common.Injectable(),
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2435
|
+
_ts_param2(0, common.Inject(dvssBackendModuleDatastore.appConstants.DB_CONNECTION)),
|
|
2436
|
+
_ts_metadata8("design:type", Function),
|
|
2437
|
+
_ts_metadata8("design:paramtypes", [
|
|
2368
2438
|
typeof MySql2Database === "undefined" ? Object : MySql2Database,
|
|
2369
2439
|
typeof dvssBackendModuleUtility.LoggerService === "undefined" ? Object : dvssBackendModuleUtility.LoggerService
|
|
2370
2440
|
])
|
|
2371
2441
|
], exports.IntegrationCommonDao);
|
|
2372
|
-
function
|
|
2442
|
+
function _ts_decorate12(decorators, target, key, desc2) {
|
|
2373
2443
|
var c = arguments.length, r = c < 3 ? target : desc2 === null ? desc2 = Object.getOwnPropertyDescriptor(target, key) : desc2, d;
|
|
2374
2444
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc2);
|
|
2375
2445
|
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;
|
|
2376
2446
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2377
2447
|
}
|
|
2378
|
-
__name(
|
|
2379
|
-
function
|
|
2448
|
+
__name(_ts_decorate12, "_ts_decorate");
|
|
2449
|
+
function _ts_metadata9(k, v) {
|
|
2380
2450
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
2381
2451
|
}
|
|
2382
|
-
__name(
|
|
2383
|
-
function
|
|
2452
|
+
__name(_ts_metadata9, "_ts_metadata");
|
|
2453
|
+
function _ts_param3(paramIndex, decorator) {
|
|
2384
2454
|
return function(target, key) {
|
|
2385
2455
|
decorator(target, key, paramIndex);
|
|
2386
2456
|
};
|
|
2387
2457
|
}
|
|
2388
|
-
__name(
|
|
2458
|
+
__name(_ts_param3, "_ts_param");
|
|
2389
2459
|
exports.IntegrationConfigurationDao = class IntegrationConfigurationDao2 {
|
|
2390
2460
|
static {
|
|
2391
2461
|
__name(this, "IntegrationConfigurationDao");
|
|
@@ -2695,32 +2765,32 @@ exports.IntegrationConfigurationDao = class IntegrationConfigurationDao2 {
|
|
|
2695
2765
|
}
|
|
2696
2766
|
}
|
|
2697
2767
|
};
|
|
2698
|
-
exports.IntegrationConfigurationDao =
|
|
2768
|
+
exports.IntegrationConfigurationDao = _ts_decorate12([
|
|
2699
2769
|
common.Injectable(),
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2770
|
+
_ts_param3(0, common.Inject(dvssBackendModuleDatastore.appConstants.DB_CONNECTION)),
|
|
2771
|
+
_ts_metadata9("design:type", Function),
|
|
2772
|
+
_ts_metadata9("design:paramtypes", [
|
|
2703
2773
|
typeof MySql2Database === "undefined" ? Object : MySql2Database,
|
|
2704
2774
|
typeof dvssBackendModuleUtility.LoggerService === "undefined" ? Object : dvssBackendModuleUtility.LoggerService
|
|
2705
2775
|
])
|
|
2706
2776
|
], exports.IntegrationConfigurationDao);
|
|
2707
|
-
function
|
|
2777
|
+
function _ts_decorate13(decorators, target, key, desc2) {
|
|
2708
2778
|
var c = arguments.length, r = c < 3 ? target : desc2 === null ? desc2 = Object.getOwnPropertyDescriptor(target, key) : desc2, d;
|
|
2709
2779
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc2);
|
|
2710
2780
|
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;
|
|
2711
2781
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2712
2782
|
}
|
|
2713
|
-
__name(
|
|
2714
|
-
function
|
|
2783
|
+
__name(_ts_decorate13, "_ts_decorate");
|
|
2784
|
+
function _ts_metadata10(k, v) {
|
|
2715
2785
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
2716
2786
|
}
|
|
2717
|
-
__name(
|
|
2718
|
-
function
|
|
2787
|
+
__name(_ts_metadata10, "_ts_metadata");
|
|
2788
|
+
function _ts_param4(paramIndex, decorator) {
|
|
2719
2789
|
return function(target, key) {
|
|
2720
2790
|
decorator(target, key, paramIndex);
|
|
2721
2791
|
};
|
|
2722
2792
|
}
|
|
2723
|
-
__name(
|
|
2793
|
+
__name(_ts_param4, "_ts_param");
|
|
2724
2794
|
exports.IntegrationResourceManagementDao = class IntegrationResourceManagementDao {
|
|
2725
2795
|
static {
|
|
2726
2796
|
__name(this, "IntegrationResourceManagementDao");
|
|
@@ -2882,32 +2952,32 @@ exports.IntegrationResourceManagementDao = class IntegrationResourceManagementDa
|
|
|
2882
2952
|
}
|
|
2883
2953
|
}
|
|
2884
2954
|
};
|
|
2885
|
-
exports.IntegrationResourceManagementDao =
|
|
2955
|
+
exports.IntegrationResourceManagementDao = _ts_decorate13([
|
|
2886
2956
|
common.Injectable(),
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2957
|
+
_ts_param4(0, common.Inject(dvssBackendModuleDatastore.appConstants.DB_CONNECTION)),
|
|
2958
|
+
_ts_metadata10("design:type", Function),
|
|
2959
|
+
_ts_metadata10("design:paramtypes", [
|
|
2890
2960
|
typeof MySql2Database === "undefined" ? Object : MySql2Database,
|
|
2891
2961
|
typeof dvssBackendModuleUtility.LoggerService === "undefined" ? Object : dvssBackendModuleUtility.LoggerService
|
|
2892
2962
|
])
|
|
2893
2963
|
], exports.IntegrationResourceManagementDao);
|
|
2894
|
-
function
|
|
2964
|
+
function _ts_decorate14(decorators, target, key, desc2) {
|
|
2895
2965
|
var c = arguments.length, r = c < 3 ? target : desc2 === null ? desc2 = Object.getOwnPropertyDescriptor(target, key) : desc2, d;
|
|
2896
2966
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc2);
|
|
2897
2967
|
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;
|
|
2898
2968
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2899
2969
|
}
|
|
2900
|
-
__name(
|
|
2901
|
-
function
|
|
2970
|
+
__name(_ts_decorate14, "_ts_decorate");
|
|
2971
|
+
function _ts_metadata11(k, v) {
|
|
2902
2972
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
2903
2973
|
}
|
|
2904
|
-
__name(
|
|
2905
|
-
function
|
|
2974
|
+
__name(_ts_metadata11, "_ts_metadata");
|
|
2975
|
+
function _ts_param5(paramIndex, decorator) {
|
|
2906
2976
|
return function(target, key) {
|
|
2907
2977
|
decorator(target, key, paramIndex);
|
|
2908
2978
|
};
|
|
2909
2979
|
}
|
|
2910
|
-
__name(
|
|
2980
|
+
__name(_ts_param5, "_ts_param");
|
|
2911
2981
|
exports.IntegrationUserManagementDao = class IntegrationUserManagementDao {
|
|
2912
2982
|
static {
|
|
2913
2983
|
__name(this, "IntegrationUserManagementDao");
|
|
@@ -2917,25 +2987,25 @@ exports.IntegrationUserManagementDao = class IntegrationUserManagementDao {
|
|
|
2917
2987
|
this.conn = conn;
|
|
2918
2988
|
}
|
|
2919
2989
|
};
|
|
2920
|
-
exports.IntegrationUserManagementDao =
|
|
2990
|
+
exports.IntegrationUserManagementDao = _ts_decorate14([
|
|
2921
2991
|
common.Injectable(),
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2992
|
+
_ts_param5(0, common.Inject(dvssBackendModuleDatastore.appConstants.DB_CONNECTION)),
|
|
2993
|
+
_ts_metadata11("design:type", Function),
|
|
2994
|
+
_ts_metadata11("design:paramtypes", [
|
|
2925
2995
|
typeof MySql2Database === "undefined" ? Object : MySql2Database
|
|
2926
2996
|
])
|
|
2927
2997
|
], exports.IntegrationUserManagementDao);
|
|
2928
|
-
function
|
|
2998
|
+
function _ts_decorate15(decorators, target, key, desc2) {
|
|
2929
2999
|
var c = arguments.length, r = c < 3 ? target : desc2 === null ? desc2 = Object.getOwnPropertyDescriptor(target, key) : desc2, d;
|
|
2930
3000
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc2);
|
|
2931
3001
|
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;
|
|
2932
3002
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2933
3003
|
}
|
|
2934
|
-
__name(
|
|
2935
|
-
function
|
|
3004
|
+
__name(_ts_decorate15, "_ts_decorate");
|
|
3005
|
+
function _ts_metadata12(k, v) {
|
|
2936
3006
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
2937
3007
|
}
|
|
2938
|
-
__name(
|
|
3008
|
+
__name(_ts_metadata12, "_ts_metadata");
|
|
2939
3009
|
var AppService3 = class {
|
|
2940
3010
|
static {
|
|
2941
3011
|
__name(this, "AppService");
|
|
@@ -2950,24 +3020,24 @@ var AppService3 = class {
|
|
|
2950
3020
|
return "Hello World!";
|
|
2951
3021
|
}
|
|
2952
3022
|
};
|
|
2953
|
-
AppService3 =
|
|
3023
|
+
AppService3 = _ts_decorate15([
|
|
2954
3024
|
common.Injectable(),
|
|
2955
|
-
|
|
2956
|
-
|
|
3025
|
+
_ts_metadata12("design:type", Function),
|
|
3026
|
+
_ts_metadata12("design:paramtypes", [])
|
|
2957
3027
|
], AppService3);
|
|
2958
3028
|
|
|
2959
3029
|
// ../../packages/dvss-integration-trybe/src/app.controller.ts
|
|
2960
|
-
function
|
|
3030
|
+
function _ts_decorate16(decorators, target, key, desc2) {
|
|
2961
3031
|
var c = arguments.length, r = c < 3 ? target : desc2 === null ? desc2 = Object.getOwnPropertyDescriptor(target, key) : desc2, d;
|
|
2962
3032
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc2);
|
|
2963
3033
|
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;
|
|
2964
3034
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2965
3035
|
}
|
|
2966
|
-
__name(
|
|
2967
|
-
function
|
|
3036
|
+
__name(_ts_decorate16, "_ts_decorate");
|
|
3037
|
+
function _ts_metadata13(k, v) {
|
|
2968
3038
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
2969
3039
|
}
|
|
2970
|
-
__name(
|
|
3040
|
+
__name(_ts_metadata13, "_ts_metadata");
|
|
2971
3041
|
var AppController3 = class {
|
|
2972
3042
|
static {
|
|
2973
3043
|
__name(this, "AppController");
|
|
@@ -2980,30 +3050,30 @@ var AppController3 = class {
|
|
|
2980
3050
|
return this.appService.getHello();
|
|
2981
3051
|
}
|
|
2982
3052
|
};
|
|
2983
|
-
|
|
3053
|
+
_ts_decorate16([
|
|
2984
3054
|
common.Get("integration-trybe"),
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
3055
|
+
_ts_metadata13("design:type", Function),
|
|
3056
|
+
_ts_metadata13("design:paramtypes", []),
|
|
3057
|
+
_ts_metadata13("design:returntype", String)
|
|
2988
3058
|
], AppController3.prototype, "getHello", null);
|
|
2989
|
-
AppController3 =
|
|
3059
|
+
AppController3 = _ts_decorate16([
|
|
2990
3060
|
common.Controller(),
|
|
2991
|
-
|
|
2992
|
-
|
|
3061
|
+
_ts_metadata13("design:type", Function),
|
|
3062
|
+
_ts_metadata13("design:paramtypes", [
|
|
2993
3063
|
typeof AppService3 === "undefined" ? Object : AppService3
|
|
2994
3064
|
])
|
|
2995
3065
|
], AppController3);
|
|
2996
|
-
function
|
|
3066
|
+
function _ts_decorate17(decorators, target, key, desc2) {
|
|
2997
3067
|
var c = arguments.length, r = c < 3 ? target : desc2 === null ? desc2 = Object.getOwnPropertyDescriptor(target, key) : desc2, d;
|
|
2998
3068
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc2);
|
|
2999
3069
|
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;
|
|
3000
3070
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3001
3071
|
}
|
|
3002
|
-
__name(
|
|
3003
|
-
function
|
|
3072
|
+
__name(_ts_decorate17, "_ts_decorate");
|
|
3073
|
+
function _ts_metadata14(k, v) {
|
|
3004
3074
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
3005
3075
|
}
|
|
3006
|
-
__name(
|
|
3076
|
+
__name(_ts_metadata14, "_ts_metadata");
|
|
3007
3077
|
exports.TrybeCustomerManagement = class _TrybeCustomerManagement {
|
|
3008
3078
|
static {
|
|
3009
3079
|
__name(this, "TrybeCustomerManagement");
|
|
@@ -3119,10 +3189,10 @@ exports.TrybeCustomerManagement = class _TrybeCustomerManagement {
|
|
|
3119
3189
|
}
|
|
3120
3190
|
}
|
|
3121
3191
|
};
|
|
3122
|
-
exports.TrybeCustomerManagement =
|
|
3192
|
+
exports.TrybeCustomerManagement = _ts_decorate17([
|
|
3123
3193
|
common.Injectable(),
|
|
3124
|
-
|
|
3125
|
-
|
|
3194
|
+
_ts_metadata14("design:type", Function),
|
|
3195
|
+
_ts_metadata14("design:paramtypes", [
|
|
3126
3196
|
typeof dvssBackendModuleUtility.LoggerService === "undefined" ? Object : dvssBackendModuleUtility.LoggerService,
|
|
3127
3197
|
typeof exports.TrafficGatewayService === "undefined" ? Object : exports.TrafficGatewayService
|
|
3128
3198
|
])
|
|
@@ -3140,17 +3210,17 @@ function isValidHttpUrl(urlString) {
|
|
|
3140
3210
|
__name(isValidHttpUrl, "isValidHttpUrl");
|
|
3141
3211
|
|
|
3142
3212
|
// ../../packages/dvss-integration-trybe/src/capabilities/auth/auth.service.ts
|
|
3143
|
-
function
|
|
3213
|
+
function _ts_decorate18(decorators, target, key, desc2) {
|
|
3144
3214
|
var c = arguments.length, r = c < 3 ? target : desc2 === null ? desc2 = Object.getOwnPropertyDescriptor(target, key) : desc2, d;
|
|
3145
3215
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc2);
|
|
3146
3216
|
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;
|
|
3147
3217
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3148
3218
|
}
|
|
3149
|
-
__name(
|
|
3150
|
-
function
|
|
3219
|
+
__name(_ts_decorate18, "_ts_decorate");
|
|
3220
|
+
function _ts_metadata15(k, v) {
|
|
3151
3221
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
3152
3222
|
}
|
|
3153
|
-
__name(
|
|
3223
|
+
__name(_ts_metadata15, "_ts_metadata");
|
|
3154
3224
|
exports.TrybeAuthService = class _TrybeAuthService {
|
|
3155
3225
|
static {
|
|
3156
3226
|
__name(this, "TrybeAuthService");
|
|
@@ -3248,10 +3318,10 @@ exports.TrybeAuthService = class _TrybeAuthService {
|
|
|
3248
3318
|
throw new Error("Method not implemented.");
|
|
3249
3319
|
}
|
|
3250
3320
|
};
|
|
3251
|
-
exports.TrybeAuthService =
|
|
3321
|
+
exports.TrybeAuthService = _ts_decorate18([
|
|
3252
3322
|
common.Injectable(),
|
|
3253
|
-
|
|
3254
|
-
|
|
3323
|
+
_ts_metadata15("design:type", Function),
|
|
3324
|
+
_ts_metadata15("design:paramtypes", [
|
|
3255
3325
|
typeof exports.TrybeCustomerManagement === "undefined" ? Object : exports.TrybeCustomerManagement,
|
|
3256
3326
|
typeof dvssBackendModuleUtility.LoggerService === "undefined" ? Object : dvssBackendModuleUtility.LoggerService
|
|
3257
3327
|
])
|
|
@@ -3314,17 +3384,17 @@ function mapTrybeCreditsToSystem(res, integration) {
|
|
|
3314
3384
|
__name(mapTrybeCreditsToSystem, "mapTrybeCreditsToSystem");
|
|
3315
3385
|
|
|
3316
3386
|
// ../../packages/dvss-integration-trybe/src/capabilities/credit-management/credit-booking.service.ts
|
|
3317
|
-
function
|
|
3387
|
+
function _ts_decorate19(decorators, target, key, desc2) {
|
|
3318
3388
|
var c = arguments.length, r = c < 3 ? target : desc2 === null ? desc2 = Object.getOwnPropertyDescriptor(target, key) : desc2, d;
|
|
3319
3389
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc2);
|
|
3320
3390
|
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;
|
|
3321
3391
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3322
3392
|
}
|
|
3323
|
-
__name(
|
|
3324
|
-
function
|
|
3393
|
+
__name(_ts_decorate19, "_ts_decorate");
|
|
3394
|
+
function _ts_metadata16(k, v) {
|
|
3325
3395
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
3326
3396
|
}
|
|
3327
|
-
__name(
|
|
3397
|
+
__name(_ts_metadata16, "_ts_metadata");
|
|
3328
3398
|
exports.TrybeCreditBooking = class _TrybeCreditBooking {
|
|
3329
3399
|
static {
|
|
3330
3400
|
__name(this, "TrybeCreditBooking");
|
|
@@ -3382,10 +3452,10 @@ exports.TrybeCreditBooking = class _TrybeCreditBooking {
|
|
|
3382
3452
|
return mapTrybeCreditsToSystem(raw, validatedIntegration);
|
|
3383
3453
|
}
|
|
3384
3454
|
};
|
|
3385
|
-
exports.TrybeCreditBooking =
|
|
3455
|
+
exports.TrybeCreditBooking = _ts_decorate19([
|
|
3386
3456
|
common.Injectable(),
|
|
3387
|
-
|
|
3388
|
-
|
|
3457
|
+
_ts_metadata16("design:type", Function),
|
|
3458
|
+
_ts_metadata16("design:paramtypes", [
|
|
3389
3459
|
typeof dvssBackendModuleUtility.LoggerService === "undefined" ? Object : dvssBackendModuleUtility.LoggerService,
|
|
3390
3460
|
typeof exports.TrafficGatewayService === "undefined" ? Object : exports.TrafficGatewayService,
|
|
3391
3461
|
typeof exports.TrybeAuthService === "undefined" ? Object : exports.TrybeAuthService
|
|
@@ -3406,17 +3476,17 @@ function mapTrybeSiteResponseToSystem(response) {
|
|
|
3406
3476
|
__name(mapTrybeSiteResponseToSystem, "mapTrybeSiteResponseToSystem");
|
|
3407
3477
|
|
|
3408
3478
|
// ../../packages/dvss-integration-trybe/src/capabilities/integration-configuration/integration-configuration.service.ts
|
|
3409
|
-
function
|
|
3479
|
+
function _ts_decorate20(decorators, target, key, desc2) {
|
|
3410
3480
|
var c = arguments.length, r = c < 3 ? target : desc2 === null ? desc2 = Object.getOwnPropertyDescriptor(target, key) : desc2, d;
|
|
3411
3481
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc2);
|
|
3412
3482
|
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;
|
|
3413
3483
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3414
3484
|
}
|
|
3415
|
-
__name(
|
|
3416
|
-
function
|
|
3485
|
+
__name(_ts_decorate20, "_ts_decorate");
|
|
3486
|
+
function _ts_metadata17(k, v) {
|
|
3417
3487
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
3418
3488
|
}
|
|
3419
|
-
__name(
|
|
3489
|
+
__name(_ts_metadata17, "_ts_metadata");
|
|
3420
3490
|
exports.TrybeIntegrationConfigurationService = class TrybeIntegrationConfigurationService extends exports.BaseIntegrationConfiguration {
|
|
3421
3491
|
static {
|
|
3422
3492
|
__name(this, "TrybeIntegrationConfigurationService");
|
|
@@ -3477,10 +3547,10 @@ exports.TrybeIntegrationConfigurationService = class TrybeIntegrationConfigurati
|
|
|
3477
3547
|
return mapTrybeSiteResponseToSystem(response);
|
|
3478
3548
|
}
|
|
3479
3549
|
};
|
|
3480
|
-
exports.TrybeIntegrationConfigurationService =
|
|
3550
|
+
exports.TrybeIntegrationConfigurationService = _ts_decorate20([
|
|
3481
3551
|
common.Injectable(),
|
|
3482
|
-
|
|
3483
|
-
|
|
3552
|
+
_ts_metadata17("design:type", Function),
|
|
3553
|
+
_ts_metadata17("design:paramtypes", [
|
|
3484
3554
|
typeof exports.IntegrationConfigurationDao === "undefined" ? Object : exports.IntegrationConfigurationDao,
|
|
3485
3555
|
typeof dvssBackendModuleDatastore.CommonValidationDatabaseService === "undefined" ? Object : dvssBackendModuleDatastore.CommonValidationDatabaseService,
|
|
3486
3556
|
typeof dvssBackendModuleUtility.LoggerService === "undefined" ? Object : dvssBackendModuleUtility.LoggerService,
|
|
@@ -3502,17 +3572,17 @@ var TRYBE_CATALOGING_BY_ENUM = /* @__PURE__ */ (function(TRYBE_CATALOGING_BY_ENU
|
|
|
3502
3572
|
})({});
|
|
3503
3573
|
|
|
3504
3574
|
// ../../packages/dvss-integration-trybe/src/capabilities/integration-resource-management/integration-resource-management.service.ts
|
|
3505
|
-
function
|
|
3575
|
+
function _ts_decorate21(decorators, target, key, desc2) {
|
|
3506
3576
|
var c = arguments.length, r = c < 3 ? target : desc2 === null ? desc2 = Object.getOwnPropertyDescriptor(target, key) : desc2, d;
|
|
3507
3577
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc2);
|
|
3508
3578
|
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;
|
|
3509
3579
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3510
3580
|
}
|
|
3511
|
-
__name(
|
|
3512
|
-
function
|
|
3581
|
+
__name(_ts_decorate21, "_ts_decorate");
|
|
3582
|
+
function _ts_metadata18(k, v) {
|
|
3513
3583
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
3514
3584
|
}
|
|
3515
|
-
__name(
|
|
3585
|
+
__name(_ts_metadata18, "_ts_metadata");
|
|
3516
3586
|
var OFFERING_INTEGRATION_MAPPING_ALREADY_EXISTS = "OFFERING_INTEGRATION_MAPPING_ALREADY_EXISTS";
|
|
3517
3587
|
var VALID_JOURNEY_VALUES = /* @__PURE__ */ new Set([
|
|
3518
3588
|
"SESSION",
|
|
@@ -3583,10 +3653,10 @@ exports.TrybeIntegrationResourceManagementService = class TrybeIntegrationResour
|
|
|
3583
3653
|
return await super.updateOfferingIntegrationResourceConfiguration(input, context);
|
|
3584
3654
|
}
|
|
3585
3655
|
};
|
|
3586
|
-
exports.TrybeIntegrationResourceManagementService =
|
|
3656
|
+
exports.TrybeIntegrationResourceManagementService = _ts_decorate21([
|
|
3587
3657
|
common.Injectable(),
|
|
3588
|
-
|
|
3589
|
-
|
|
3658
|
+
_ts_metadata18("design:type", Function),
|
|
3659
|
+
_ts_metadata18("design:paramtypes", [
|
|
3590
3660
|
typeof dvssBackendModuleUtility.LoggerService === "undefined" ? Object : dvssBackendModuleUtility.LoggerService,
|
|
3591
3661
|
typeof exports.IntegrationResourceManagementDao === "undefined" ? Object : exports.IntegrationResourceManagementDao
|
|
3592
3662
|
])
|
|
@@ -3665,6 +3735,263 @@ var fetchAllPages = /* @__PURE__ */ __name(async (firstPageResponse, shouldFetch
|
|
|
3665
3735
|
}
|
|
3666
3736
|
return items;
|
|
3667
3737
|
}, "fetchAllPages");
|
|
3738
|
+
var getLocalDateAndTime = /* @__PURE__ */ __name((zone, utcDate = /* @__PURE__ */ new Date()) => {
|
|
3739
|
+
const localDateInZone = new Date(convertUTCDateToTimezoneDate(zone, new Date(utcDate)));
|
|
3740
|
+
const date = localDateInZone.toISOString().split("T")[0];
|
|
3741
|
+
const time = `${localDateInZone.getHours().toString().padStart(2, "0")}:${localDateInZone.getMinutes().toString().padStart(2, "0")}:${localDateInZone.getSeconds().toString().padStart(2, "0")}`;
|
|
3742
|
+
return {
|
|
3743
|
+
date,
|
|
3744
|
+
time
|
|
3745
|
+
};
|
|
3746
|
+
}, "getLocalDateAndTime");
|
|
3747
|
+
var convertUTCDateToTimezoneDate = /* @__PURE__ */ __name((zone, utcDate) => {
|
|
3748
|
+
const zoneOffset = dvssBackendModuleUtility.getCurrentOffsetFromTimezone(zone, utcDate);
|
|
3749
|
+
const zoneOffsetTimeStamp = zoneOffset * 60 * 1e3;
|
|
3750
|
+
const dateTimeStamp = utcDate.getTime() + zoneOffsetTimeStamp;
|
|
3751
|
+
return new Date(dateTimeStamp).toISOString();
|
|
3752
|
+
}, "convertUTCDateToTimezoneDate");
|
|
3753
|
+
function normalizeTimeOnly(time) {
|
|
3754
|
+
if (!time) {
|
|
3755
|
+
return "";
|
|
3756
|
+
}
|
|
3757
|
+
const parts = time.split(":");
|
|
3758
|
+
const hh = parts[0]?.padStart(2, "0") ?? "00";
|
|
3759
|
+
const mm = parts[1]?.padStart(2, "0") ?? "00";
|
|
3760
|
+
const ss = parts[2]?.padStart(2, "0") ?? "00";
|
|
3761
|
+
return `${hh}:${mm}:${ss}`;
|
|
3762
|
+
}
|
|
3763
|
+
__name(normalizeTimeOnly, "normalizeTimeOnly");
|
|
3764
|
+
function getSummaryLabelsInPropertyTimezone(timezone, summary) {
|
|
3765
|
+
if (!summary?.startTime || !summary.duration) {
|
|
3766
|
+
throw new dvssBackendModuleUtility.CustomException("BAD_REQUEST", void 0, "Missing start_time or duration in booking summary");
|
|
3767
|
+
}
|
|
3768
|
+
const start = new Date(summary.startTime);
|
|
3769
|
+
const durationMinutes = summary.duration;
|
|
3770
|
+
const end = new Date(start.getTime() + durationMinutes * 60 * 1e3);
|
|
3771
|
+
const startInTz = getLocalDateAndTime(timezone, start);
|
|
3772
|
+
const endInTz = getLocalDateAndTime(timezone, end);
|
|
3773
|
+
return {
|
|
3774
|
+
start,
|
|
3775
|
+
end,
|
|
3776
|
+
startDateLabel: startInTz.date,
|
|
3777
|
+
endDateLabel: endInTz.date,
|
|
3778
|
+
startTimeLabel: normalizeTimeOnly(startInTz.time.slice(0, 5)),
|
|
3779
|
+
endTimeLabel: normalizeTimeOnly(endInTz.time.slice(0, 5))
|
|
3780
|
+
};
|
|
3781
|
+
}
|
|
3782
|
+
__name(getSummaryLabelsInPropertyTimezone, "getSummaryLabelsInPropertyTimezone");
|
|
3783
|
+
|
|
3784
|
+
// ../../packages/dvss-integration-trybe/src/utils/webhook/trybe-webhook-util.ts
|
|
3785
|
+
function _ts_decorate22(decorators, target, key, desc2) {
|
|
3786
|
+
var c = arguments.length, r = c < 3 ? target : desc2 === null ? desc2 = Object.getOwnPropertyDescriptor(target, key) : desc2, d;
|
|
3787
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc2);
|
|
3788
|
+
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;
|
|
3789
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3790
|
+
}
|
|
3791
|
+
__name(_ts_decorate22, "_ts_decorate");
|
|
3792
|
+
function _ts_metadata19(k, v) {
|
|
3793
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
3794
|
+
}
|
|
3795
|
+
__name(_ts_metadata19, "_ts_metadata");
|
|
3796
|
+
exports.TrybeWebhookUtilService = class TrybeWebhookUtilService {
|
|
3797
|
+
static {
|
|
3798
|
+
__name(this, "TrybeWebhookUtilService");
|
|
3799
|
+
}
|
|
3800
|
+
integrationBookingDao;
|
|
3801
|
+
logger;
|
|
3802
|
+
fileName = "trybe-webhook-util";
|
|
3803
|
+
constructor(integrationBookingDao, logger) {
|
|
3804
|
+
this.integrationBookingDao = integrationBookingDao;
|
|
3805
|
+
this.logger = logger;
|
|
3806
|
+
}
|
|
3807
|
+
mapTrybeOrderToBookingInput(bookingData, userIdentityId, ids) {
|
|
3808
|
+
this.logger.debug(dvssBackendModuleUtility.SYSTEM_USER_ID, this.mapTrybeOrderToBookingInput.name, this.fileName, "Mapping Trybe order to booking input", {
|
|
3809
|
+
orderId: bookingData.orderId,
|
|
3810
|
+
bookingItems: bookingData.bookingItems,
|
|
3811
|
+
userIdentityId
|
|
3812
|
+
});
|
|
3813
|
+
const allBookingItems = bookingData.bookingItems ?? [];
|
|
3814
|
+
const bookingItems = allBookingItems.filter((item) => item.status === "confirmed");
|
|
3815
|
+
if (bookingItems.length === 0) {
|
|
3816
|
+
this.logger.warn(dvssBackendModuleUtility.SYSTEM_USER_ID, this.mapTrybeOrderToBookingInput.name, this.fileName, "No confirmed booking items in Trybe order; skipping booking creation", {
|
|
3817
|
+
orderId: bookingData.orderId,
|
|
3818
|
+
allItemsCount: allBookingItems.length,
|
|
3819
|
+
allItemStatuses: allBookingItems.map((b) => ({
|
|
3820
|
+
id: b.id,
|
|
3821
|
+
status: b.status
|
|
3822
|
+
}))
|
|
3823
|
+
});
|
|
3824
|
+
throw new dvssBackendModuleUtility.CustomException("BAD_REQUEST", void 0, "No confirmed booking items in order", {
|
|
3825
|
+
orderId: bookingData.orderId
|
|
3826
|
+
});
|
|
3827
|
+
}
|
|
3828
|
+
if (bookingItems.length > 1) {
|
|
3829
|
+
this.logger.warn(dvssBackendModuleUtility.SYSTEM_USER_ID, this.mapTrybeOrderToBookingInput.name, this.fileName, "Multiple confirmed booking items received from Trybe; processing only first", {
|
|
3830
|
+
orderId: bookingData.orderId,
|
|
3831
|
+
bookingItemIds: bookingItems.map((b) => b.id),
|
|
3832
|
+
totalConfirmedItems: bookingItems.length
|
|
3833
|
+
});
|
|
3834
|
+
}
|
|
3835
|
+
const primaryBookingItem = bookingItems[0];
|
|
3836
|
+
const bookingSummary = primaryBookingItem.bookingSummary;
|
|
3837
|
+
const isCourse = primaryBookingItem.itemType === "course";
|
|
3838
|
+
let bookingStartDateLabel;
|
|
3839
|
+
let bookingStartTimeLabel;
|
|
3840
|
+
let bookingEndTimeLabel;
|
|
3841
|
+
let durationInMinutes;
|
|
3842
|
+
if (isCourse) {
|
|
3843
|
+
const orderCreatedAt = bookingData.createdAt ? new Date(bookingData.createdAt) : /* @__PURE__ */ new Date();
|
|
3844
|
+
bookingStartDateLabel = orderCreatedAt.toISOString().split("T")[0];
|
|
3845
|
+
bookingStartTimeLabel = orderCreatedAt.toTimeString().slice(0, 5);
|
|
3846
|
+
durationInMinutes = void 0;
|
|
3847
|
+
this.logger.info(dvssBackendModuleUtility.SYSTEM_USER_ID, this.mapTrybeOrderToBookingInput.name, this.fileName, "Course booking detected - using order created_at as booking date/time", {
|
|
3848
|
+
orderId: bookingData.orderId,
|
|
3849
|
+
bookingItemId: primaryBookingItem.id,
|
|
3850
|
+
typeId: primaryBookingItem.typeId,
|
|
3851
|
+
bookingStartDateLabel,
|
|
3852
|
+
bookingStartTimeLabel
|
|
3853
|
+
});
|
|
3854
|
+
} else {
|
|
3855
|
+
if (!bookingSummary) {
|
|
3856
|
+
throw new dvssBackendModuleUtility.CustomException("BAD_REQUEST", void 0, "No booking summary in primary booking item", {
|
|
3857
|
+
orderId: bookingData.orderId,
|
|
3858
|
+
bookingItemId: primaryBookingItem.id
|
|
3859
|
+
});
|
|
3860
|
+
}
|
|
3861
|
+
const timezoneForLabels = ids.propertyTimezone ?? dvssBackendModuleUtility.DEFAULT_TIMEZONE;
|
|
3862
|
+
const durationFromPayload = typeof bookingSummary.duration === "number" ? bookingSummary.duration : void 0;
|
|
3863
|
+
if (durationFromPayload === void 0) {
|
|
3864
|
+
this.logger.warn(dvssBackendModuleUtility.SYSTEM_USER_ID, this.mapTrybeOrderToBookingInput.name, this.fileName, "Duration is missing from booking summary, skipping booking creation", {
|
|
3865
|
+
orderId: bookingData.orderId,
|
|
3866
|
+
bookingItemId: primaryBookingItem.id,
|
|
3867
|
+
bookingSummary
|
|
3868
|
+
});
|
|
3869
|
+
throw new dvssBackendModuleUtility.CustomException("BAD_REQUEST", void 0, "Duration is missing from booking summary", {
|
|
3870
|
+
orderId: bookingData.orderId,
|
|
3871
|
+
bookingItemId: primaryBookingItem.id
|
|
3872
|
+
});
|
|
3873
|
+
}
|
|
3874
|
+
const labels = getSummaryLabelsInPropertyTimezone(timezoneForLabels, {
|
|
3875
|
+
startTime: bookingSummary.startTime,
|
|
3876
|
+
duration: durationFromPayload
|
|
3877
|
+
});
|
|
3878
|
+
bookingStartDateLabel = labels.startDateLabel;
|
|
3879
|
+
bookingStartTimeLabel = labels.startTimeLabel;
|
|
3880
|
+
bookingEndTimeLabel = labels.endTimeLabel;
|
|
3881
|
+
durationInMinutes = durationFromPayload;
|
|
3882
|
+
}
|
|
3883
|
+
const totalCost = bookingData.totalCost;
|
|
3884
|
+
const totalPaidOrAuthed = Number(bookingData.totalPaidOrAuthed) || 0;
|
|
3885
|
+
const dueAmount = totalCost - totalPaidOrAuthed;
|
|
3886
|
+
const paymentStatus = dueAmount === 0 ? "paid" : "unpaid";
|
|
3887
|
+
const bookingInput = {
|
|
3888
|
+
name: `Booking from Trybe Order ${bookingData.orderRef || bookingData.orderId}`,
|
|
3889
|
+
description: `Booking created from Trybe order ${bookingData.orderId}`,
|
|
3890
|
+
offeringId: ids.offeringId,
|
|
3891
|
+
offeringIntentId: ids.intentId,
|
|
3892
|
+
offeringJourneyId: ids.journeyId,
|
|
3893
|
+
projectId: ids.projectId,
|
|
3894
|
+
propertyId: ids.propertyId,
|
|
3895
|
+
bookingStartDateLabel,
|
|
3896
|
+
bookingStartTimeLabel,
|
|
3897
|
+
bookingEndTimeLabel,
|
|
3898
|
+
durationInMinutes,
|
|
3899
|
+
items: bookingItems.map((b) => ({
|
|
3900
|
+
externalId: b.typeId,
|
|
3901
|
+
type: this.mapTrybeItemTypeToEnum(b.itemType),
|
|
3902
|
+
resources: b.bookingSummary?.practitioners?.map((p) => ({
|
|
3903
|
+
id: p.id,
|
|
3904
|
+
type: dvssBackendModuleUtility.OFFERING_RESOURCE_TYPE.PEOPLE
|
|
3905
|
+
})) ?? []
|
|
3906
|
+
})),
|
|
3907
|
+
meta: {
|
|
3908
|
+
createdViaWebhook: true,
|
|
3909
|
+
externalId: bookingData.orderId,
|
|
3910
|
+
orderRef: bookingData.orderRef,
|
|
3911
|
+
items: bookingItems.map((b) => ({
|
|
3912
|
+
id: b.id,
|
|
3913
|
+
externalId: b.typeId,
|
|
3914
|
+
type: this.mapTrybeItemTypeToEnum(b.itemType),
|
|
3915
|
+
name: b.typeName,
|
|
3916
|
+
totalPrice: b.totalCost
|
|
3917
|
+
})),
|
|
3918
|
+
payments: bookingData.payments,
|
|
3919
|
+
totalCost,
|
|
3920
|
+
totalPaidOrAuthed,
|
|
3921
|
+
dueAmount,
|
|
3922
|
+
paymentStatus
|
|
3923
|
+
},
|
|
3924
|
+
requestedForUserIdentityId: userIdentityId,
|
|
3925
|
+
bookingType: dvssBackendModuleDatastore.OFFERING_BOOKING_TYPE_ENUM.USER,
|
|
3926
|
+
shouldNotifyUsers: true
|
|
3927
|
+
};
|
|
3928
|
+
return bookingInput;
|
|
3929
|
+
}
|
|
3930
|
+
async mapTrybeOrderToUpdateOfferingBookingStatusInput(offeringBookingOccurrenceId, offeringBookingId, targetStatusCategory, note) {
|
|
3931
|
+
this.logger.debug(dvssBackendModuleUtility.SYSTEM_USER_ID, this.mapTrybeOrderToUpdateOfferingBookingStatusInput.name, this.fileName, "Mapping Trybe order to cancel booking input", {
|
|
3932
|
+
offeringBookingOccurrenceId,
|
|
3933
|
+
offeringBookingId,
|
|
3934
|
+
targetStatusCategory,
|
|
3935
|
+
note
|
|
3936
|
+
});
|
|
3937
|
+
const occurrence = await this.integrationBookingDao.getOfferingBookingOccurrence({
|
|
3938
|
+
offeringBookingOccurrenceId,
|
|
3939
|
+
loggedInUserId: dvssBackendModuleUtility.SYSTEM_USER_ID,
|
|
3940
|
+
offeringBookingId
|
|
3941
|
+
});
|
|
3942
|
+
if (!occurrence) {
|
|
3943
|
+
throw new dvssBackendModuleUtility.CustomException("BAD_REQUEST", void 0, "Offering booking occurrence not found", {
|
|
3944
|
+
offeringBookingOccurrenceId,
|
|
3945
|
+
offeringBookingId
|
|
3946
|
+
});
|
|
3947
|
+
}
|
|
3948
|
+
const intent = await this.integrationBookingDao.getOfferingIntent({
|
|
3949
|
+
offeringIntentId: occurrence.offeringIntentId
|
|
3950
|
+
});
|
|
3951
|
+
if (!intent) {
|
|
3952
|
+
throw new dvssBackendModuleUtility.CustomException("BAD_REQUEST", void 0, "Offering intent not found", {
|
|
3953
|
+
offeringIntentId: occurrence.offeringIntentId
|
|
3954
|
+
});
|
|
3955
|
+
}
|
|
3956
|
+
const statusInput = {
|
|
3957
|
+
offeringId: occurrence.offering.id,
|
|
3958
|
+
offeringBookingOccurrenceIds: [
|
|
3959
|
+
offeringBookingOccurrenceId
|
|
3960
|
+
],
|
|
3961
|
+
targetStatusCategory,
|
|
3962
|
+
note
|
|
3963
|
+
};
|
|
3964
|
+
const response = {
|
|
3965
|
+
statusInput,
|
|
3966
|
+
occurrence: occurrence.offeringBookingOccurrence,
|
|
3967
|
+
offering: occurrence.offering,
|
|
3968
|
+
offeringIntent: intent
|
|
3969
|
+
};
|
|
3970
|
+
return response;
|
|
3971
|
+
}
|
|
3972
|
+
mapTrybeItemTypeToEnum(trybeItemType) {
|
|
3973
|
+
switch (trybeItemType) {
|
|
3974
|
+
case "appointment":
|
|
3975
|
+
return dvssBackendModuleDatastore.OFFERING_BOOKING_BOOKED_ITEM_TYPE.APPOINTMENT;
|
|
3976
|
+
case "session":
|
|
3977
|
+
return dvssBackendModuleDatastore.OFFERING_BOOKING_BOOKED_ITEM_TYPE.SESSION;
|
|
3978
|
+
case "course":
|
|
3979
|
+
return dvssBackendModuleDatastore.OFFERING_BOOKING_BOOKED_ITEM_TYPE.COURSE;
|
|
3980
|
+
default: {
|
|
3981
|
+
const invalid = trybeItemType;
|
|
3982
|
+
throw new dvssBackendModuleUtility.CustomException("BAD_REQUEST", void 0, `Invalid Trybe item type: ${invalid}`);
|
|
3983
|
+
}
|
|
3984
|
+
}
|
|
3985
|
+
}
|
|
3986
|
+
};
|
|
3987
|
+
exports.TrybeWebhookUtilService = _ts_decorate22([
|
|
3988
|
+
common.Injectable(),
|
|
3989
|
+
_ts_metadata19("design:type", Function),
|
|
3990
|
+
_ts_metadata19("design:paramtypes", [
|
|
3991
|
+
typeof exports.IntegrationBookingDao === "undefined" ? Object : exports.IntegrationBookingDao,
|
|
3992
|
+
typeof dvssBackendModuleUtility.LoggerService === "undefined" ? Object : dvssBackendModuleUtility.LoggerService
|
|
3993
|
+
])
|
|
3994
|
+
], exports.TrybeWebhookUtilService);
|
|
3668
3995
|
var TRYBE_WEEKDAYS_MAPPING = {
|
|
3669
3996
|
monday: models.DAY_OF_WEEK.MON,
|
|
3670
3997
|
tuesday: models.DAY_OF_WEEK.TUE,
|
|
@@ -4057,17 +4384,17 @@ function mapTrybeAppointmentAvailabilityToSystemResponse(slots) {
|
|
|
4057
4384
|
__name(mapTrybeAppointmentAvailabilityToSystemResponse, "mapTrybeAppointmentAvailabilityToSystemResponse");
|
|
4058
4385
|
|
|
4059
4386
|
// ../../packages/dvss-integration-trybe/src/capabilities/wellness/wellness-management.service.ts
|
|
4060
|
-
function
|
|
4387
|
+
function _ts_decorate23(decorators, target, key, desc2) {
|
|
4061
4388
|
var c = arguments.length, r = c < 3 ? target : desc2 === null ? desc2 = Object.getOwnPropertyDescriptor(target, key) : desc2, d;
|
|
4062
4389
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc2);
|
|
4063
4390
|
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;
|
|
4064
4391
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4065
4392
|
}
|
|
4066
|
-
__name(
|
|
4067
|
-
function
|
|
4393
|
+
__name(_ts_decorate23, "_ts_decorate");
|
|
4394
|
+
function _ts_metadata20(k, v) {
|
|
4068
4395
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
4069
4396
|
}
|
|
4070
|
-
__name(
|
|
4397
|
+
__name(_ts_metadata20, "_ts_metadata");
|
|
4071
4398
|
exports.TrybeWellnessManagement = class _TrybeWellnessManagement {
|
|
4072
4399
|
static {
|
|
4073
4400
|
__name(this, "TrybeWellnessManagement");
|
|
@@ -4850,10 +5177,10 @@ exports.TrybeWellnessManagement = class _TrybeWellnessManagement {
|
|
|
4850
5177
|
}
|
|
4851
5178
|
}
|
|
4852
5179
|
};
|
|
4853
|
-
exports.TrybeWellnessManagement =
|
|
5180
|
+
exports.TrybeWellnessManagement = _ts_decorate23([
|
|
4854
5181
|
common.Injectable(),
|
|
4855
|
-
|
|
4856
|
-
|
|
5182
|
+
_ts_metadata20("design:type", Function),
|
|
5183
|
+
_ts_metadata20("design:paramtypes", [
|
|
4857
5184
|
typeof dvssBackendModuleUtility.LoggerService === "undefined" ? Object : dvssBackendModuleUtility.LoggerService,
|
|
4858
5185
|
typeof exports.TrafficGatewayService === "undefined" ? Object : exports.TrafficGatewayService,
|
|
4859
5186
|
typeof exports.TrybeAuthService === "undefined" ? Object : exports.TrybeAuthService,
|
|
@@ -4866,19 +5193,19 @@ dotenv.config({
|
|
|
4866
5193
|
});
|
|
4867
5194
|
|
|
4868
5195
|
// ../../packages/dvss-integration-trybe/src/app.module.ts
|
|
4869
|
-
function
|
|
5196
|
+
function _ts_decorate24(decorators, target, key, desc2) {
|
|
4870
5197
|
var c = arguments.length, r = c < 3 ? target : desc2 === null ? desc2 = Object.getOwnPropertyDescriptor(target, key) : desc2, d;
|
|
4871
5198
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc2);
|
|
4872
5199
|
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;
|
|
4873
5200
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4874
5201
|
}
|
|
4875
|
-
__name(
|
|
5202
|
+
__name(_ts_decorate24, "_ts_decorate");
|
|
4876
5203
|
exports.IntegrationTrybeModule = class AppModule2 {
|
|
4877
5204
|
static {
|
|
4878
5205
|
__name(this, "AppModule");
|
|
4879
5206
|
}
|
|
4880
5207
|
};
|
|
4881
|
-
exports.IntegrationTrybeModule =
|
|
5208
|
+
exports.IntegrationTrybeModule = _ts_decorate24([
|
|
4882
5209
|
common.Module({
|
|
4883
5210
|
imports: [
|
|
4884
5211
|
// Load environment variables from root .env file
|
|
@@ -4900,6 +5227,8 @@ exports.IntegrationTrybeModule = _ts_decorate22([
|
|
|
4900
5227
|
exports.TrybeCustomerManagement,
|
|
4901
5228
|
exports.TrybeCreditBooking,
|
|
4902
5229
|
exports.TrybeWellnessManagement,
|
|
5230
|
+
exports.TrybeWebhookUtilService,
|
|
5231
|
+
exports.IntegrationBookingDao,
|
|
4903
5232
|
exports.IntegrationConfigurationDao,
|
|
4904
5233
|
exports.IntegrationResourceManagementDao,
|
|
4905
5234
|
exports.IntegrationCommonDao,
|
|
@@ -4918,25 +5247,26 @@ exports.IntegrationTrybeModule = _ts_decorate22([
|
|
|
4918
5247
|
exports.TrybeCreditBooking,
|
|
4919
5248
|
exports.TrybeWellnessManagement,
|
|
4920
5249
|
exports.TrybeIntegrationConfigurationService,
|
|
4921
|
-
exports.TrybeIntegrationResourceManagementService
|
|
5250
|
+
exports.TrybeIntegrationResourceManagementService,
|
|
5251
|
+
exports.TrybeWebhookUtilService
|
|
4922
5252
|
]
|
|
4923
5253
|
})
|
|
4924
5254
|
], exports.IntegrationTrybeModule);
|
|
4925
5255
|
|
|
4926
5256
|
// src/app.module.ts
|
|
4927
|
-
function
|
|
5257
|
+
function _ts_decorate25(decorators, target, key, desc2) {
|
|
4928
5258
|
var c = arguments.length, r = c < 3 ? target : desc2 === null ? desc2 = Object.getOwnPropertyDescriptor(target, key) : desc2, d;
|
|
4929
5259
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc2);
|
|
4930
5260
|
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;
|
|
4931
5261
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4932
5262
|
}
|
|
4933
|
-
__name(
|
|
5263
|
+
__name(_ts_decorate25, "_ts_decorate");
|
|
4934
5264
|
exports.OfferingIntegrationManager = class AppModule3 {
|
|
4935
5265
|
static {
|
|
4936
5266
|
__name(this, "AppModule");
|
|
4937
5267
|
}
|
|
4938
5268
|
};
|
|
4939
|
-
exports.OfferingIntegrationManager =
|
|
5269
|
+
exports.OfferingIntegrationManager = _ts_decorate25([
|
|
4940
5270
|
common.Module({
|
|
4941
5271
|
imports: [
|
|
4942
5272
|
exports.IntegrationTrybeModule,
|