@veloceapps/sdk 11.0.0-82 → 11.0.0-83

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.
@@ -421,6 +421,48 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
421
421
  type: Injectable
422
422
  }], ctorParameters: function () { return [{ type: FlowInfoService }, { type: ConfigurationService }, { type: ConfigurationRuntimeService }, { type: SalesTransactionService }, { type: RuntimeSettingsService }]; } });
423
423
 
424
+ class GuidedSellingService {
425
+ constructor(orchestrationsApiService) {
426
+ this.orchestrationsApiService = orchestrationsApiService;
427
+ }
428
+ configureGuidedSelling$(data) {
429
+ return this.orchestrationsApiService.apply$({
430
+ transactionContext: this.getTransactionContext(data.attributesMap),
431
+ orchestrationName: data.orchestrationName,
432
+ });
433
+ }
434
+ getTransactionContext(guidedSellingAttributes) {
435
+ const testTransaction = {
436
+ id: UUID.UUID(),
437
+ businessObjectType: 'Quote',
438
+ salesTransactionItems: [],
439
+ tagAttributes: {},
440
+ };
441
+ return {
442
+ salesTransaction: testTransaction,
443
+ transactionId: UUID.UUID(),
444
+ businessObjectType: 'Quote',
445
+ childNodes: {
446
+ GuidedSelling: [
447
+ {
448
+ id: UUID.UUID(),
449
+ tagAttributes: {},
450
+ childNodes: {},
451
+ properties: { guidedSellingAttributes },
452
+ },
453
+ ],
454
+ },
455
+ id: UUID.UUID(),
456
+ tagAttributes: {},
457
+ };
458
+ }
459
+ }
460
+ GuidedSellingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingService, deps: [{ token: i1.OrchestrationsApiService }], target: i0.ɵɵFactoryTarget.Injectable });
461
+ GuidedSellingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingService });
462
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingService, decorators: [{
463
+ type: Injectable
464
+ }], ctorParameters: function () { return [{ type: i1.OrchestrationsApiService }]; } });
465
+
424
466
  class SalesTransactionService {
425
467
  get isInitialized$() {
426
468
  return this.isInitializedSubj$.asObservable();
@@ -1077,6 +1119,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1077
1119
  }] });
1078
1120
 
1079
1121
  class ConfigurationService {
1122
+ constructor(flowInfoService, messageService, configurationRuntimeService, salesTransactionService, orchestrationsApiService) {
1123
+ this.flowInfoService = flowInfoService;
1124
+ this.messageService = messageService;
1125
+ this.configurationRuntimeService = configurationRuntimeService;
1126
+ this.salesTransactionService = salesTransactionService;
1127
+ this.orchestrationsApiService = orchestrationsApiService;
1128
+ this.hasUnsavedChanges = false;
1129
+ this.configurationStateSubj$ = new BehaviorSubject(null);
1130
+ this.previousConfigurationStateSubj$ = new BehaviorSubject(null);
1131
+ this.isLoadingSubj$ = new BehaviorSubject(false);
1132
+ this.isLoading$ = this.isLoadingSubj$.asObservable();
1133
+ }
1080
1134
  get state$() {
1081
1135
  return this.configurationStateSubj$.asObservable().pipe(filter$1(isDefined));
1082
1136
  }
@@ -1093,18 +1147,6 @@ class ConfigurationService {
1093
1147
  var _a, _b;
1094
1148
  return (_b = (_a = this.configurationStateSubj$.getValue()) === null || _a === void 0 ? void 0 : _a.salesTransaction.salesTransactionItems[0]) !== null && _b !== void 0 ? _b : null;
1095
1149
  }
1096
- constructor(flowInfoService, messageService, configurationRuntimeService, salesTransactionService, orchestrationsApiService) {
1097
- this.flowInfoService = flowInfoService;
1098
- this.messageService = messageService;
1099
- this.configurationRuntimeService = configurationRuntimeService;
1100
- this.salesTransactionService = salesTransactionService;
1101
- this.orchestrationsApiService = orchestrationsApiService;
1102
- this.hasUnsavedChanges = false;
1103
- this.configurationStateSubj$ = new BehaviorSubject(null);
1104
- this.previousConfigurationStateSubj$ = new BehaviorSubject(null);
1105
- this.isLoadingSubj$ = new BehaviorSubject(false);
1106
- this.isLoading$ = this.isLoadingSubj$.asObservable();
1107
- }
1108
1150
  reset() {
1109
1151
  this.hasUnsavedChanges = false;
1110
1152
  this.configurationStateSubj$.next(null);
@@ -1183,10 +1225,6 @@ class ConfigurationService {
1183
1225
  // TODO: implement
1184
1226
  throw new Error('Not implemented');
1185
1227
  }
1186
- configureGuidedSelling$(data) {
1187
- // TODO: implement
1188
- throw new Error('Not implemented');
1189
- }
1190
1228
  getPCMModel() {
1191
1229
  const pcmModel = this.configurationRuntimeService.pcmModel;
1192
1230
  if (!pcmModel) {
@@ -1579,6 +1617,7 @@ ConfigurationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", ver
1579
1617
  ConfigurationStateService,
1580
1618
  ConfigurationRuntimeService,
1581
1619
  TestModeConfigurationService,
1620
+ GuidedSellingService,
1582
1621
  ], imports: [ConfirmationDialogModule, ApiModule] });
1583
1622
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationModule, decorators: [{
1584
1623
  type: NgModule,
@@ -1589,6 +1628,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1589
1628
  ConfigurationStateService,
1590
1629
  ConfigurationRuntimeService,
1591
1630
  TestModeConfigurationService,
1631
+ GuidedSellingService,
1592
1632
  ],
1593
1633
  }]
1594
1634
  }] });
@@ -1837,5 +1877,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1837
1877
  * Generated bundle index. Do not edit.
1838
1878
  */
1839
1879
 
1840
- export { ActionCodePipe, CalendarDirective, CatalogProductsService, ConfigurationRuntimeService, ConfigurationService, ConfigurationStateService, DEFAULT_FORMATTING_SETTINGS, DatePipe, FLOW_CUSTOMIZATION, FORMATTING_SETTINGS_TOKEN, FlowConfigurationService, FlowInfoService, FlowStateConfigurationService, FlowStateService, IntegrationState, NumberPipe, PricePipe, ProductImagesService, RuntimeSettingsService, SalesTransactionService, SdkCoreModule, SdkDirectivesModule, SdkPipesModule, TestModeConfigurationService, TransactionItemWorker, UI_DEFINITION_VERSION, extractMetadata, filterSuccessfulExecute, findTransactionItem, findTransactionItemWithComparator, generateTransactionItem, insertTransactionItem, removeTransactionItem, replaceTransactionItem };
1880
+ export { ActionCodePipe, CalendarDirective, CatalogProductsService, ConfigurationRuntimeService, ConfigurationService, ConfigurationStateService, DEFAULT_FORMATTING_SETTINGS, DatePipe, FLOW_CUSTOMIZATION, FORMATTING_SETTINGS_TOKEN, FlowConfigurationService, FlowInfoService, FlowStateConfigurationService, FlowStateService, GuidedSellingService, IntegrationState, NumberPipe, PricePipe, ProductImagesService, RuntimeSettingsService, SalesTransactionService, SdkCoreModule, SdkDirectivesModule, SdkPipesModule, TestModeConfigurationService, TransactionItemWorker, UI_DEFINITION_VERSION, extractMetadata, filterSuccessfulExecute, findTransactionItem, findTransactionItemWithComparator, generateTransactionItem, insertTransactionItem, removeTransactionItem, replaceTransactionItem };
1841
1881
  //# sourceMappingURL=veloceapps-sdk-core.mjs.map