@veloceapps/sdk 11.0.0-80 → 11.0.0-82

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.
@@ -594,7 +594,12 @@ class SalesTransactionService {
594
594
  this.state$ = this.stateSubj$.asObservable().pipe(filter(isDefined));
595
595
  }
596
596
  init(headerId, params) {
597
- return this.salesTransactionApiService.getState(headerId, params).pipe(tap(res => this.stateSubj$.next(res)));
597
+ return this.salesTransactionApiService.query(headerId, params).pipe(tap(res => {
598
+ if (!res.salesTransaction) {
599
+ throw new Error('SalesTransaction is not defined. Please check Query Orchestration.');
600
+ }
601
+ this.stateSubj$.next(res);
602
+ }));
598
603
  }
599
604
  finalizeInit() {
600
605
  this.isInitializedSubj$.next(true);
@@ -830,21 +835,11 @@ class FlowStateService {
830
835
  else {
831
836
  const state = this.salesTransactionService.state;
832
837
  if (state) {
833
- return this.salesTransactionApiService.upsert(state);
834
- }
835
- }
836
- return of({ id: '' });
837
- }
838
- submit$() {
839
- if (this.flowInfoService.flow.properties.stateful) {
840
- if (this.stateId$.value) {
841
- return this.flowStateApiService.submit(this.stateId$.value).pipe(map(({ quoteId }) => ({ id: quoteId })));
842
- }
843
- }
844
- else {
845
- const state = this.salesTransactionService.state;
846
- if (state) {
847
- return this.salesTransactionApiService.submit(state);
838
+ const request = {
839
+ transactionContext: state,
840
+ flowId: this.flowInfoService.flow.id,
841
+ };
842
+ return this.salesTransactionApiService.upsert(request).pipe(map(id => ({ id })));
848
843
  }
849
844
  }
850
845
  return of({ id: '' });
@@ -1336,7 +1331,11 @@ class ConfigurationStateService {
1336
1331
  }
1337
1332
  const { standalone } = this.flowInfoService.flow.properties;
1338
1333
  if (standalone) {
1339
- return this.salesTransactionApiService.upsert(state);
1334
+ const request = {
1335
+ transactionContext: state,
1336
+ flowId: this.flowInfoService.flow.id,
1337
+ };
1338
+ return this.salesTransactionApiService.upsert(request).pipe(map(id => ({ id })));
1340
1339
  }
1341
1340
  const transactionContext = this.salesTransactionService.state;
1342
1341
  const configurationRoot = this.configurationService.root;