@veloceapps/sdk 4.0.19 → 4.0.20

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.
@@ -1028,6 +1028,7 @@
1028
1028
  this.states = {};
1029
1029
  this.lineItem = new rxjs.BehaviorSubject(undefined);
1030
1030
  this.charges = new rxjs.BehaviorSubject({});
1031
+ this.pricePlans = new rxjs.BehaviorSubject({});
1031
1032
  this.hasUnsavedChanges = false;
1032
1033
  }
1033
1034
  ConfigurationService.prototype.reset = function () {
@@ -1036,6 +1037,7 @@
1036
1037
  this.states = {};
1037
1038
  this.lineItem.next(undefined);
1038
1039
  this.charges.next({});
1040
+ this.pricePlans.next({});
1039
1041
  };
1040
1042
  ConfigurationService.prototype.patch$ = function (lineItem) {
1041
1043
  var _this = this;
@@ -1106,6 +1108,20 @@
1106
1108
  enumerable: false,
1107
1109
  configurable: true
1108
1110
  });
1111
+ Object.defineProperty(ConfigurationService.prototype, "pricePlans$", {
1112
+ get: function () {
1113
+ return this.pricePlans.asObservable();
1114
+ },
1115
+ enumerable: false,
1116
+ configurable: true
1117
+ });
1118
+ Object.defineProperty(ConfigurationService.prototype, "pricePlansSnapshot", {
1119
+ get: function () {
1120
+ return this.pricePlans.value;
1121
+ },
1122
+ enumerable: false,
1123
+ configurable: true
1124
+ });
1109
1125
  ConfigurationService.prototype.configure = function () {
1110
1126
  var _this = this;
1111
1127
  var _a, _b, _c, _d, _e, _f;
@@ -1123,9 +1139,10 @@
1123
1139
  return this.configurationApiService
1124
1140
  .configureLineItem({ configurationRequest: configurationRequest, runtimeModel: runtimeModel, pricingEnabled: pricingEnabled })
1125
1141
  .pipe(operators.map(function (_g) {
1126
- var lineItem = _g.lineItem, context = _g.context, charges = _g.charges, deletedLineItems = _g.deletedLineItems;
1142
+ var lineItem = _g.lineItem, context = _g.context, charges = _g.charges, pricePlans = _g.pricePlans, deletedLineItems = _g.deletedLineItems;
1127
1143
  _this.contextService.update(context !== null && context !== void 0 ? context : {});
1128
1144
  _this.charges.next(charges !== null && charges !== void 0 ? charges : {});
1145
+ _this.pricePlans.next(pricePlans !== null && pricePlans !== void 0 ? pricePlans : {});
1129
1146
  if (deletedLineItems === null || deletedLineItems === void 0 ? void 0 : deletedLineItems.length) {
1130
1147
  _this.showInactiveProductsConfirmation();
1131
1148
  }
@@ -1328,7 +1345,14 @@
1328
1345
  }
1329
1346
  FlowConfigurationService.prototype.calculate$ = function (quoteDraft) {
1330
1347
  var _this = this;
1331
- return this.proceduresApiService.apply$(quoteDraft).pipe(rxjs.tap(function (result) { return _this.quoteDraftService.updateQuoteDraft(result); }), rxjs.map(rxjs.noop));
1348
+ return this.proceduresApiService.apply$(quoteDraft).pipe(rxjs.tap(function (result) {
1349
+ // sort the result current state based on the quote draft initial state
1350
+ var initialStateIds = quoteDraft.initialState.map(function (lineItem) { return lineItem.integrationId; });
1351
+ result.currentState = result.currentState
1352
+ .slice()
1353
+ .sort(function (a, b) { return initialStateIds.indexOf(a.integrationId) - initialStateIds.indexOf(b.integrationId); });
1354
+ _this.quoteDraftService.updateQuoteDraft(result);
1355
+ }), rxjs.map(rxjs.noop));
1332
1356
  };
1333
1357
  FlowConfigurationService.prototype.calculate = function (quoteDraft) {
1334
1358
  this.calculate$(quoteDraft).subscribe();
@@ -1421,6 +1445,16 @@
1421
1445
  enumerable: false,
1422
1446
  configurable: true
1423
1447
  });
1448
+ Object.defineProperty(FlowConfigurationService.prototype, "pricePlans$", {
1449
+ get: function () {
1450
+ return this.quoteDraftService.quoteDraft$.pipe(rxjs.map(function (_c) {
1451
+ var pricePlans = _c.pricePlans;
1452
+ return pricePlans;
1453
+ }));
1454
+ },
1455
+ enumerable: false,
1456
+ configurable: true
1457
+ });
1424
1458
  Object.defineProperty(FlowConfigurationService.prototype, "chargesSnapshot", {
1425
1459
  get: function () {
1426
1460
  var _a, _b;
@@ -1429,6 +1463,14 @@
1429
1463
  enumerable: false,
1430
1464
  configurable: true
1431
1465
  });
1466
+ Object.defineProperty(FlowConfigurationService.prototype, "pricePlansSnapshot", {
1467
+ get: function () {
1468
+ var _a, _b;
1469
+ return (_b = (_a = this.quoteDraftService.quoteDraft) === null || _a === void 0 ? void 0 : _a.pricePlans) !== null && _b !== void 0 ? _b : {};
1470
+ },
1471
+ enumerable: false,
1472
+ configurable: true
1473
+ });
1432
1474
  Object.defineProperty(FlowConfigurationService.prototype, "contextSnapshot", {
1433
1475
  get: function () {
1434
1476
  return this.contextService.resolve();