@veloceapps/sdk 12.0.0-10 → 12.0.0-11

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.
@@ -6,7 +6,7 @@ import { ApiModule } from '@veloceapps/api';
6
6
  import * as i6 from '@veloceapps/components';
7
7
  import { ToastType, ConfirmationDialogModule } from '@veloceapps/components';
8
8
  import * as i1 from '@veloceapps/api/v2';
9
- import { BehaviorSubject, tap, map, filter, switchMap, of, forkJoin, noop, throwError, distinctUntilChanged, Subject, catchError as catchError$1, combineLatest, finalize as finalize$1, buffer, debounceTime, share, take, shareReplay, takeUntil, first } from 'rxjs';
9
+ import { tap, BehaviorSubject, map, filter, switchMap, of, forkJoin, noop, throwError, Subject, catchError as catchError$1, combineLatest, finalize as finalize$1, buffer, debounceTime, share, take, distinctUntilChanged, shareReplay, takeUntil, first } from 'rxjs';
10
10
  import { uniqBy, flatten, omit, cloneDeep, assign, isEqual } from 'lodash';
11
11
  import * as i2 from 'primeng/api';
12
12
  import { filter as filter$1, map as map$1, tap as tap$1, catchError, finalize } from 'rxjs/operators';
@@ -18,27 +18,18 @@ class ConfigurationRuntimeService {
18
18
  constructor(pcmApiService) {
19
19
  this.pcmApiService = pcmApiService;
20
20
  this.uiDefinitionContainer = null;
21
- this.pcmModelSubj$ = new BehaviorSubject(null);
22
21
  }
23
22
  get uiDefinitionProps() {
24
23
  return this.uiDefinitionContainer?.source.properties ?? {};
25
24
  }
26
- get pcmModel() {
27
- return this.pcmModelSubj$.value;
28
- }
29
- get pcmModel$() {
30
- return this.pcmModelSubj$;
31
- }
32
25
  reset() {
33
26
  this.uiDefinitionContainer = null;
34
27
  this.initializationProps = undefined;
35
- this.pcmModelSubj$.next(null);
28
+ this.pcmModel = undefined;
36
29
  }
37
30
  init$(props) {
38
31
  this.initializationProps = props;
39
- return this.pcmApiService
40
- .fetchPCMByProductId(props.productId)
41
- .pipe(tap(pcmModel => this.pcmModelSubj$.next(pcmModel)));
32
+ return this.pcmApiService.fetchPCMByProductId(props.productId).pipe(tap(pcmModel => (this.pcmModel = pcmModel)));
42
33
  }
43
34
  }
44
35
  ConfigurationRuntimeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationRuntimeService, deps: [{ token: i1.PCMApiService }], target: i0.ɵɵFactoryTarget.Injectable });
@@ -661,19 +652,6 @@ class ConfigurationService {
661
652
  }
662
653
  return pcmModel;
663
654
  }
664
- getPCMModel$() {
665
- return this.configurationRuntimeService.pcmModel$.pipe(distinctUntilChanged((prev, curr) => prev?.id === curr?.id));
666
- }
667
- swapProduct$(productId) {
668
- const rootTransactionItem = this.root;
669
- this.flowInfoService.updateContext({ productId });
670
- return this.configurationRuntimeService.init$({ productId }).pipe(map$1(pcm => generateTransactionItem(pcm, this.state?.salesTransaction.id, rootTransactionItem?.qty)), switchMap(salesTransactionItem => {
671
- return this.patch$({
672
- ...salesTransactionItem,
673
- id: rootTransactionItem?.id ?? salesTransactionItem.id,
674
- });
675
- }));
676
- }
677
655
  }
678
656
  ConfigurationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationService, deps: [{ token: FlowInfoService }, { token: i2.MessageService }, { token: ConfigurationRuntimeService }, { token: SalesTransactionService }, { token: i1.OrchestrationsApiService }, { token: GuidedSellingService }], target: i0.ɵɵFactoryTarget.Injectable });
679
657
  ConfigurationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ConfigurationService });
@@ -825,7 +803,7 @@ class TestModeConfigurationService {
825
803
  initTestMode$(uiDefinitionContainer, options) {
826
804
  this.configurationRuntimeService.uiDefinitionContainer = uiDefinitionContainer;
827
805
  if (this.checkInitialized(uiDefinitionContainer)) {
828
- this.configurationRuntimeService.pcmModelSubj$.next(this.pcmModel || null);
806
+ this.configurationRuntimeService.pcmModel = this.pcmModel;
829
807
  return of(undefined);
830
808
  }
831
809
  this.configurationService.reset();