@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.
- package/core/services/flow-state.service.d.ts +0 -3
- package/esm2020/core/modules/configuration/services/configuration-state.service.mjs +7 -3
- package/esm2020/core/services/flow-state.service.mjs +7 -17
- package/esm2020/core/services/sales-transaction.service.mjs +7 -2
- package/fesm2015/veloceapps-sdk-core.mjs +16 -17
- package/fesm2015/veloceapps-sdk-core.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk-core.mjs +16 -17
- package/fesm2020/veloceapps-sdk-core.mjs.map +1 -1
- package/package.json +1 -1
@@ -455,7 +455,12 @@ class SalesTransactionService {
|
|
455
455
|
this.state$ = this.stateSubj$.asObservable().pipe(filter(isDefined));
|
456
456
|
}
|
457
457
|
init(headerId, params) {
|
458
|
-
return this.salesTransactionApiService.
|
458
|
+
return this.salesTransactionApiService.query(headerId, params).pipe(tap(res => {
|
459
|
+
if (!res.salesTransaction) {
|
460
|
+
throw new Error('SalesTransaction is not defined. Please check Query Orchestration.');
|
461
|
+
}
|
462
|
+
this.stateSubj$.next(res);
|
463
|
+
}));
|
459
464
|
}
|
460
465
|
finalizeInit() {
|
461
466
|
this.isInitializedSubj$.next(true);
|
@@ -688,21 +693,11 @@ class FlowStateService {
|
|
688
693
|
else {
|
689
694
|
const state = this.salesTransactionService.state;
|
690
695
|
if (state) {
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
submit$() {
|
697
|
-
if (this.flowInfoService.flow.properties.stateful) {
|
698
|
-
if (this.stateId$.value) {
|
699
|
-
return this.flowStateApiService.submit(this.stateId$.value).pipe(map(({ quoteId }) => ({ id: quoteId })));
|
700
|
-
}
|
701
|
-
}
|
702
|
-
else {
|
703
|
-
const state = this.salesTransactionService.state;
|
704
|
-
if (state) {
|
705
|
-
return this.salesTransactionApiService.submit(state);
|
696
|
+
const request = {
|
697
|
+
transactionContext: state,
|
698
|
+
flowId: this.flowInfoService.flow.id,
|
699
|
+
};
|
700
|
+
return this.salesTransactionApiService.upsert(request).pipe(map(id => ({ id })));
|
706
701
|
}
|
707
702
|
}
|
708
703
|
return of({ id: '' });
|
@@ -1338,7 +1333,11 @@ class ConfigurationStateService {
|
|
1338
1333
|
}
|
1339
1334
|
const { standalone } = this.flowInfoService.flow.properties;
|
1340
1335
|
if (standalone) {
|
1341
|
-
|
1336
|
+
const request = {
|
1337
|
+
transactionContext: state,
|
1338
|
+
flowId: this.flowInfoService.flow.id,
|
1339
|
+
};
|
1340
|
+
return this.salesTransactionApiService.upsert(request).pipe(map(id => ({ id })));
|
1342
1341
|
}
|
1343
1342
|
const transactionContext = this.salesTransactionService.state;
|
1344
1343
|
const configurationRoot = this.configurationService.root;
|