@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
@@ -1175,18 +1175,22 @@ class ConfigurationService {
|
|
1175
1175
|
init$() {
|
1176
1176
|
var _a;
|
1177
1177
|
const { state } = this.salesTransactionService;
|
1178
|
-
const {
|
1178
|
+
const { standalone } = this.flowInfoService.flow.properties;
|
1179
|
+
const { productId, transactionItemId, newProductQty } = this.flowInfoService.context;
|
1179
1180
|
if (!state || !productId) {
|
1180
1181
|
return of(undefined);
|
1181
1182
|
}
|
1182
1183
|
const salesTransactionItems = (_a = state === null || state === void 0 ? void 0 : state.salesTransaction.salesTransactionItems) !== null && _a !== void 0 ? _a : [];
|
1183
1184
|
let isRootGenerated = false;
|
1184
1185
|
let transactionItem = salesTransactionItems.find(item => item.id === transactionItemId);
|
1185
|
-
if (!transactionItem) {
|
1186
|
+
if (!transactionItem && standalone) {
|
1186
1187
|
transactionItem = salesTransactionItems.find(item => item.productId === productId);
|
1187
1188
|
}
|
1188
1189
|
if (!transactionItem) {
|
1189
1190
|
transactionItem = generateTransactionItem(productId);
|
1191
|
+
if (typeof newProductQty === 'number' && newProductQty > 0) {
|
1192
|
+
transactionItem.qty = newProductQty;
|
1193
|
+
}
|
1190
1194
|
isRootGenerated = true;
|
1191
1195
|
}
|
1192
1196
|
const configurationState = Object.assign(Object.assign({}, state), { salesTransaction: Object.assign(Object.assign({}, state.salesTransaction), { salesTransactionItems: transactionItem ? [transactionItem] : [] }) });
|
@@ -1396,7 +1400,7 @@ class ConfigurationStateService {
|
|
1396
1400
|
transactionContext: state,
|
1397
1401
|
flowId: this.flowInfoService.flow.id,
|
1398
1402
|
};
|
1399
|
-
return this.salesTransactionApiService.save(request).pipe(map(id => ({ id })));
|
1403
|
+
return this.salesTransactionApiService.save(request).pipe(switchMap(r => this.flowStateService.executeRequest$({}, true).pipe(map(() => r))), map(id => ({ id })));
|
1400
1404
|
}
|
1401
1405
|
const transactionContext = this.salesTransactionService.state;
|
1402
1406
|
const configurationRoot = this.configurationService.root;
|
@@ -1413,7 +1417,7 @@ class ConfigurationStateService {
|
|
1413
1417
|
salesTransactionItems = stateItems.map(ti => (ti.id === configurationRoot.id ? configurationRoot : ti));
|
1414
1418
|
}
|
1415
1419
|
const newState = Object.assign(Object.assign({}, transactionContext), { salesTransaction: Object.assign(Object.assign({}, transactionContext.salesTransaction), { salesTransactionItems }) });
|
1416
|
-
return this.flowConfigurationService.calculate$(newState).pipe(map(() => ({ id: '' })));
|
1420
|
+
return this.flowConfigurationService.calculate$(newState).pipe(switchMap(() => this.flowStateService.executeRequest$({}, true)), map(() => ({ id: '' })));
|
1417
1421
|
}
|
1418
1422
|
cancelConfiguration() {
|
1419
1423
|
var _a, _b;
|