@dv4resi/dvss-backend-module-offering-im 0.0.20 → 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 +440 -107
- 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");
|
|
@@ -3068,7 +3138,10 @@ exports.TrybeCustomerManagement = class _TrybeCustomerManagement {
|
|
|
3068
3138
|
baseUrl: integration.config.platformConfig.baseUrl,
|
|
3069
3139
|
headers: integration.headers
|
|
3070
3140
|
}, integration, loggedInUserId);
|
|
3071
|
-
if (!response.data || response.data
|
|
3141
|
+
if (!response.data || !Array.isArray(response.data)) {
|
|
3142
|
+
throw new dvssBackendModuleUtility.CustomException(dvssBackendModuleUtility.ERROR_NAMES.BAD_REQUEST, "Invalid Credentials");
|
|
3143
|
+
}
|
|
3144
|
+
if (response.data.length === 0) {
|
|
3072
3145
|
return void 0;
|
|
3073
3146
|
}
|
|
3074
3147
|
return response.data[0];
|
|
@@ -3116,10 +3189,10 @@ exports.TrybeCustomerManagement = class _TrybeCustomerManagement {
|
|
|
3116
3189
|
}
|
|
3117
3190
|
}
|
|
3118
3191
|
};
|
|
3119
|
-
exports.TrybeCustomerManagement =
|
|
3192
|
+
exports.TrybeCustomerManagement = _ts_decorate17([
|
|
3120
3193
|
common.Injectable(),
|
|
3121
|
-
|
|
3122
|
-
|
|
3194
|
+
_ts_metadata14("design:type", Function),
|
|
3195
|
+
_ts_metadata14("design:paramtypes", [
|
|
3123
3196
|
typeof dvssBackendModuleUtility.LoggerService === "undefined" ? Object : dvssBackendModuleUtility.LoggerService,
|
|
3124
3197
|
typeof exports.TrafficGatewayService === "undefined" ? Object : exports.TrafficGatewayService
|
|
3125
3198
|
])
|
|
@@ -3137,17 +3210,17 @@ function isValidHttpUrl(urlString) {
|
|
|
3137
3210
|
__name(isValidHttpUrl, "isValidHttpUrl");
|
|
3138
3211
|
|
|
3139
3212
|
// ../../packages/dvss-integration-trybe/src/capabilities/auth/auth.service.ts
|
|
3140
|
-
function
|
|
3213
|
+
function _ts_decorate18(decorators, target, key, desc2) {
|
|
3141
3214
|
var c = arguments.length, r = c < 3 ? target : desc2 === null ? desc2 = Object.getOwnPropertyDescriptor(target, key) : desc2, d;
|
|
3142
3215
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc2);
|
|
3143
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;
|
|
3144
3217
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3145
3218
|
}
|
|
3146
|
-
__name(
|
|
3147
|
-
function
|
|
3219
|
+
__name(_ts_decorate18, "_ts_decorate");
|
|
3220
|
+
function _ts_metadata15(k, v) {
|
|
3148
3221
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
3149
3222
|
}
|
|
3150
|
-
__name(
|
|
3223
|
+
__name(_ts_metadata15, "_ts_metadata");
|
|
3151
3224
|
exports.TrybeAuthService = class _TrybeAuthService {
|
|
3152
3225
|
static {
|
|
3153
3226
|
__name(this, "TrybeAuthService");
|
|
@@ -3245,10 +3318,10 @@ exports.TrybeAuthService = class _TrybeAuthService {
|
|
|
3245
3318
|
throw new Error("Method not implemented.");
|
|
3246
3319
|
}
|
|
3247
3320
|
};
|
|
3248
|
-
exports.TrybeAuthService =
|
|
3321
|
+
exports.TrybeAuthService = _ts_decorate18([
|
|
3249
3322
|
common.Injectable(),
|
|
3250
|
-
|
|
3251
|
-
|
|
3323
|
+
_ts_metadata15("design:type", Function),
|
|
3324
|
+
_ts_metadata15("design:paramtypes", [
|
|
3252
3325
|
typeof exports.TrybeCustomerManagement === "undefined" ? Object : exports.TrybeCustomerManagement,
|
|
3253
3326
|
typeof dvssBackendModuleUtility.LoggerService === "undefined" ? Object : dvssBackendModuleUtility.LoggerService
|
|
3254
3327
|
])
|
|
@@ -3311,17 +3384,17 @@ function mapTrybeCreditsToSystem(res, integration) {
|
|
|
3311
3384
|
__name(mapTrybeCreditsToSystem, "mapTrybeCreditsToSystem");
|
|
3312
3385
|
|
|
3313
3386
|
// ../../packages/dvss-integration-trybe/src/capabilities/credit-management/credit-booking.service.ts
|
|
3314
|
-
function
|
|
3387
|
+
function _ts_decorate19(decorators, target, key, desc2) {
|
|
3315
3388
|
var c = arguments.length, r = c < 3 ? target : desc2 === null ? desc2 = Object.getOwnPropertyDescriptor(target, key) : desc2, d;
|
|
3316
3389
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc2);
|
|
3317
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;
|
|
3318
3391
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3319
3392
|
}
|
|
3320
|
-
__name(
|
|
3321
|
-
function
|
|
3393
|
+
__name(_ts_decorate19, "_ts_decorate");
|
|
3394
|
+
function _ts_metadata16(k, v) {
|
|
3322
3395
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
3323
3396
|
}
|
|
3324
|
-
__name(
|
|
3397
|
+
__name(_ts_metadata16, "_ts_metadata");
|
|
3325
3398
|
exports.TrybeCreditBooking = class _TrybeCreditBooking {
|
|
3326
3399
|
static {
|
|
3327
3400
|
__name(this, "TrybeCreditBooking");
|
|
@@ -3379,10 +3452,10 @@ exports.TrybeCreditBooking = class _TrybeCreditBooking {
|
|
|
3379
3452
|
return mapTrybeCreditsToSystem(raw, validatedIntegration);
|
|
3380
3453
|
}
|
|
3381
3454
|
};
|
|
3382
|
-
exports.TrybeCreditBooking =
|
|
3455
|
+
exports.TrybeCreditBooking = _ts_decorate19([
|
|
3383
3456
|
common.Injectable(),
|
|
3384
|
-
|
|
3385
|
-
|
|
3457
|
+
_ts_metadata16("design:type", Function),
|
|
3458
|
+
_ts_metadata16("design:paramtypes", [
|
|
3386
3459
|
typeof dvssBackendModuleUtility.LoggerService === "undefined" ? Object : dvssBackendModuleUtility.LoggerService,
|
|
3387
3460
|
typeof exports.TrafficGatewayService === "undefined" ? Object : exports.TrafficGatewayService,
|
|
3388
3461
|
typeof exports.TrybeAuthService === "undefined" ? Object : exports.TrybeAuthService
|
|
@@ -3403,17 +3476,17 @@ function mapTrybeSiteResponseToSystem(response) {
|
|
|
3403
3476
|
__name(mapTrybeSiteResponseToSystem, "mapTrybeSiteResponseToSystem");
|
|
3404
3477
|
|
|
3405
3478
|
// ../../packages/dvss-integration-trybe/src/capabilities/integration-configuration/integration-configuration.service.ts
|
|
3406
|
-
function
|
|
3479
|
+
function _ts_decorate20(decorators, target, key, desc2) {
|
|
3407
3480
|
var c = arguments.length, r = c < 3 ? target : desc2 === null ? desc2 = Object.getOwnPropertyDescriptor(target, key) : desc2, d;
|
|
3408
3481
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc2);
|
|
3409
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;
|
|
3410
3483
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3411
3484
|
}
|
|
3412
|
-
__name(
|
|
3413
|
-
function
|
|
3485
|
+
__name(_ts_decorate20, "_ts_decorate");
|
|
3486
|
+
function _ts_metadata17(k, v) {
|
|
3414
3487
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
3415
3488
|
}
|
|
3416
|
-
__name(
|
|
3489
|
+
__name(_ts_metadata17, "_ts_metadata");
|
|
3417
3490
|
exports.TrybeIntegrationConfigurationService = class TrybeIntegrationConfigurationService extends exports.BaseIntegrationConfiguration {
|
|
3418
3491
|
static {
|
|
3419
3492
|
__name(this, "TrybeIntegrationConfigurationService");
|
|
@@ -3474,10 +3547,10 @@ exports.TrybeIntegrationConfigurationService = class TrybeIntegrationConfigurati
|
|
|
3474
3547
|
return mapTrybeSiteResponseToSystem(response);
|
|
3475
3548
|
}
|
|
3476
3549
|
};
|
|
3477
|
-
exports.TrybeIntegrationConfigurationService =
|
|
3550
|
+
exports.TrybeIntegrationConfigurationService = _ts_decorate20([
|
|
3478
3551
|
common.Injectable(),
|
|
3479
|
-
|
|
3480
|
-
|
|
3552
|
+
_ts_metadata17("design:type", Function),
|
|
3553
|
+
_ts_metadata17("design:paramtypes", [
|
|
3481
3554
|
typeof exports.IntegrationConfigurationDao === "undefined" ? Object : exports.IntegrationConfigurationDao,
|
|
3482
3555
|
typeof dvssBackendModuleDatastore.CommonValidationDatabaseService === "undefined" ? Object : dvssBackendModuleDatastore.CommonValidationDatabaseService,
|
|
3483
3556
|
typeof dvssBackendModuleUtility.LoggerService === "undefined" ? Object : dvssBackendModuleUtility.LoggerService,
|
|
@@ -3499,17 +3572,17 @@ var TRYBE_CATALOGING_BY_ENUM = /* @__PURE__ */ (function(TRYBE_CATALOGING_BY_ENU
|
|
|
3499
3572
|
})({});
|
|
3500
3573
|
|
|
3501
3574
|
// ../../packages/dvss-integration-trybe/src/capabilities/integration-resource-management/integration-resource-management.service.ts
|
|
3502
|
-
function
|
|
3575
|
+
function _ts_decorate21(decorators, target, key, desc2) {
|
|
3503
3576
|
var c = arguments.length, r = c < 3 ? target : desc2 === null ? desc2 = Object.getOwnPropertyDescriptor(target, key) : desc2, d;
|
|
3504
3577
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc2);
|
|
3505
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;
|
|
3506
3579
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
3507
3580
|
}
|
|
3508
|
-
__name(
|
|
3509
|
-
function
|
|
3581
|
+
__name(_ts_decorate21, "_ts_decorate");
|
|
3582
|
+
function _ts_metadata18(k, v) {
|
|
3510
3583
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
3511
3584
|
}
|
|
3512
|
-
__name(
|
|
3585
|
+
__name(_ts_metadata18, "_ts_metadata");
|
|
3513
3586
|
var OFFERING_INTEGRATION_MAPPING_ALREADY_EXISTS = "OFFERING_INTEGRATION_MAPPING_ALREADY_EXISTS";
|
|
3514
3587
|
var VALID_JOURNEY_VALUES = /* @__PURE__ */ new Set([
|
|
3515
3588
|
"SESSION",
|
|
@@ -3580,10 +3653,10 @@ exports.TrybeIntegrationResourceManagementService = class TrybeIntegrationResour
|
|
|
3580
3653
|
return await super.updateOfferingIntegrationResourceConfiguration(input, context);
|
|
3581
3654
|
}
|
|
3582
3655
|
};
|
|
3583
|
-
exports.TrybeIntegrationResourceManagementService =
|
|
3656
|
+
exports.TrybeIntegrationResourceManagementService = _ts_decorate21([
|
|
3584
3657
|
common.Injectable(),
|
|
3585
|
-
|
|
3586
|
-
|
|
3658
|
+
_ts_metadata18("design:type", Function),
|
|
3659
|
+
_ts_metadata18("design:paramtypes", [
|
|
3587
3660
|
typeof dvssBackendModuleUtility.LoggerService === "undefined" ? Object : dvssBackendModuleUtility.LoggerService,
|
|
3588
3661
|
typeof exports.IntegrationResourceManagementDao === "undefined" ? Object : exports.IntegrationResourceManagementDao
|
|
3589
3662
|
])
|
|
@@ -3662,6 +3735,263 @@ var fetchAllPages = /* @__PURE__ */ __name(async (firstPageResponse, shouldFetch
|
|
|
3662
3735
|
}
|
|
3663
3736
|
return items;
|
|
3664
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);
|
|
3665
3995
|
var TRYBE_WEEKDAYS_MAPPING = {
|
|
3666
3996
|
monday: models.DAY_OF_WEEK.MON,
|
|
3667
3997
|
tuesday: models.DAY_OF_WEEK.TUE,
|
|
@@ -4054,17 +4384,17 @@ function mapTrybeAppointmentAvailabilityToSystemResponse(slots) {
|
|
|
4054
4384
|
__name(mapTrybeAppointmentAvailabilityToSystemResponse, "mapTrybeAppointmentAvailabilityToSystemResponse");
|
|
4055
4385
|
|
|
4056
4386
|
// ../../packages/dvss-integration-trybe/src/capabilities/wellness/wellness-management.service.ts
|
|
4057
|
-
function
|
|
4387
|
+
function _ts_decorate23(decorators, target, key, desc2) {
|
|
4058
4388
|
var c = arguments.length, r = c < 3 ? target : desc2 === null ? desc2 = Object.getOwnPropertyDescriptor(target, key) : desc2, d;
|
|
4059
4389
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc2);
|
|
4060
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;
|
|
4061
4391
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4062
4392
|
}
|
|
4063
|
-
__name(
|
|
4064
|
-
function
|
|
4393
|
+
__name(_ts_decorate23, "_ts_decorate");
|
|
4394
|
+
function _ts_metadata20(k, v) {
|
|
4065
4395
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
4066
4396
|
}
|
|
4067
|
-
__name(
|
|
4397
|
+
__name(_ts_metadata20, "_ts_metadata");
|
|
4068
4398
|
exports.TrybeWellnessManagement = class _TrybeWellnessManagement {
|
|
4069
4399
|
static {
|
|
4070
4400
|
__name(this, "TrybeWellnessManagement");
|
|
@@ -4847,10 +5177,10 @@ exports.TrybeWellnessManagement = class _TrybeWellnessManagement {
|
|
|
4847
5177
|
}
|
|
4848
5178
|
}
|
|
4849
5179
|
};
|
|
4850
|
-
exports.TrybeWellnessManagement =
|
|
5180
|
+
exports.TrybeWellnessManagement = _ts_decorate23([
|
|
4851
5181
|
common.Injectable(),
|
|
4852
|
-
|
|
4853
|
-
|
|
5182
|
+
_ts_metadata20("design:type", Function),
|
|
5183
|
+
_ts_metadata20("design:paramtypes", [
|
|
4854
5184
|
typeof dvssBackendModuleUtility.LoggerService === "undefined" ? Object : dvssBackendModuleUtility.LoggerService,
|
|
4855
5185
|
typeof exports.TrafficGatewayService === "undefined" ? Object : exports.TrafficGatewayService,
|
|
4856
5186
|
typeof exports.TrybeAuthService === "undefined" ? Object : exports.TrybeAuthService,
|
|
@@ -4863,19 +5193,19 @@ dotenv.config({
|
|
|
4863
5193
|
});
|
|
4864
5194
|
|
|
4865
5195
|
// ../../packages/dvss-integration-trybe/src/app.module.ts
|
|
4866
|
-
function
|
|
5196
|
+
function _ts_decorate24(decorators, target, key, desc2) {
|
|
4867
5197
|
var c = arguments.length, r = c < 3 ? target : desc2 === null ? desc2 = Object.getOwnPropertyDescriptor(target, key) : desc2, d;
|
|
4868
5198
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc2);
|
|
4869
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;
|
|
4870
5200
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4871
5201
|
}
|
|
4872
|
-
__name(
|
|
5202
|
+
__name(_ts_decorate24, "_ts_decorate");
|
|
4873
5203
|
exports.IntegrationTrybeModule = class AppModule2 {
|
|
4874
5204
|
static {
|
|
4875
5205
|
__name(this, "AppModule");
|
|
4876
5206
|
}
|
|
4877
5207
|
};
|
|
4878
|
-
exports.IntegrationTrybeModule =
|
|
5208
|
+
exports.IntegrationTrybeModule = _ts_decorate24([
|
|
4879
5209
|
common.Module({
|
|
4880
5210
|
imports: [
|
|
4881
5211
|
// Load environment variables from root .env file
|
|
@@ -4897,6 +5227,8 @@ exports.IntegrationTrybeModule = _ts_decorate22([
|
|
|
4897
5227
|
exports.TrybeCustomerManagement,
|
|
4898
5228
|
exports.TrybeCreditBooking,
|
|
4899
5229
|
exports.TrybeWellnessManagement,
|
|
5230
|
+
exports.TrybeWebhookUtilService,
|
|
5231
|
+
exports.IntegrationBookingDao,
|
|
4900
5232
|
exports.IntegrationConfigurationDao,
|
|
4901
5233
|
exports.IntegrationResourceManagementDao,
|
|
4902
5234
|
exports.IntegrationCommonDao,
|
|
@@ -4915,25 +5247,26 @@ exports.IntegrationTrybeModule = _ts_decorate22([
|
|
|
4915
5247
|
exports.TrybeCreditBooking,
|
|
4916
5248
|
exports.TrybeWellnessManagement,
|
|
4917
5249
|
exports.TrybeIntegrationConfigurationService,
|
|
4918
|
-
exports.TrybeIntegrationResourceManagementService
|
|
5250
|
+
exports.TrybeIntegrationResourceManagementService,
|
|
5251
|
+
exports.TrybeWebhookUtilService
|
|
4919
5252
|
]
|
|
4920
5253
|
})
|
|
4921
5254
|
], exports.IntegrationTrybeModule);
|
|
4922
5255
|
|
|
4923
5256
|
// src/app.module.ts
|
|
4924
|
-
function
|
|
5257
|
+
function _ts_decorate25(decorators, target, key, desc2) {
|
|
4925
5258
|
var c = arguments.length, r = c < 3 ? target : desc2 === null ? desc2 = Object.getOwnPropertyDescriptor(target, key) : desc2, d;
|
|
4926
5259
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc2);
|
|
4927
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;
|
|
4928
5261
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4929
5262
|
}
|
|
4930
|
-
__name(
|
|
5263
|
+
__name(_ts_decorate25, "_ts_decorate");
|
|
4931
5264
|
exports.OfferingIntegrationManager = class AppModule3 {
|
|
4932
5265
|
static {
|
|
4933
5266
|
__name(this, "AppModule");
|
|
4934
5267
|
}
|
|
4935
5268
|
};
|
|
4936
|
-
exports.OfferingIntegrationManager =
|
|
5269
|
+
exports.OfferingIntegrationManager = _ts_decorate25([
|
|
4937
5270
|
common.Module({
|
|
4938
5271
|
imports: [
|
|
4939
5272
|
exports.IntegrationTrybeModule,
|