@veloceapps/sdk 11.0.0-88 → 11.0.0-89
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/cms/cms.actions.d.ts +3 -1
- package/esm2020/cms/cms.actions.mjs +3 -3
- package/esm2020/core/modules/configuration/services/configuration-state.service.mjs +3 -3
- package/esm2020/core/modules/configuration/services/configuration.service.mjs +7 -3
- package/esm2020/src/services/flow.service.mjs +7 -5
- package/fesm2015/veloceapps-sdk-cms.mjs +2 -2
- package/fesm2015/veloceapps-sdk-cms.mjs.map +1 -1
- package/fesm2015/veloceapps-sdk-core.mjs +8 -4
- package/fesm2015/veloceapps-sdk-core.mjs.map +1 -1
- package/fesm2015/veloceapps-sdk.mjs +5 -3
- package/fesm2015/veloceapps-sdk.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk-cms.mjs +2 -2
- package/fesm2020/veloceapps-sdk-cms.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk-core.mjs +8 -4
- package/fesm2020/veloceapps-sdk-core.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk.mjs +5 -3
- package/fesm2020/veloceapps-sdk.mjs.map +1 -1
- package/package.json +1 -1
- package/src/services/flow.service.d.ts +3 -2
@@ -398,18 +398,22 @@ class ConfigurationService {
|
|
398
398
|
}
|
399
399
|
init$() {
|
400
400
|
const { state } = this.salesTransactionService;
|
401
|
-
const {
|
401
|
+
const { standalone } = this.flowInfoService.flow.properties;
|
402
|
+
const { productId, transactionItemId, newProductQty } = this.flowInfoService.context;
|
402
403
|
if (!state || !productId) {
|
403
404
|
return of(undefined);
|
404
405
|
}
|
405
406
|
const salesTransactionItems = state?.salesTransaction.salesTransactionItems ?? [];
|
406
407
|
let isRootGenerated = false;
|
407
408
|
let transactionItem = salesTransactionItems.find(item => item.id === transactionItemId);
|
408
|
-
if (!transactionItem) {
|
409
|
+
if (!transactionItem && standalone) {
|
409
410
|
transactionItem = salesTransactionItems.find(item => item.productId === productId);
|
410
411
|
}
|
411
412
|
if (!transactionItem) {
|
412
413
|
transactionItem = generateTransactionItem(productId);
|
414
|
+
if (typeof newProductQty === 'number' && newProductQty > 0) {
|
415
|
+
transactionItem.qty = newProductQty;
|
416
|
+
}
|
413
417
|
isRootGenerated = true;
|
414
418
|
}
|
415
419
|
const configurationState = {
|
@@ -1409,7 +1413,7 @@ class ConfigurationStateService {
|
|
1409
1413
|
transactionContext: state,
|
1410
1414
|
flowId: this.flowInfoService.flow.id,
|
1411
1415
|
};
|
1412
|
-
return this.salesTransactionApiService.save(request).pipe(map(id => ({ id })));
|
1416
|
+
return this.salesTransactionApiService.save(request).pipe(switchMap(r => this.flowStateService.executeRequest$({}, true).pipe(map(() => r))), map(id => ({ id })));
|
1413
1417
|
}
|
1414
1418
|
const transactionContext = this.salesTransactionService.state;
|
1415
1419
|
const configurationRoot = this.configurationService.root;
|
@@ -1432,7 +1436,7 @@ class ConfigurationStateService {
|
|
1432
1436
|
salesTransactionItems,
|
1433
1437
|
},
|
1434
1438
|
};
|
1435
|
-
return this.flowConfigurationService.calculate$(newState).pipe(map(() => ({ id: '' })));
|
1439
|
+
return this.flowConfigurationService.calculate$(newState).pipe(switchMap(() => this.flowStateService.executeRequest$({}, true)), map(() => ({ id: '' })));
|
1436
1440
|
}
|
1437
1441
|
cancelConfiguration() {
|
1438
1442
|
if (!this.isInitialized$.value) {
|