@veloceapps/sdk 3.1.10 → 3.1.11
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/bundles/veloce-sdk-core.umd.js +38 -13
- package/bundles/veloce-sdk-core.umd.js.map +1 -1
- package/bundles/veloce-sdk.umd.js +4 -4
- package/bundles/veloce-sdk.umd.js.map +1 -1
- package/core/modules/configuration/helpers.d.ts +1 -1
- package/core/modules/configuration/services/configuration-runtime.service.d.ts +1 -0
- package/core/modules/configuration/services/configuration.service.d.ts +4 -2
- package/core/modules/configuration/types/configuration-runtime.types.d.ts +1 -0
- package/core/modules/flow-configuration/services/flow-configuration.service.d.ts +4 -1
- package/esm2015/core/modules/configuration/helpers.js +3 -3
- package/esm2015/core/modules/configuration/services/configuration-runtime.service.js +3 -1
- package/esm2015/core/modules/configuration/services/configuration.service.js +23 -11
- package/esm2015/core/modules/configuration/types/configuration-runtime.types.js +1 -1
- package/esm2015/core/modules/flow-configuration/services/flow-configuration.service.js +13 -4
- package/esm2015/src/pages/product/product.component.js +5 -5
- package/fesm2015/veloce-sdk-core.js +38 -16
- package/fesm2015/veloce-sdk-core.js.map +1 -1
- package/fesm2015/veloce-sdk.js +4 -4
- package/fesm2015/veloce-sdk.js.map +1 -1
- package/package.json +1 -1
- package/src/pages/product/product.component.d.ts +2 -2
@@ -1,20 +1,20 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
2
|
import { Injectable, NgModule } from '@angular/core';
|
3
3
|
import { UUID, ConfigurationContext, ConfigurationContextMode, RuntimeModel, SalesforceIdUtils, ConfigurationMode } from '@veloce/core';
|
4
|
-
import { BehaviorSubject, map as map$1, distinctUntilChanged, catchError, of, tap as tap$1, zip, combineLatest, throwError, shareReplay, noop, switchMap } from 'rxjs';
|
5
|
-
import { filter, tap, map, take, first, catchError as catchError$1 } from 'rxjs/operators';
|
4
|
+
import { BehaviorSubject, map as map$1, distinctUntilChanged, catchError, of, tap as tap$1, zip, combineLatest, throwError, shareReplay, noop, switchMap as switchMap$1 } from 'rxjs';
|
5
|
+
import { filter, tap, map, take, first, catchError as catchError$1, switchMap, finalize } from 'rxjs/operators';
|
6
6
|
import * as i1 from '@veloce/api';
|
7
7
|
import { PriceApiService, ContextApiService, ProductModelApiService, ConfigurationApiService } from '@veloce/api';
|
8
8
|
import { merge, flatten, sortBy, cloneDeep } from 'lodash';
|
9
9
|
import * as i2 from 'primeng/api';
|
10
|
-
import { ConfirmationComponent, ConfirmationDialogModule } from '@veloce/components';
|
10
|
+
import { ToastType, ConfirmationComponent, ConfirmationDialogModule } from '@veloce/components';
|
11
11
|
import * as i5 from 'primeng/dynamicdialog';
|
12
12
|
import moment from 'moment';
|
13
13
|
|
14
|
-
const getDefaultLineItem = (context, uiDefinitionProperties) => {
|
14
|
+
const getDefaultLineItem = (context, uiDefinitionProperties, qty = 1) => {
|
15
15
|
var _a, _b, _c;
|
16
16
|
const id = UUID.UUID();
|
17
|
-
const lineItem = Object.assign({ id, type: (_a = uiDefinitionProperties.rootType) !== null && _a !== void 0 ? _a : '', cfgStatus: 'Default', actionCode: 'ADD', qty
|
17
|
+
const lineItem = Object.assign({ id, type: (_a = uiDefinitionProperties.rootType) !== null && _a !== void 0 ? _a : '', cfgStatus: 'Default', actionCode: 'ADD', qty, productName: ((_b = context.properties) === null || _b === void 0 ? void 0 : _b.displayName) || context.productName, productId: (_c = context.productId) !== null && _c !== void 0 ? _c : '' }, (context.offeringId
|
18
18
|
? { offeringId: context.offeringId, offeringInstanceId: context.offeringInstanceId || id }
|
19
19
|
: {}));
|
20
20
|
return lineItem;
|
@@ -246,6 +246,7 @@ class ConfigurationRuntimeService {
|
|
246
246
|
this._isInitialized = false;
|
247
247
|
this._runtimeContext = undefined;
|
248
248
|
this._assets = undefined;
|
249
|
+
this.initializationProps = undefined;
|
249
250
|
this.uiDefinitionProperties = {};
|
250
251
|
}
|
251
252
|
initTestMode(modelId, uiDefinition) {
|
@@ -269,6 +270,7 @@ class ConfigurationRuntimeService {
|
|
269
270
|
}));
|
270
271
|
}
|
271
272
|
init(props) {
|
273
|
+
this.initializationProps = props;
|
272
274
|
this._assets = props.assets;
|
273
275
|
const context = this.contextService.resolve();
|
274
276
|
return this.runtimeContextService.getRuntimeContext(props.productId, props.offeringId).pipe(tap(runtimeContext => {
|
@@ -447,7 +449,8 @@ class LineItemWorker {
|
|
447
449
|
}
|
448
450
|
|
449
451
|
class ConfigurationService {
|
450
|
-
constructor(runtimeService, contextService, configurationApiService, messageService, dialogService) {
|
452
|
+
constructor(quoteDraftService, runtimeService, contextService, configurationApiService, messageService, dialogService) {
|
453
|
+
this.quoteDraftService = quoteDraftService;
|
451
454
|
this.runtimeService = runtimeService;
|
452
455
|
this.contextService = contextService;
|
453
456
|
this.configurationApiService = configurationApiService;
|
@@ -519,18 +522,19 @@ class ConfigurationService {
|
|
519
522
|
return this.charges.value;
|
520
523
|
}
|
521
524
|
configure() {
|
522
|
-
var _a, _b, _c, _d, _e;
|
525
|
+
var _a, _b, _c, _d, _e, _f;
|
523
526
|
const runtimeContext = this.getRuntimeContext();
|
524
527
|
const runtimeModel = this.getRuntimeModel();
|
525
528
|
if (!runtimeContext || !runtimeModel) {
|
526
529
|
return throwError(() => new Error('Runtime context/model not initialized'));
|
527
530
|
}
|
528
531
|
const uiDefinitionProperties = Object.assign(Object.assign({}, ((_b = (_a = runtimeContext.uiDefinition) === null || _a === void 0 ? void 0 : _a.properties) !== null && _b !== void 0 ? _b : {})), ((_c = this.runtimeService.uiDefinitionProperties) !== null && _c !== void 0 ? _c : {}));
|
529
|
-
const
|
532
|
+
const qty = (_d = this.runtimeService.initializationProps) === null || _d === void 0 ? void 0 : _d.defaultQty;
|
533
|
+
const lineItem = (_e = this.states.configurableRamp) !== null && _e !== void 0 ? _e : getDefaultLineItem(runtimeContext, uiDefinitionProperties, qty);
|
530
534
|
const configurationRequest = this.createRequest(lineItem);
|
531
535
|
configurationRequest.lineItems = this.states.currentState || [];
|
532
536
|
configurationRequest.asset = this.states.asset;
|
533
|
-
const mainPricingEnabled = (
|
537
|
+
const mainPricingEnabled = (_f = runtimeContext.properties) === null || _f === void 0 ? void 0 : _f.PricingEnabled;
|
534
538
|
const pricingEnabled = mainPricingEnabled ? mainPricingEnabled === 'true' : uiDefinitionProperties.pricingEnabled;
|
535
539
|
return this.configurationApiService
|
536
540
|
.configureLineItem({ configurationRequest, runtimeModel, pricingEnabled })
|
@@ -544,6 +548,16 @@ class ConfigurationService {
|
|
544
548
|
}))
|
545
549
|
.pipe(tap(lineItem => lineItem && this.lineItem.next(lineItem)), catchError$1(error => throwError(() => { var _a; return new Error(((_a = error.error) === null || _a === void 0 ? void 0 : _a.message) || error.message || JSON.stringify(error)); })));
|
546
550
|
}
|
551
|
+
configureExternal$(productId, qty) {
|
552
|
+
// TODO: uncomment when procedure issue is fixed on backend side
|
553
|
+
// this.updateCurrentStates({
|
554
|
+
// currentState: this.quoteDraftService.quoteSnapshot?.currentState ?? [],
|
555
|
+
// });
|
556
|
+
return this.runtimeService.init({ productId, defaultQty: qty }).pipe(switchMap(() => this.configure()), first(), catchError$1(error => {
|
557
|
+
this.messageService.add({ severity: ToastType.error, summary: error });
|
558
|
+
throw error;
|
559
|
+
}), finalize(() => this.reset()));
|
560
|
+
}
|
547
561
|
createRequest(lineItem) {
|
548
562
|
return {
|
549
563
|
lineItem,
|
@@ -579,11 +593,11 @@ class ConfigurationService {
|
|
579
593
|
});
|
580
594
|
}
|
581
595
|
}
|
582
|
-
ConfigurationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ConfigurationService, deps: [{ token: ConfigurationRuntimeService }, { token: ContextService }, { token: i1.ConfigurationApiService }, { token: i2.MessageService }, { token: i5.DialogService }], target: i0.ɵɵFactoryTarget.Injectable });
|
596
|
+
ConfigurationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ConfigurationService, deps: [{ token: QuoteDraftService }, { token: ConfigurationRuntimeService }, { token: ContextService }, { token: i1.ConfigurationApiService }, { token: i2.MessageService }, { token: i5.DialogService }], target: i0.ɵɵFactoryTarget.Injectable });
|
583
597
|
ConfigurationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ConfigurationService });
|
584
598
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ConfigurationService, decorators: [{
|
585
599
|
type: Injectable
|
586
|
-
}], ctorParameters: function () { return [{ type: ConfigurationRuntimeService }, { type: ContextService }, { type: i1.ConfigurationApiService }, { type: i2.MessageService }, { type: i5.DialogService }]; } });
|
600
|
+
}], ctorParameters: function () { return [{ type: QuoteDraftService }, { type: ConfigurationRuntimeService }, { type: ContextService }, { type: i1.ConfigurationApiService }, { type: i2.MessageService }, { type: i5.DialogService }]; } });
|
587
601
|
|
588
602
|
class FlowUpdateService {
|
589
603
|
update(rootLineItems, updates) {
|
@@ -695,12 +709,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
695
709
|
}] });
|
696
710
|
|
697
711
|
class FlowConfigurationService {
|
698
|
-
constructor(priceApiService, contextService, quoteDraftService, messageService, updateService) {
|
712
|
+
constructor(priceApiService, contextService, quoteDraftService, messageService, updateService, configurationService) {
|
699
713
|
this.priceApiService = priceApiService;
|
700
714
|
this.contextService = contextService;
|
701
715
|
this.quoteDraftService = quoteDraftService;
|
702
716
|
this.messageService = messageService;
|
703
717
|
this.updateService = updateService;
|
718
|
+
this.configurationService = configurationService;
|
704
719
|
this.charges = new BehaviorSubject({});
|
705
720
|
this.bounceBackUpdate$ = new BehaviorSubject(true);
|
706
721
|
}
|
@@ -728,13 +743,13 @@ class FlowConfigurationService {
|
|
728
743
|
}
|
729
744
|
update$(updates) {
|
730
745
|
const lineItems = cloneDeep(this.getSnapshot());
|
731
|
-
return of([]).pipe(tap$1(() => this.updateService.update(lineItems, updates)), this.handleError(), switchMap(() => this.calculate$(lineItems)));
|
746
|
+
return of([]).pipe(tap$1(() => this.updateService.update(lineItems, updates)), this.handleError(), switchMap$1(() => this.calculate$(lineItems)));
|
732
747
|
}
|
733
748
|
update(updates) {
|
734
749
|
this.update$(updates).subscribe();
|
735
750
|
}
|
736
751
|
delete$(ids) {
|
737
|
-
return of([]).pipe(map$1(() => ids.reduce((result, id) => this.updateService.delete(result, id), this.getSnapshot())), this.handleError(), switchMap(currentState => this.calculate$(currentState)));
|
752
|
+
return of([]).pipe(map$1(() => ids.reduce((result, id) => this.updateService.delete(result, id), this.getSnapshot())), this.handleError(), switchMap$1(currentState => this.calculate$(currentState)));
|
738
753
|
}
|
739
754
|
delete(ids) {
|
740
755
|
this.delete$(ids).subscribe();
|
@@ -742,6 +757,13 @@ class FlowConfigurationService {
|
|
742
757
|
get() {
|
743
758
|
return combineLatest([this.quoteDraftService.quote$, this.bounceBackUpdate$]).pipe(map$1(([quoteDraft]) => quoteDraft.currentState), shareReplay());
|
744
759
|
}
|
760
|
+
addToCart$(productId, qty) {
|
761
|
+
return this.configurationService.configureExternal$(productId, qty).pipe(tap$1(lineItem => {
|
762
|
+
var _a, _b;
|
763
|
+
const currentState = (_b = (_a = this.quoteDraftService.quoteSnapshot) === null || _a === void 0 ? void 0 : _a.currentState) !== null && _b !== void 0 ? _b : [];
|
764
|
+
this.quoteDraftService.setCurrentLineItemState([...currentState, lineItem]);
|
765
|
+
}), map$1(noop));
|
766
|
+
}
|
745
767
|
getSnapshot() {
|
746
768
|
var _a, _b;
|
747
769
|
return (_b = (_a = this.quoteDraftService.quoteSnapshot) === null || _a === void 0 ? void 0 : _a.currentState.slice()) !== null && _b !== void 0 ? _b : [];
|
@@ -770,11 +792,11 @@ class FlowConfigurationService {
|
|
770
792
|
};
|
771
793
|
}
|
772
794
|
}
|
773
|
-
FlowConfigurationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowConfigurationService, deps: [{ token: i1.PriceApiService }, { token: ContextService }, { token: QuoteDraftService }, { token: i2.MessageService }, { token: FlowUpdateService }], target: i0.ɵɵFactoryTarget.Injectable });
|
795
|
+
FlowConfigurationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowConfigurationService, deps: [{ token: i1.PriceApiService }, { token: ContextService }, { token: QuoteDraftService }, { token: i2.MessageService }, { token: FlowUpdateService }, { token: ConfigurationService }], target: i0.ɵɵFactoryTarget.Injectable });
|
774
796
|
FlowConfigurationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowConfigurationService });
|
775
797
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowConfigurationService, decorators: [{
|
776
798
|
type: Injectable
|
777
|
-
}], ctorParameters: function () { return [{ type: i1.PriceApiService }, { type: ContextService }, { type: QuoteDraftService }, { type: i2.MessageService }, { type: FlowUpdateService }]; } });
|
799
|
+
}], ctorParameters: function () { return [{ type: i1.PriceApiService }, { type: ContextService }, { type: QuoteDraftService }, { type: i2.MessageService }, { type: FlowUpdateService }, { type: ConfigurationService }]; } });
|
778
800
|
|
779
801
|
class FlowConfigurationModule {
|
780
802
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"veloce-sdk-core.js","sources":["../../../../libs/sdk/core/modules/configuration/helpers.ts","../../../../libs/sdk/core/types/runtime.types.ts","../../../../libs/sdk/core/services/context.service.ts","../../../../libs/sdk/core/services/product-images.service.ts","../../../../libs/sdk/core/services/quote-draft.service.ts","../../../../libs/sdk/core/modules/configuration/services/runtime-context.service.ts","../../../../libs/sdk/core/modules/configuration/services/configuration-runtime.service.ts","../../../../libs/sdk/core/utils/line-item.utils.ts","../../../../libs/sdk/core/utils/line-item.worker.ts","../../../../libs/sdk/core/modules/configuration/services/configuration.service.ts","../../../../libs/sdk/core/modules/flow-configuration/services/flow-update.service.ts","../../../../libs/sdk/core/modules/flow-configuration/services/flow-configuration.service.ts","../../../../libs/sdk/core/modules/flow-configuration/flow-configuration.module.ts","../../../../libs/sdk/core/modules/configuration/configuration.module.ts","../../../../libs/sdk/core/core.module.ts","../../../../libs/sdk/core/veloce-sdk-core.ts"],"sourcesContent":["import { LineItem, UUID } from '@veloce/core';\nimport { RuntimeContext, UIDefinitionProps } from '../../types';\n\nexport const getDefaultLineItem = (context: RuntimeContext, uiDefinitionProperties: UIDefinitionProps): LineItem => {\n const id = UUID.UUID();\n\n const lineItem: LineItem = {\n id,\n type: uiDefinitionProperties.rootType ?? '',\n cfgStatus: 'Default',\n actionCode: 'ADD',\n qty: 1,\n productName: context.properties?.displayName || context.productName,\n productId: context.productId ?? '',\n ...(context.offeringId\n ? { offeringId: context.offeringId, offeringInstanceId: context.offeringInstanceId || id }\n : {}),\n } as LineItem;\n\n return lineItem;\n};\n","import { ContextProperties, RuntimeModel } from '@veloce/core';\nimport { UIDefinition } from './ui-definition.types';\n\nexport enum RuntimeMode {\n TEST,\n PROD,\n}\n\nexport enum RuntimeOperation {\n INIT = 'INIT',\n UPDATE = 'UPDATE',\n}\n\nexport enum RuntimeStep {\n START = 'START',\n UPDATE = 'UPDATE',\n}\n\nexport interface InvocationContext {\n runtimeOperation?: RuntimeOperation;\n runtimeStep?: RuntimeStep;\n}\n\nexport interface RuntimeContext {\n modelId: string;\n runtimeMode: RuntimeMode;\n runtimeModel: RuntimeModel;\n uiDefinition?: UIDefinition;\n productId?: string;\n productName?: string;\n productType?: string;\n properties?: ContextProperties;\n offeringId?: string;\n offeringInstanceId?: string;\n invocationContext?: InvocationContext;\n}\n","import { Injectable } from '@angular/core';\nimport { ContextApiService } from '@veloce/api';\nimport { ConfigurationContext, ConfigurationContextMode } from '@veloce/core';\nimport { merge } from 'lodash';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { filter, map, tap } from 'rxjs/operators';\n\n@Injectable({ providedIn: 'root' })\nexport class ContextService {\n private context = new BehaviorSubject<ConfigurationContext | null>(null);\n\n constructor(private contextApiService: ContextApiService) {}\n\n get isInitialized(): boolean {\n return Boolean(this.context.value);\n }\n\n resolve(): ConfigurationContext {\n if (!this.context.value) {\n throw new Error('Context is not initialized yet!');\n }\n\n return { ...this.context.value };\n }\n\n resolve$(): Observable<ConfigurationContext> {\n return this.context.pipe(filter((ctx): ctx is ConfigurationContext => Boolean(ctx)));\n }\n\n create(headerId: string, mode: ConfigurationContextMode): Observable<ConfigurationContext> {\n return this.contextApiService.getContext(headerId, mode).pipe(\n tap(context => this.context.next(merge(new ConfigurationContext(headerId, mode), context))),\n map(() => this.resolve() as ConfigurationContext),\n );\n }\n\n public update(partialContext: Partial<ConfigurationContext>): ConfigurationContext {\n const originalContext = this.resolve();\n\n const updatedContext: ConfigurationContext = {\n ...originalContext,\n ...(partialContext as ConfigurationContext),\n properties: {\n ...originalContext.properties,\n ...partialContext.properties,\n },\n };\n\n this.context.next(updatedContext);\n\n return updatedContext;\n }\n\n public delete(): void {\n this.context.next(null);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ProductApiService } from '@veloce/api';\nimport { Dictionary } from 'lodash';\nimport { BehaviorSubject, catchError, distinctUntilChanged, map, Observable, of, tap } from 'rxjs';\n\n@Injectable({ providedIn: 'root' })\nexport class ProductImagesService {\n private imagesMap$ = new BehaviorSubject<Dictionary<string>>({});\n\n constructor(private productApiService: ProductApiService) {}\n\n public getImageUrl$(productId: string): Observable<string | null> {\n if (this.imagesMap$.value[productId] == null) {\n this.imagesMap$.next({ ...this.imagesMap$.value, [productId]: '' });\n this.fetchProductImage(productId);\n }\n\n return this.imagesMap$.pipe(\n map(imagesMap => imagesMap[productId]),\n distinctUntilChanged(),\n );\n }\n\n private fetchProductImage(productId: string): void {\n this.productApiService\n .fetchImage$(productId)\n .pipe(\n map(file => URL.createObjectURL(file)),\n catchError(() => of('')),\n tap(url => this.imagesMap$.next({ ...this.imagesMap$.value, [productId]: url })),\n )\n .subscribe();\n }\n}\n","import { Injectable } from '@angular/core';\nimport { PriceApiService, QuoteApiService } from '@veloce/api';\nimport { ConfigurationContextMode, LineItem, PriceList, PriceSummary, QuoteDraft } from '@veloce/core';\nimport { Dictionary } from 'lodash';\nimport { BehaviorSubject, combineLatest, Observable, zip } from 'rxjs';\nimport { filter, map, take, tap } from 'rxjs/operators';\nimport { ContextService } from './context.service';\n\n@Injectable({ providedIn: 'root' })\nexport class QuoteDraftService {\n private quoteSubj$ = new BehaviorSubject<QuoteDraft | null>(null);\n private resetSubj$ = new BehaviorSubject(true);\n\n public priceLists: PriceList[] = [];\n public quotePriceList?: PriceList;\n public isInitialized = false;\n public hasUnsavedChanges = false;\n public reset$ = this.resetSubj$.asObservable();\n\n constructor(\n private context: ContextService,\n private quoteApiService: QuoteApiService,\n private priceApiService: PriceApiService,\n ) {}\n\n public reset() {\n this.resetSubj$.next(true);\n this.quoteSubj$.next(null);\n }\n\n public init(quoteId: string, params: Dictionary<string>): Observable<void> {\n return zip(\n this.quoteApiService.getQuoteDraft(quoteId, params),\n this.priceApiService.getPriceLists(),\n this.context.resolve$(),\n ).pipe(\n tap(([quote, priceLists, context]) => {\n this.quoteSubj$.next(quote);\n this.priceLists = priceLists;\n this.quotePriceList = priceLists.find(p => p.id === context.properties.PriceListId);\n\n this.context.update({\n ...context,\n ...quote.context,\n properties: {\n ...context.properties,\n ...quote.context.properties,\n },\n });\n }),\n map(() => {\n this.isInitialized = true;\n }),\n take(1),\n );\n }\n\n public setCurrentLineItemState(lineItems: LineItem[]): void {\n const quote = this.quoteSubj$.value;\n\n if (!quote) {\n return;\n }\n\n this.quoteSubj$.next({\n ...quote,\n currentState: lineItems,\n });\n\n this.markAsUpdated();\n }\n\n public updateByPriceSummary(priceSummary: PriceSummary): void {\n const quote = this.quoteSubj$.value;\n\n if (!quote) {\n return;\n }\n\n this.quoteSubj$.next({\n ...quote,\n currentState: priceSummary.lineItems,\n totalPrices: priceSummary.totalPrices,\n approvalItems: priceSummary.approvalItems,\n });\n\n this.markAsUpdated();\n }\n\n get quote$(): Observable<QuoteDraft> {\n return combineLatest([this.quoteSubj$, this.context.resolve$()]).pipe(\n map(() => this.quoteSnapshot),\n filter((quote): quote is QuoteDraft => Boolean(quote)),\n );\n }\n\n get quoteSnapshot(): QuoteDraft | null {\n const quote = this.quoteSubj$.value;\n\n if (!quote) {\n return null;\n }\n\n return {\n ...quote,\n context: this.context.resolve(),\n };\n }\n\n get isStandalone() {\n return this.context.resolve().properties.standalone === 'true';\n }\n\n public isEditMode$(): Observable<boolean> {\n return this.context.resolve$().pipe(map(() => this.isEditMode()));\n }\n\n public isEditMode(): boolean {\n const context = this.context.resolve();\n\n if (context.mode === ConfigurationContextMode.ACCOUNT) {\n return true;\n }\n\n if (context.mode === ConfigurationContextMode.QUOTE) {\n return context.properties.Status === 'Draft';\n }\n\n return false;\n }\n\n private markAsUpdated(): void {\n if (this.isInitialized && !this.hasUnsavedChanges) {\n this.hasUnsavedChanges = true;\n }\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ConfigurationApiService } from '@veloce/api';\nimport { RuntimeData, RuntimeModel, UIDefinition as LegacyUiDefinition } from '@veloce/core';\nimport { MessageService } from 'primeng/api';\nimport { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { RuntimeContext, RuntimeMode, UIDefinition } from '../../../types';\n\n@Injectable()\nexport class RuntimeContextService {\n constructor(private configurationApiService: ConfigurationApiService, private messageService: MessageService) {}\n\n getRuntimeContext(productId: string, offeringId?: string): Observable<RuntimeContext> {\n return this.configurationApiService.getRuntimeDataByProductId(productId, offeringId).pipe(\n map(runtimeData => {\n const uiDefinition = this.getUIDefinition(runtimeData);\n const runtimeModel = RuntimeModel.create(runtimeData.types, runtimeData.products);\n const { productName, properties } =\n Array.from(runtimeModel.components.values()).find(c => c.productId === productId) ?? {};\n\n return {\n modelId: runtimeData.modelId,\n uiDefinition: uiDefinition,\n runtimeModel: runtimeModel,\n runtimeMode: RuntimeMode.PROD,\n productId: productId,\n productType: properties?.displayName || productName,\n offeringId: offeringId,\n properties: {\n PricingEnabled: uiDefinition?.properties?.pricingEnabled ? 'true' : 'false',\n PriceListId: uiDefinition?.properties?.priceList,\n },\n };\n }),\n );\n }\n\n private getUIDefinition(runtimeData: RuntimeData): UIDefinition | undefined {\n let rawUiDefinitions: Array<UIDefinition | LegacyUiDefinition>;\n try {\n rawUiDefinitions = JSON.parse(runtimeData.uiDefinitionsSource);\n } catch (e) {\n return;\n }\n\n const uiDefinitions = rawUiDefinitions.filter(uiDef => (uiDef as UIDefinition).version) as UIDefinition[];\n const uiDefinition = uiDefinitions.find(uiDef => uiDef.primary) ?? uiDefinitions[0];\n\n if (!uiDefinition) {\n const errMsg = `Unable to find Default UI`;\n\n this.messageService.add({\n severity: 'error',\n summary: 'ERROR',\n });\n throw new Error(errMsg);\n }\n\n return uiDefinition;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ConfigurationApiService } from '@veloce/api';\nimport { ConfigurationContextMode, LineItem, RuntimeModel, SalesforceIdUtils } from '@veloce/core';\nimport { Dictionary } from 'lodash';\nimport { combineLatest, Observable } from 'rxjs';\nimport { first, tap } from 'rxjs/operators';\nimport { ContextService } from '../../../services';\nimport { RuntimeContext, RuntimeMode, UIDefinition, UIDefinitionProps } from '../../../types';\nimport { RuntimeInitializationProps } from '../types/configuration-runtime.types';\nimport { RuntimeContextService } from './runtime-context.service';\n\n@Injectable()\nexport class ConfigurationRuntimeService {\n private _runtimeContext?: RuntimeContext;\n private _assets?: LineItem[];\n private _isInitialized = false;\n\n public uiDefinitionProperties: UIDefinitionProps = {};\n\n constructor(\n private apiService: ConfigurationApiService,\n private contextService: ContextService,\n private runtimeContextService: RuntimeContextService,\n ) {}\n\n public reset() {\n this._isInitialized = false;\n this._runtimeContext = undefined;\n this._assets = undefined;\n this.uiDefinitionProperties = {};\n }\n\n public initTestMode(modelId: string, uiDefinition: UIDefinition) {\n this.uiDefinitionProperties = uiDefinition.properties ?? {};\n const uiDefinitionExternals = uiDefinition.externals ?? {};\n\n return combineLatest([\n this.apiService.getRuntimeDataByModelId(modelId),\n this.contextService.create('TestId', ConfigurationContextMode.TEST),\n ]).pipe(\n first(),\n tap(([runtimeData, context]) => {\n this._runtimeContext = {\n modelId: modelId,\n runtimeModel: RuntimeModel.create(runtimeData.types, runtimeData.products),\n runtimeMode: RuntimeMode.TEST,\n };\n\n this.contextService.update({\n properties: {\n ...this.runtimeContext?.properties,\n ...context.properties,\n ModelId: modelId,\n RuntimeMode: ConfigurationContextMode.TEST,\n PricingEnabled: this.uiDefinitionProperties.pricingEnabled ? 'true' : 'false',\n StartDate: new Date().toISOString().substring(0, 10),\n PriceListId: this.uiDefinitionProperties.priceList,\n standalone: 'true',\n ...uiDefinitionExternals,\n },\n });\n\n this._isInitialized = true;\n }),\n );\n }\n\n public init(props: RuntimeInitializationProps): Observable<RuntimeContext | undefined> {\n this._assets = props.assets;\n const context = this.contextService.resolve();\n\n return this.runtimeContextService.getRuntimeContext(props.productId, props.offeringId).pipe(\n tap(runtimeContext => {\n this.uiDefinitionProperties = runtimeContext.uiDefinition?.properties ?? {};\n const { PriceListId } = context.properties ?? {};\n\n const mergeContext: RuntimeContext = {\n ...runtimeContext,\n properties: {\n ...runtimeContext.properties,\n ...context.properties,\n PricingEnabled: PriceListId ? 'true' : 'false',\n },\n };\n\n this.id15to18('AccountId', mergeContext.properties);\n this._runtimeContext = mergeContext;\n\n if (context.properties && this._runtimeContext.properties?.StartDate) {\n this.contextService.update({\n properties: {\n ...this._runtimeContext.properties,\n ...context.properties,\n },\n });\n }\n\n this._isInitialized = true;\n }),\n );\n }\n\n private id15to18(propertyName: string, source?: Dictionary<any>) {\n if (!source) {\n return;\n }\n\n const value = source[propertyName];\n\n if (typeof value === 'string' && value.length === 15) {\n source[propertyName] = SalesforceIdUtils.generateId18FromId15(value);\n }\n }\n\n public getAsset(lineItem: LineItem): LineItem | undefined {\n return this._assets && this._assets.find(a => a.id === lineItem.openOrderLineItemId || a.id === lineItem.assetId);\n }\n\n public get isInitialized() {\n return this._isInitialized;\n }\n\n public get runtimeModel() {\n return this.runtimeContext?.runtimeModel;\n }\n\n public get runtimeContext() {\n return this._runtimeContext;\n }\n}\n","import { Attribute, CfgStatus, LineItem, PortDomain } from '@veloce/core';\nimport { Dictionary, flatten, sortBy } from 'lodash';\n\nexport const findLineItem = (id: string, lineItems: LineItem[]): LineItem | undefined => {\n return findLineItemWithComparator(lineItems, (li: LineItem) => li.id === id);\n};\n\nexport const findLineItemWithComparator = (\n lineItems: LineItem[],\n comparator: (li: LineItem) => boolean,\n): LineItem | undefined => {\n let currentLevel = lineItems;\n\n while (currentLevel.length) {\n const found = currentLevel.find(comparator);\n\n if (found) {\n return found;\n }\n\n currentLevel = flatten(currentLevel.map(parent => parent.lineItems));\n }\n\n return;\n};\n\nexport const insertLineItem = (lineItem: LineItem, parentId: string, toInsert: LineItem): LineItem => {\n const insertData = lineItem.id === parentId ? [toInsert] : [];\n return {\n ...lineItem,\n lineItems: [\n ...insertData,\n ...lineItem.lineItems.map(li => {\n return insertLineItem(li, parentId, toInsert);\n }),\n ],\n };\n};\n\nexport const removeLineItem = (lineItem: LineItem, idToRemove: string): LineItem => {\n return {\n ...lineItem,\n lineItems: lineItem.lineItems\n .map(li => {\n if (li.id === idToRemove) {\n return;\n } else if (li.lineItems.length) {\n return removeLineItem(li, idToRemove);\n }\n return li;\n })\n .filter(r => !!r) as LineItem[],\n };\n};\n\nexport const replaceLineItem = (lineItem: LineItem, replaceTo: LineItem): LineItem => {\n if (lineItem.id === replaceTo.id) {\n return { ...replaceTo };\n }\n\n return {\n ...lineItem,\n lineItems: lineItem.lineItems.map(li => {\n if (li.id === replaceTo.id) {\n return replaceTo;\n } else if (li.lineItems.length) {\n return replaceLineItem(li, replaceTo);\n }\n return li;\n }),\n };\n};\n\nexport const mapAttributes = (attributes: Attribute[]): Dictionary<any> => {\n return attributes.reduce((acc, { name, value }) => ({ ...acc, [name]: value }), {});\n};\n\nexport const getAttributes = (attributes: Attribute[], names: string[] = []) => {\n const filtered = attributes.filter(({ name }) => names.includes(name));\n return sortBy(filtered, [({ name }) => names.indexOf(name)]);\n};\n\nexport const upsertAttributes = (\n originalAttributes: Attribute[],\n attributesToUpsert: { name: string; value: any }[],\n) => {\n return attributesToUpsert.reduce((acc, { name, value }) => {\n const [origAttr] = getAttributes(acc, [name]);\n return [\n ...acc.filter(attr => attr.name !== name),\n { ...(origAttr ?? { name }), cfgStatus: 'User' as CfgStatus, value },\n ];\n }, originalAttributes);\n};\n\nexport const patchAttributes = (rootLineItem: LineItem, id: string, attrs: { name: string; value: any }[]) => {\n const lineItem = findLineItem(id, [rootLineItem]);\n\n if (!lineItem) {\n return rootLineItem;\n }\n\n const attributes = upsertAttributes(lineItem.attributes, attrs);\n return replaceLineItem(rootLineItem, { ...lineItem, attributes });\n};\n\nexport const getAttributeValue = (attributes: Attribute[], name: string): any =>\n attributes.find(attr => attr.name === name)?.value;\n\nexport const generateLineItem = (\n port: string,\n type: string,\n parentId: string,\n attributes: { name: string; value: any }[] = [],\n lineItems: LineItem[] = [],\n): LineItem => {\n return {\n port,\n type,\n actionCode: 'ADD',\n cfgStatus: 'New',\n attributes: attributes.map(({ name, value }) => ({ cfgStatus: 'User', name, value })),\n lineItems,\n parentId,\n qty: 1,\n } as LineItem;\n};\n\nexport const getRecommendedPrices = (portDomain: PortDomain, type: string): { net: number; list: number } => {\n const domainType = portDomain.domainTypes.find(({ name }) => name === type);\n\n const [net, list] = domainType?.recommendedPrices\n ?.filter(({ chargeMethod }) => chargeMethod === 'ONE_TIME')\n .reduce(\n (acc, rp) => {\n const [netPrice, listPrice] = acc;\n return [netPrice + rp.netPrice, listPrice + rp.listPrice];\n },\n [0, 0],\n ) ?? [0, 0];\n\n return { net, list };\n};\n","import { LineItem } from '@veloce/core';\nimport { insertLineItem, patchAttributes, removeLineItem, replaceLineItem } from './line-item.utils';\n\nexport class LineItemWorker {\n public li: LineItem;\n\n constructor(src: LineItem) {\n this.li = { ...src };\n }\n\n public insert(parentId: string, toInsert: LineItem): LineItemWorker {\n return new LineItemWorker(insertLineItem(this.li, parentId, toInsert));\n }\n\n public remove(id: string): LineItemWorker {\n return new LineItemWorker(removeLineItem(this.li, id));\n }\n\n public replace(toReplace: LineItem): LineItemWorker {\n return new LineItemWorker(replaceLineItem(this.li, toReplace));\n }\n\n public patchAttribute(attrs: { name: string; value: any }[], id?: string): LineItemWorker {\n return new LineItemWorker(patchAttributes(this.li, id ?? this.li.id, attrs));\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ConfigurationApiService } from '@veloce/api';\nimport { ConfirmationComponent } from '@veloce/components';\nimport {\n ConfigurationContext,\n ConfigurationMode,\n ConfigurationRequest,\n LineItem,\n PricePlanCharge,\n RuntimeModel,\n VlWindow,\n} from '@veloce/core';\nimport { Dictionary } from 'lodash';\nimport { MessageService } from 'primeng/api';\nimport { DialogService } from 'primeng/dynamicdialog';\nimport { BehaviorSubject, Observable, shareReplay, throwError } from 'rxjs';\nimport { catchError, map, tap } from 'rxjs/operators';\nimport { ContextService } from '../../../services';\nimport { QuoteStates, RuntimeContext, RuntimeStep } from '../../../types';\nimport { LineItemWorker } from '../../../utils';\nimport { getDefaultLineItem } from '../helpers';\nimport { ConfigurationRuntimeService } from './configuration-runtime.service';\n\ndeclare const window: VlWindow;\n\n@Injectable()\nexport class ConfigurationService {\n private mode = ConfigurationMode.SEARCH;\n private states: QuoteStates = {};\n\n private lineItem = new BehaviorSubject<LineItem | undefined>(undefined);\n private charges = new BehaviorSubject<Dictionary<PricePlanCharge>>({});\n\n public hasUnsavedChanges = false;\n\n constructor(\n private runtimeService: ConfigurationRuntimeService,\n private contextService: ContextService,\n private configurationApiService: ConfigurationApiService,\n private messageService: MessageService,\n private dialogService: DialogService,\n ) {}\n\n public reset() {\n this.hasUnsavedChanges = false;\n this.runtimeService.reset();\n\n this.states = {};\n this.lineItem.next(undefined);\n this.charges.next({});\n }\n\n public patch$(lineItem: LineItem): Observable<LineItem> {\n if (!this.lineItem.value) {\n return throwError(() => new Error(`Source LineItem not found`));\n }\n\n this.states.configurableRamp = new LineItemWorker(this.lineItem.value).replace(lineItem).li;\n this.states.asset = this.states.configurableRamp\n ? this.runtimeService.getAsset(this.states.configurableRamp)\n : undefined;\n\n return this.configure().pipe(\n catchError(error => {\n console.error(error);\n\n if (!this.runtimeService.uiDefinitionProperties.suppressToastMessages) {\n this.messageService.add({ severity: 'error', summary: error });\n }\n\n // bounce back if configuration call has failed\n this.lineItem.next(this.lineItem.value ? { ...this.lineItem.value } : undefined);\n\n return throwError(() => error);\n }),\n tap(() => {\n if (!this.hasUnsavedChanges) {\n this.hasUnsavedChanges = true;\n }\n }),\n );\n }\n\n public patch(lineItem: LineItem): void {\n this.patch$(lineItem).subscribe();\n }\n\n public updateCurrentStates(update: Partial<QuoteStates>) {\n this.states = {\n ...this.states,\n ...update,\n };\n }\n\n public get(): Observable<LineItem | undefined> {\n return this.lineItem.asObservable().pipe(shareReplay());\n }\n\n public getSnapshot(): LineItem | undefined {\n return this.lineItem.value ? { ...this.lineItem.value } : undefined;\n }\n\n public getRuntimeModel(): RuntimeModel | undefined {\n return this.runtimeService.runtimeModel;\n }\n\n public getRuntimeContext(): RuntimeContext | undefined {\n return this.runtimeService.runtimeContext;\n }\n\n public get contextSnapshot(): ConfigurationContext {\n return this.contextService.resolve();\n }\n\n public get context$(): Observable<ConfigurationContext> {\n return this.contextService.resolve$();\n }\n\n public get charges$(): Observable<Dictionary<PricePlanCharge>> {\n return this.charges.asObservable();\n }\n\n public get chargesSnapshot(): Dictionary<PricePlanCharge> {\n return this.charges.value;\n }\n\n public configure(): Observable<LineItem> {\n const runtimeContext = this.getRuntimeContext();\n const runtimeModel = this.getRuntimeModel();\n if (!runtimeContext || !runtimeModel) {\n return throwError(() => new Error('Runtime context/model not initialized'));\n }\n\n const uiDefinitionProperties = {\n ...(runtimeContext.uiDefinition?.properties ?? {}),\n ...(this.runtimeService.uiDefinitionProperties ?? {}),\n };\n const lineItem = this.states.configurableRamp ?? getDefaultLineItem(runtimeContext, uiDefinitionProperties);\n const configurationRequest = this.createRequest(lineItem);\n configurationRequest.lineItems = this.states.currentState || [];\n configurationRequest.asset = this.states.asset;\n const mainPricingEnabled = runtimeContext.properties?.PricingEnabled;\n const pricingEnabled = mainPricingEnabled ? mainPricingEnabled === 'true' : uiDefinitionProperties.pricingEnabled;\n return this.configurationApiService\n .configureLineItem({ configurationRequest, runtimeModel, pricingEnabled })\n .pipe(\n map(({ lineItem, context, charges, deletedLineItems }) => {\n this.contextService.update(context ?? {});\n this.charges.next(charges ?? {});\n if (deletedLineItems?.length) {\n this.showInactiveProductsConfirmation();\n }\n return lineItem;\n }),\n )\n .pipe(\n tap(lineItem => lineItem && this.lineItem.next(lineItem)),\n catchError(error =>\n throwError(() => new Error(error.error?.message || error.message || JSON.stringify(error))),\n ),\n );\n }\n\n private createRequest(lineItem: LineItem): ConfigurationRequest {\n return {\n lineItem,\n mode: this.mode,\n step: !this.lineItem.value ? RuntimeStep.START : RuntimeStep.UPDATE,\n attributeDomainMode: 'ALL',\n context: this.contextService.resolve(),\n };\n }\n\n private showInactiveProductsConfirmation() {\n this.dialogService\n .open(ConfirmationComponent, {\n dismissableMask: false,\n closeOnEscape: false,\n closable: false,\n showHeader: true,\n header: `Inactive Products in Quote`,\n width: '440px',\n data: {\n confirmationConfig: {\n title: ' ',\n description: 'This quote contains inactive products. Do you want to remove them?',\n submitBtn: 'Remove products',\n cancelBtn: 'Back to Quote',\n },\n },\n })\n .onClose.subscribe(result => {\n if (!result) {\n const context = this.contextService.resolve();\n window['VELO_BACK_FN'].apply(null, [context.headerId]);\n }\n });\n }\n}\n","import { Injectable } from '@angular/core';\nimport { LineItem } from '@veloce/core';\nimport { flatten } from 'lodash';\nimport moment from 'moment';\nimport { LineItemWorker } from '../../../utils';\nimport { FlowUpdateParams } from '../types/update.types';\n\n@Injectable()\nexport class FlowUpdateService {\n public update(rootLineItems: LineItem[], updates: FlowUpdateParams[]) {\n let remainingUpdates = [...updates];\n let currentLevel = rootLineItems;\n\n while (currentLevel.length && remainingUpdates.length) {\n currentLevel.forEach(li => {\n const unhandledUpdates: FlowUpdateParams[] = [];\n\n remainingUpdates.forEach(update => {\n let updated = false;\n\n switch (update.dataType) {\n case 'LINEITEM':\n updated = this.applyLineItemUpdate(li, update);\n break;\n case 'CHARGE':\n updated = this.applyChargeUpdate(li, update);\n break;\n case 'GROUP_CHARGE':\n updated = this.applyChargeGroupUpdate(li, update);\n break;\n default:\n // Unknown dataType. Do not try to handle it anymore\n updated = true;\n }\n\n if (!updated) {\n unhandledUpdates.push(update);\n }\n });\n\n remainingUpdates = unhandledUpdates;\n });\n\n currentLevel = flatten(currentLevel.map(parent => parent.lineItems));\n }\n }\n\n public delete(lineItems: LineItem[], id: string): LineItem[] {\n const idsToRemove: string[] = [id];\n const topLevelLineItem = lineItems.find(li => li.id === id);\n\n if (topLevelLineItem) {\n // find term-related line items (which are only top level)\n // expired term line items won't be deleted\n let foundTermLineItem: LineItem | undefined = topLevelLineItem;\n\n while (foundTermLineItem) {\n foundTermLineItem = lineItems.find(li => foundTermLineItem && li.rampInstanceId === foundTermLineItem.id);\n if (foundTermLineItem) {\n idsToRemove.push(foundTermLineItem.id);\n }\n }\n }\n\n const filtered = lineItems.filter(lineItem => !idsToRemove.includes(lineItem.id));\n return filtered.map(lineItem => new LineItemWorker(lineItem).remove(id).li);\n }\n\n private applyLineItemUpdate(lineItem: LineItem, update: FlowUpdateParams): boolean {\n if (lineItem.id !== update.id) {\n return false;\n }\n\n switch (update.attributeType) {\n case 'QTY':\n lineItem.qty = update.newValue;\n break;\n case 'EFFECTIVE_START_DATE':\n lineItem.properties.StartDate = moment(update.newValue).format('YYYY-MM-DD');\n break;\n case 'END_DATE':\n lineItem.properties.EndDate = moment(update.newValue).format('YYYY-MM-DD');\n break;\n case 'PRICE_ADJUSTMENT':\n {\n const [charge] = lineItem.chargeItems;\n if (charge) {\n charge.priceAdjustment = update.newValue;\n }\n }\n break;\n default:\n throw new Error(`Not suppored AttributeType for LineItem update: ${update.attributeType}`);\n }\n\n return true;\n }\n\n private applyChargeUpdate(lineItem: LineItem, update: FlowUpdateParams): boolean {\n const foundCharge = lineItem.chargeItems.find(({ id }) => id === update.id);\n if (!foundCharge) {\n return false;\n }\n\n if (update.attributeType === 'PRICE_ADJUSTMENT') {\n foundCharge.priceAdjustment = update.newValue;\n } else {\n throw new Error(`Not suppored AttributeType for Charge Item update: ${update.attributeType}`);\n }\n\n return true;\n }\n\n private applyChargeGroupUpdate(lineItem: LineItem, update: FlowUpdateParams): boolean {\n const foundChargeGroup = lineItem.chargeGroupItems.find(({ id }) => id === update.id);\n if (!foundChargeGroup) {\n return false;\n }\n\n if (update.attributeType === 'PRICE_ADJUSTMENT') {\n foundChargeGroup.priceAdjustment = update.newValue;\n } else {\n throw new Error(`Not suppored AttributeType for Charge Group Item update: ${update.attributeType}`);\n }\n\n return true;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { PriceApiService } from '@veloce/api';\nimport { ConfigurationContext, LineItem, PricePlanCharge, PriceSummary } from '@veloce/core';\nimport { cloneDeep, Dictionary } from 'lodash';\nimport { MessageService } from 'primeng/api';\nimport {\n BehaviorSubject,\n catchError,\n combineLatest,\n map,\n noop,\n Observable,\n of,\n shareReplay,\n Subscription,\n switchMap,\n tap,\n throwError,\n} from 'rxjs';\nimport { ContextService, QuoteDraftService } from '../../../services';\nimport { FlowUpdateParams } from '../types/update.types';\nimport { FlowUpdateService } from './flow-update.service';\n\n@Injectable()\nexport class FlowConfigurationService {\n private charges = new BehaviorSubject<Dictionary<PricePlanCharge>>({});\n private bounceBackUpdate$ = new BehaviorSubject(true);\n\n private resetSubscription?: Subscription;\n\n constructor(\n private priceApiService: PriceApiService,\n private contextService: ContextService,\n private quoteDraftService: QuoteDraftService,\n private messageService: MessageService,\n private updateService: FlowUpdateService,\n ) {}\n\n private reset() {\n this.charges.next({});\n }\n\n initialize$(): Observable<void> {\n this.resetSubscription?.unsubscribe();\n this.resetSubscription = this.quoteDraftService.reset$.subscribe(() => this.reset());\n\n return this.calculate$(this.getSnapshot()).pipe(map(noop));\n }\n\n calculate$(currentState: LineItem[]): Observable<PriceSummary> {\n const context = this.contextService.resolve();\n\n return this.priceApiService.calculate({ context, currentState }).pipe(\n tap((result: PriceSummary) => {\n this.quoteDraftService.updateByPriceSummary(result);\n\n this.charges.next(result.charges);\n\n if (context) {\n this.contextService.update({ properties: context.properties });\n }\n }),\n this.handleError(),\n );\n }\n\n calculate(currentState: LineItem[]): void {\n this.calculate$(currentState).subscribe();\n }\n\n update$(updates: FlowUpdateParams[]): Observable<PriceSummary> {\n const lineItems = cloneDeep(this.getSnapshot());\n\n return of([]).pipe(\n tap(() => this.updateService.update(lineItems, updates)),\n this.handleError(),\n switchMap(() => this.calculate$(lineItems)),\n );\n }\n\n update(updates: FlowUpdateParams[]): void {\n this.update$(updates).subscribe();\n }\n\n delete$(ids: string[]): Observable<PriceSummary> {\n return of([]).pipe(\n map(() => ids.reduce((result, id) => this.updateService.delete(result, id), this.getSnapshot())),\n this.handleError(),\n switchMap(currentState => this.calculate$(currentState)),\n );\n }\n\n delete(ids: string[]): void {\n this.delete$(ids).subscribe();\n }\n\n public get(): Observable<LineItem[]> {\n return combineLatest([this.quoteDraftService.quote$, this.bounceBackUpdate$]).pipe(\n map(([quoteDraft]) => quoteDraft.currentState),\n shareReplay(),\n );\n }\n\n public getSnapshot(): LineItem[] {\n return this.quoteDraftService.quoteSnapshot?.currentState.slice() ?? [];\n }\n\n public get charges$(): Observable<Dictionary<PricePlanCharge>> {\n return this.charges.asObservable();\n }\n\n public get chargesSnapshot(): Dictionary<PricePlanCharge> {\n return this.charges.value;\n }\n\n public get contextSnapshot(): ConfigurationContext {\n return this.contextService.resolve();\n }\n\n public get context$(): Observable<ConfigurationContext> {\n return this.contextService.resolve$();\n }\n\n private handleError() {\n return <T>(source$: Observable<T>): Observable<T> => {\n return source$.pipe(\n catchError(error => {\n console.error(error);\n this.messageService.add({ severity: 'error', summary: error });\n\n // bounce back if configuration call has failed\n this.bounceBackUpdate$.next(true);\n\n return throwError(() => error);\n }),\n );\n };\n }\n}\n","import { NgModule } from '@angular/core';\nimport { PriceApiService } from '@veloce/api';\nimport { FlowConfigurationService } from './services/flow-configuration.service';\nimport { FlowUpdateService } from './services/flow-update.service';\n\n@NgModule({\n imports: [],\n providers: [FlowConfigurationService, FlowUpdateService, PriceApiService],\n})\nexport class FlowConfigurationModule {}\n","import { NgModule } from '@angular/core';\nimport { ConfigurationApiService, ContextApiService, ProductModelApiService } from '@veloce/api';\nimport { ConfirmationDialogModule } from '@veloce/components';\nimport { ConfigurationRuntimeService } from './services/configuration-runtime.service';\nimport { ConfigurationService } from './services/configuration.service';\nimport { RuntimeContextService } from './services/runtime-context.service';\n\n@NgModule({\n imports: [ConfirmationDialogModule],\n providers: [\n ContextApiService,\n ProductModelApiService,\n ConfigurationApiService,\n ConfigurationRuntimeService,\n RuntimeContextService,\n ConfigurationService,\n ],\n})\nexport class ConfigurationModule {}\n","import { NgModule } from '@angular/core';\nimport { FlowConfigurationModule } from './modules';\nimport { ConfigurationModule } from './modules/configuration/configuration.module';\nimport { ContextService, ProductImagesService, QuoteDraftService } from './services';\n\n@NgModule({\n imports: [ConfigurationModule, FlowConfigurationModule],\n providers: [ContextService, QuoteDraftService, ProductImagesService],\n})\nexport class SdkCoreModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["map","tap","catchError"],"mappings":";;;;;;;;;;;;;MAGa,kBAAkB,GAAG,CAAC,OAAuB,EAAE,sBAAyC;;IACnG,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAEvB,MAAM,QAAQ,GAAa,gBACzB,EAAE,EACF,IAAI,EAAE,MAAA,sBAAsB,CAAC,QAAQ,mCAAI,EAAE,EAC3C,SAAS,EAAE,SAAS,EACpB,U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uration/helpers.ts","../../../../libs/sdk/core/types/runtime.types.ts","../../../../libs/sdk/core/services/context.service.ts","../../../../libs/sdk/core/services/product-images.service.ts","../../../../libs/sdk/core/services/quote-draft.service.ts","../../../../libs/sdk/core/modules/configuration/services/runtime-context.service.ts","../../../../libs/sdk/core/modules/configuration/services/configuration-runtime.service.ts","../../../../libs/sdk/core/utils/line-item.utils.ts","../../../../libs/sdk/core/utils/line-item.worker.ts","../../../../libs/sdk/core/modules/configuration/services/configuration.service.ts","../../../../libs/sdk/core/modules/flow-configuration/services/flow-update.service.ts","../../../../libs/sdk/core/modules/flow-configuration/services/flow-configuration.service.ts","../../../../libs/sdk/core/modules/flow-configuration/flow-configuration.module.ts","../../../../libs/sdk/core/modules/configuration/configuration.module.ts","../../../../libs/sdk/core/core.module.ts","../../../../libs/sdk/core/veloce-sdk-core.ts"],"sourcesContent":["import { LineItem, UUID } from '@veloce/core';\nimport { RuntimeContext, UIDefinitionProps } from '../../types';\n\nexport const getDefaultLineItem = (\n context: RuntimeContext,\n uiDefinitionProperties: UIDefinitionProps,\n qty = 1,\n): LineItem => {\n const id = UUID.UUID();\n\n const lineItem: LineItem = {\n id,\n type: uiDefinitionProperties.rootType ?? '',\n cfgStatus: 'Default',\n actionCode: 'ADD',\n qty,\n productName: context.properties?.displayName || context.productName,\n productId: context.productId ?? '',\n ...(context.offeringId\n ? { offeringId: context.offeringId, offeringInstanceId: context.offeringInstanceId || id }\n : {}),\n } as LineItem;\n\n return lineItem;\n};\n","import { ContextProperties, RuntimeModel } from '@veloce/core';\nimport { UIDefinition } from './ui-definition.types';\n\nexport enum RuntimeMode {\n TEST,\n PROD,\n}\n\nexport enum RuntimeOperation {\n INIT = 'INIT',\n UPDATE = 'UPDATE',\n}\n\nexport enum RuntimeStep {\n START = 'START',\n UPDATE = 'UPDATE',\n}\n\nexport interface InvocationContext {\n runtimeOperation?: RuntimeOperation;\n runtimeStep?: RuntimeStep;\n}\n\nexport interface RuntimeContext {\n modelId: string;\n runtimeMode: RuntimeMode;\n runtimeModel: RuntimeModel;\n uiDefinition?: UIDefinition;\n productId?: string;\n productName?: string;\n productType?: string;\n properties?: ContextProperties;\n offeringId?: string;\n offeringInstanceId?: string;\n invocationContext?: InvocationContext;\n}\n","import { Injectable } from '@angular/core';\nimport { ContextApiService } from '@veloce/api';\nimport { ConfigurationContext, ConfigurationContextMode } from '@veloce/core';\nimport { merge } from 'lodash';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { filter, map, tap } from 'rxjs/operators';\n\n@Injectable({ providedIn: 'root' })\nexport class ContextService {\n private context = new BehaviorSubject<ConfigurationContext | null>(null);\n\n constructor(private contextApiService: ContextApiService) {}\n\n get isInitialized(): boolean {\n return Boolean(this.context.value);\n }\n\n resolve(): ConfigurationContext {\n if (!this.context.value) {\n throw new Error('Context is not initialized yet!');\n }\n\n return { ...this.context.value };\n }\n\n resolve$(): Observable<ConfigurationContext> {\n return this.context.pipe(filter((ctx): ctx is ConfigurationContext => Boolean(ctx)));\n }\n\n create(headerId: string, mode: ConfigurationContextMode): Observable<ConfigurationContext> {\n return this.contextApiService.getContext(headerId, mode).pipe(\n tap(context => this.context.next(merge(new ConfigurationContext(headerId, mode), context))),\n map(() => this.resolve() as ConfigurationContext),\n );\n }\n\n public update(partialContext: Partial<ConfigurationContext>): ConfigurationContext {\n const originalContext = this.resolve();\n\n const updatedContext: ConfigurationContext = {\n ...originalContext,\n ...(partialContext as ConfigurationContext),\n properties: {\n ...originalContext.properties,\n ...partialContext.properties,\n },\n };\n\n this.context.next(updatedContext);\n\n return updatedContext;\n }\n\n public delete(): void {\n this.context.next(null);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ProductApiService } from '@veloce/api';\nimport { Dictionary } from 'lodash';\nimport { BehaviorSubject, catchError, distinctUntilChanged, map, Observable, of, tap } from 'rxjs';\n\n@Injectable({ providedIn: 'root' })\nexport class ProductImagesService {\n private imagesMap$ = new BehaviorSubject<Dictionary<string>>({});\n\n constructor(private productApiService: ProductApiService) {}\n\n public getImageUrl$(productId: string): Observable<string | null> {\n if (this.imagesMap$.value[productId] == null) {\n this.imagesMap$.next({ ...this.imagesMap$.value, [productId]: '' });\n this.fetchProductImage(productId);\n }\n\n return this.imagesMap$.pipe(\n map(imagesMap => imagesMap[productId]),\n distinctUntilChanged(),\n );\n }\n\n private fetchProductImage(productId: string): void {\n this.productApiService\n .fetchImage$(productId)\n .pipe(\n map(file => URL.createObjectURL(file)),\n catchError(() => of('')),\n tap(url => this.imagesMap$.next({ ...this.imagesMap$.value, [productId]: url })),\n )\n .subscribe();\n }\n}\n","import { Injectable } from '@angular/core';\nimport { PriceApiService, QuoteApiService } from '@veloce/api';\nimport { ConfigurationContextMode, LineItem, PriceList, PriceSummary, QuoteDraft } from '@veloce/core';\nimport { Dictionary } from 'lodash';\nimport { BehaviorSubject, combineLatest, Observable, zip } from 'rxjs';\nimport { filter, map, take, tap } from 'rxjs/operators';\nimport { ContextService } from './context.service';\n\n@Injectable({ providedIn: 'root' })\nexport class QuoteDraftService {\n private quoteSubj$ = new BehaviorSubject<QuoteDraft | null>(null);\n private resetSubj$ = new BehaviorSubject(true);\n\n public priceLists: PriceList[] = [];\n public quotePriceList?: PriceList;\n public isInitialized = false;\n public hasUnsavedChanges = false;\n public reset$ = this.resetSubj$.asObservable();\n\n constructor(\n private context: ContextService,\n private quoteApiService: QuoteApiService,\n private priceApiService: PriceApiService,\n ) {}\n\n public reset() {\n this.resetSubj$.next(true);\n this.quoteSubj$.next(null);\n }\n\n public init(quoteId: string, params: Dictionary<string>): Observable<void> {\n return zip(\n this.quoteApiService.getQuoteDraft(quoteId, params),\n this.priceApiService.getPriceLists(),\n this.context.resolve$(),\n ).pipe(\n tap(([quote, priceLists, context]) => {\n this.quoteSubj$.next(quote);\n this.priceLists = priceLists;\n this.quotePriceList = priceLists.find(p => p.id === context.properties.PriceListId);\n\n this.context.update({\n ...context,\n ...quote.context,\n properties: {\n ...context.properties,\n ...quote.context.properties,\n },\n });\n }),\n map(() => {\n this.isInitialized = true;\n }),\n take(1),\n );\n }\n\n public setCurrentLineItemState(lineItems: LineItem[]): void {\n const quote = this.quoteSubj$.value;\n\n if (!quote) {\n return;\n }\n\n this.quoteSubj$.next({\n ...quote,\n currentState: lineItems,\n });\n\n this.markAsUpdated();\n }\n\n public updateByPriceSummary(priceSummary: PriceSummary): void {\n const quote = this.quoteSubj$.value;\n\n if (!quote) {\n return;\n }\n\n this.quoteSubj$.next({\n ...quote,\n currentState: priceSummary.lineItems,\n totalPrices: priceSummary.totalPrices,\n approvalItems: priceSummary.approvalItems,\n });\n\n this.markAsUpdated();\n }\n\n get quote$(): Observable<QuoteDraft> {\n return combineLatest([this.quoteSubj$, this.context.resolve$()]).pipe(\n map(() => this.quoteSnapshot),\n filter((quote): quote is QuoteDraft => Boolean(quote)),\n );\n }\n\n get quoteSnapshot(): QuoteDraft | null {\n const quote = this.quoteSubj$.value;\n\n if (!quote) {\n return null;\n }\n\n return {\n ...quote,\n context: this.context.resolve(),\n };\n }\n\n get isStandalone() {\n return this.context.resolve().properties.standalone === 'true';\n }\n\n public isEditMode$(): Observable<boolean> {\n return this.context.resolve$().pipe(map(() => this.isEditMode()));\n }\n\n public isEditMode(): boolean {\n const context = this.context.resolve();\n\n if (context.mode === ConfigurationContextMode.ACCOUNT) {\n return true;\n }\n\n if (context.mode === ConfigurationContextMode.QUOTE) {\n return context.properties.Status === 'Draft';\n }\n\n return false;\n }\n\n private markAsUpdated(): void {\n if (this.isInitialized && !this.hasUnsavedChanges) {\n this.hasUnsavedChanges = true;\n }\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ConfigurationApiService } from '@veloce/api';\nimport { RuntimeData, RuntimeModel, UIDefinition as LegacyUiDefinition } from '@veloce/core';\nimport { MessageService } from 'primeng/api';\nimport { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { RuntimeContext, RuntimeMode, UIDefinition } from '../../../types';\n\n@Injectable()\nexport class RuntimeContextService {\n constructor(private configurationApiService: ConfigurationApiService, private messageService: MessageService) {}\n\n getRuntimeContext(productId: string, offeringId?: string): Observable<RuntimeContext> {\n return this.configurationApiService.getRuntimeDataByProductId(productId, offeringId).pipe(\n map(runtimeData => {\n const uiDefinition = this.getUIDefinition(runtimeData);\n const runtimeModel = RuntimeModel.create(runtimeData.types, runtimeData.products);\n const { productName, properties } =\n Array.from(runtimeModel.components.values()).find(c => c.productId === productId) ?? {};\n\n return {\n modelId: runtimeData.modelId,\n uiDefinition: uiDefinition,\n runtimeModel: runtimeModel,\n runtimeMode: RuntimeMode.PROD,\n productId: productId,\n productType: properties?.displayName || productName,\n offeringId: offeringId,\n properties: {\n PricingEnabled: uiDefinition?.properties?.pricingEnabled ? 'true' : 'false',\n PriceListId: uiDefinition?.properties?.priceList,\n },\n };\n }),\n );\n }\n\n private getUIDefinition(runtimeData: RuntimeData): UIDefinition | undefined {\n let rawUiDefinitions: Array<UIDefinition | LegacyUiDefinition>;\n try {\n rawUiDefinitions = JSON.parse(runtimeData.uiDefinitionsSource);\n } catch (e) {\n return;\n }\n\n const uiDefinitions = rawUiDefinitions.filter(uiDef => (uiDef as UIDefinition).version) as UIDefinition[];\n const uiDefinition = uiDefinitions.find(uiDef => uiDef.primary) ?? uiDefinitions[0];\n\n if (!uiDefinition) {\n const errMsg = `Unable to find Default UI`;\n\n this.messageService.add({\n severity: 'error',\n summary: 'ERROR',\n });\n throw new Error(errMsg);\n }\n\n return uiDefinition;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ConfigurationApiService } from '@veloce/api';\nimport { ConfigurationContextMode, LineItem, RuntimeModel, SalesforceIdUtils } from '@veloce/core';\nimport { Dictionary } from 'lodash';\nimport { combineLatest, Observable } from 'rxjs';\nimport { first, tap } from 'rxjs/operators';\nimport { ContextService } from '../../../services';\nimport { RuntimeContext, RuntimeMode, UIDefinition, UIDefinitionProps } from '../../../types';\nimport { RuntimeInitializationProps } from '../types/configuration-runtime.types';\nimport { RuntimeContextService } from './runtime-context.service';\n\n@Injectable()\nexport class ConfigurationRuntimeService {\n private _runtimeContext?: RuntimeContext;\n private _assets?: LineItem[];\n private _isInitialized = false;\n\n public initializationProps?: RuntimeInitializationProps;\n public uiDefinitionProperties: UIDefinitionProps = {};\n\n constructor(\n private apiService: ConfigurationApiService,\n private contextService: ContextService,\n private runtimeContextService: RuntimeContextService,\n ) {}\n\n public reset() {\n this._isInitialized = false;\n this._runtimeContext = undefined;\n this._assets = undefined;\n this.initializationProps = undefined;\n this.uiDefinitionProperties = {};\n }\n\n public initTestMode(modelId: string, uiDefinition: UIDefinition) {\n this.uiDefinitionProperties = uiDefinition.properties ?? {};\n const uiDefinitionExternals = uiDefinition.externals ?? {};\n\n return combineLatest([\n this.apiService.getRuntimeDataByModelId(modelId),\n this.contextService.create('TestId', ConfigurationContextMode.TEST),\n ]).pipe(\n first(),\n tap(([runtimeData, context]) => {\n this._runtimeContext = {\n modelId: modelId,\n runtimeModel: RuntimeModel.create(runtimeData.types, runtimeData.products),\n runtimeMode: RuntimeMode.TEST,\n };\n\n this.contextService.update({\n properties: {\n ...this.runtimeContext?.properties,\n ...context.properties,\n ModelId: modelId,\n RuntimeMode: ConfigurationContextMode.TEST,\n PricingEnabled: this.uiDefinitionProperties.pricingEnabled ? 'true' : 'false',\n StartDate: new Date().toISOString().substring(0, 10),\n PriceListId: this.uiDefinitionProperties.priceList,\n standalone: 'true',\n ...uiDefinitionExternals,\n },\n });\n\n this._isInitialized = true;\n }),\n );\n }\n\n public init(props: RuntimeInitializationProps): Observable<RuntimeContext | undefined> {\n this.initializationProps = props;\n this._assets = props.assets;\n const context = this.contextService.resolve();\n\n return this.runtimeContextService.getRuntimeContext(props.productId, props.offeringId).pipe(\n tap(runtimeContext => {\n this.uiDefinitionProperties = runtimeContext.uiDefinition?.properties ?? {};\n const { PriceListId } = context.properties ?? {};\n\n const mergeContext: RuntimeContext = {\n ...runtimeContext,\n properties: {\n ...runtimeContext.properties,\n ...context.properties,\n PricingEnabled: PriceListId ? 'true' : 'false',\n },\n };\n\n this.id15to18('AccountId', mergeContext.properties);\n this._runtimeContext = mergeContext;\n\n if (context.properties && this._runtimeContext.properties?.StartDate) {\n this.contextService.update({\n properties: {\n ...this._runtimeContext.properties,\n ...context.properties,\n },\n });\n }\n\n this._isInitialized = true;\n }),\n );\n }\n\n private id15to18(propertyName: string, source?: Dictionary<any>) {\n if (!source) {\n return;\n }\n\n const value = source[propertyName];\n\n if (typeof value === 'string' && value.length === 15) {\n source[propertyName] = SalesforceIdUtils.generateId18FromId15(value);\n }\n }\n\n public getAsset(lineItem: LineItem): LineItem | undefined {\n return this._assets && this._assets.find(a => a.id === lineItem.openOrderLineItemId || a.id === lineItem.assetId);\n }\n\n public get isInitialized() {\n return this._isInitialized;\n }\n\n public get runtimeModel() {\n return this.runtimeContext?.runtimeModel;\n }\n\n public get runtimeContext() {\n return this._runtimeContext;\n }\n}\n","import { Attribute, CfgStatus, LineItem, PortDomain } from '@veloce/core';\nimport { Dictionary, flatten, sortBy } from 'lodash';\n\nexport const findLineItem = (id: string, lineItems: LineItem[]): LineItem | undefined => {\n return findLineItemWithComparator(lineItems, (li: LineItem) => li.id === id);\n};\n\nexport const findLineItemWithComparator = (\n lineItems: LineItem[],\n comparator: (li: LineItem) => boolean,\n): LineItem | undefined => {\n let currentLevel = lineItems;\n\n while (currentLevel.length) {\n const found = currentLevel.find(comparator);\n\n if (found) {\n return found;\n }\n\n currentLevel = flatten(currentLevel.map(parent => parent.lineItems));\n }\n\n return;\n};\n\nexport const insertLineItem = (lineItem: LineItem, parentId: string, toInsert: LineItem): LineItem => {\n const insertData = lineItem.id === parentId ? [toInsert] : [];\n return {\n ...lineItem,\n lineItems: [\n ...insertData,\n ...lineItem.lineItems.map(li => {\n return insertLineItem(li, parentId, toInsert);\n }),\n ],\n };\n};\n\nexport const removeLineItem = (lineItem: LineItem, idToRemove: string): LineItem => {\n return {\n ...lineItem,\n lineItems: lineItem.lineItems\n .map(li => {\n if (li.id === idToRemove) {\n return;\n } else if (li.lineItems.length) {\n return removeLineItem(li, idToRemove);\n }\n return li;\n })\n .filter(r => !!r) as LineItem[],\n };\n};\n\nexport const replaceLineItem = (lineItem: LineItem, replaceTo: LineItem): LineItem => {\n if (lineItem.id === replaceTo.id) {\n return { ...replaceTo };\n }\n\n return {\n ...lineItem,\n lineItems: lineItem.lineItems.map(li => {\n if (li.id === replaceTo.id) {\n return replaceTo;\n } else if (li.lineItems.length) {\n return replaceLineItem(li, replaceTo);\n }\n return li;\n }),\n };\n};\n\nexport const mapAttributes = (attributes: Attribute[]): Dictionary<any> => {\n return attributes.reduce((acc, { name, value }) => ({ ...acc, [name]: value }), {});\n};\n\nexport const getAttributes = (attributes: Attribute[], names: string[] = []) => {\n const filtered = attributes.filter(({ name }) => names.includes(name));\n return sortBy(filtered, [({ name }) => names.indexOf(name)]);\n};\n\nexport const upsertAttributes = (\n originalAttributes: Attribute[],\n attributesToUpsert: { name: string; value: any }[],\n) => {\n return attributesToUpsert.reduce((acc, { name, value }) => {\n const [origAttr] = getAttributes(acc, [name]);\n return [\n ...acc.filter(attr => attr.name !== name),\n { ...(origAttr ?? { name }), cfgStatus: 'User' as CfgStatus, value },\n ];\n }, originalAttributes);\n};\n\nexport const patchAttributes = (rootLineItem: LineItem, id: string, attrs: { name: string; value: any }[]) => {\n const lineItem = findLineItem(id, [rootLineItem]);\n\n if (!lineItem) {\n return rootLineItem;\n }\n\n const attributes = upsertAttributes(lineItem.attributes, attrs);\n return replaceLineItem(rootLineItem, { ...lineItem, attributes });\n};\n\nexport const getAttributeValue = (attributes: Attribute[], name: string): any =>\n attributes.find(attr => attr.name === name)?.value;\n\nexport const generateLineItem = (\n port: string,\n type: string,\n parentId: string,\n attributes: { name: string; value: any }[] = [],\n lineItems: LineItem[] = [],\n): LineItem => {\n return {\n port,\n type,\n actionCode: 'ADD',\n cfgStatus: 'New',\n attributes: attributes.map(({ name, value }) => ({ cfgStatus: 'User', name, value })),\n lineItems,\n parentId,\n qty: 1,\n } as LineItem;\n};\n\nexport const getRecommendedPrices = (portDomain: PortDomain, type: string): { net: number; list: number } => {\n const domainType = portDomain.domainTypes.find(({ name }) => name === type);\n\n const [net, list] = domainType?.recommendedPrices\n ?.filter(({ chargeMethod }) => chargeMethod === 'ONE_TIME')\n .reduce(\n (acc, rp) => {\n const [netPrice, listPrice] = acc;\n return [netPrice + rp.netPrice, listPrice + rp.listPrice];\n },\n [0, 0],\n ) ?? [0, 0];\n\n return { net, list };\n};\n","import { LineItem } from '@veloce/core';\nimport { insertLineItem, patchAttributes, removeLineItem, replaceLineItem } from './line-item.utils';\n\nexport class LineItemWorker {\n public li: LineItem;\n\n constructor(src: LineItem) {\n this.li = { ...src };\n }\n\n public insert(parentId: string, toInsert: LineItem): LineItemWorker {\n return new LineItemWorker(insertLineItem(this.li, parentId, toInsert));\n }\n\n public remove(id: string): LineItemWorker {\n return new LineItemWorker(removeLineItem(this.li, id));\n }\n\n public replace(toReplace: LineItem): LineItemWorker {\n return new LineItemWorker(replaceLineItem(this.li, toReplace));\n }\n\n public patchAttribute(attrs: { name: string; value: any }[], id?: string): LineItemWorker {\n return new LineItemWorker(patchAttributes(this.li, id ?? this.li.id, attrs));\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ConfigurationApiService } from '@veloce/api';\nimport { ConfirmationComponent, ToastType } from '@veloce/components';\nimport {\n ConfigurationContext,\n ConfigurationMode,\n ConfigurationRequest,\n LineItem,\n PricePlanCharge,\n RuntimeModel,\n VlWindow,\n} from '@veloce/core';\nimport { Dictionary } from 'lodash';\nimport { MessageService } from 'primeng/api';\nimport { DialogService } from 'primeng/dynamicdialog';\nimport { BehaviorSubject, Observable, shareReplay, throwError } from 'rxjs';\nimport { catchError, finalize, first, map, switchMap, tap } from 'rxjs/operators';\nimport { ContextService, QuoteDraftService } from '../../../services';\nimport { QuoteStates, RuntimeContext, RuntimeStep } from '../../../types';\nimport { LineItemWorker } from '../../../utils';\nimport { getDefaultLineItem } from '../helpers';\nimport { ConfigurationRuntimeService } from './configuration-runtime.service';\n\ndeclare const window: VlWindow;\n\n@Injectable()\nexport class ConfigurationService {\n private mode = ConfigurationMode.SEARCH;\n private states: QuoteStates = {};\n\n private lineItem = new BehaviorSubject<LineItem | undefined>(undefined);\n private charges = new BehaviorSubject<Dictionary<PricePlanCharge>>({});\n\n public hasUnsavedChanges = false;\n\n constructor(\n private quoteDraftService: QuoteDraftService,\n private runtimeService: ConfigurationRuntimeService,\n private contextService: ContextService,\n private configurationApiService: ConfigurationApiService,\n private messageService: MessageService,\n private dialogService: DialogService,\n ) {}\n\n public reset() {\n this.hasUnsavedChanges = false;\n this.runtimeService.reset();\n\n this.states = {};\n this.lineItem.next(undefined);\n this.charges.next({});\n }\n\n public patch$(lineItem: LineItem): Observable<LineItem> {\n if (!this.lineItem.value) {\n return throwError(() => new Error(`Source LineItem not found`));\n }\n\n this.states.configurableRamp = new LineItemWorker(this.lineItem.value).replace(lineItem).li;\n this.states.asset = this.states.configurableRamp\n ? this.runtimeService.getAsset(this.states.configurableRamp)\n : undefined;\n\n return this.configure().pipe(\n catchError(error => {\n console.error(error);\n\n if (!this.runtimeService.uiDefinitionProperties.suppressToastMessages) {\n this.messageService.add({ severity: 'error', summary: error });\n }\n\n // bounce back if configuration call has failed\n this.lineItem.next(this.lineItem.value ? { ...this.lineItem.value } : undefined);\n\n return throwError(() => error);\n }),\n tap(() => {\n if (!this.hasUnsavedChanges) {\n this.hasUnsavedChanges = true;\n }\n }),\n );\n }\n\n public patch(lineItem: LineItem): void {\n this.patch$(lineItem).subscribe();\n }\n\n public updateCurrentStates(update: Partial<QuoteStates>) {\n this.states = {\n ...this.states,\n ...update,\n };\n }\n\n public get(): Observable<LineItem | undefined> {\n return this.lineItem.asObservable().pipe(shareReplay());\n }\n\n public getSnapshot(): LineItem | undefined {\n return this.lineItem.value ? { ...this.lineItem.value } : undefined;\n }\n\n public getRuntimeModel(): RuntimeModel | undefined {\n return this.runtimeService.runtimeModel;\n }\n\n public getRuntimeContext(): RuntimeContext | undefined {\n return this.runtimeService.runtimeContext;\n }\n\n public get contextSnapshot(): ConfigurationContext {\n return this.contextService.resolve();\n }\n\n public get context$(): Observable<ConfigurationContext> {\n return this.contextService.resolve$();\n }\n\n public get charges$(): Observable<Dictionary<PricePlanCharge>> {\n return this.charges.asObservable();\n }\n\n public get chargesSnapshot(): Dictionary<PricePlanCharge> {\n return this.charges.value;\n }\n\n public configure(): Observable<LineItem> {\n const runtimeContext = this.getRuntimeContext();\n const runtimeModel = this.getRuntimeModel();\n if (!runtimeContext || !runtimeModel) {\n return throwError(() => new Error('Runtime context/model not initialized'));\n }\n\n const uiDefinitionProperties = {\n ...(runtimeContext.uiDefinition?.properties ?? {}),\n ...(this.runtimeService.uiDefinitionProperties ?? {}),\n };\n const qty = this.runtimeService.initializationProps?.defaultQty;\n const lineItem = this.states.configurableRamp ?? getDefaultLineItem(runtimeContext, uiDefinitionProperties, qty);\n const configurationRequest = this.createRequest(lineItem);\n configurationRequest.lineItems = this.states.currentState || [];\n configurationRequest.asset = this.states.asset;\n const mainPricingEnabled = runtimeContext.properties?.PricingEnabled;\n const pricingEnabled = mainPricingEnabled ? mainPricingEnabled === 'true' : uiDefinitionProperties.pricingEnabled;\n return this.configurationApiService\n .configureLineItem({ configurationRequest, runtimeModel, pricingEnabled })\n .pipe(\n map(({ lineItem, context, charges, deletedLineItems }) => {\n this.contextService.update(context ?? {});\n this.charges.next(charges ?? {});\n if (deletedLineItems?.length) {\n this.showInactiveProductsConfirmation();\n }\n return lineItem;\n }),\n )\n .pipe(\n tap(lineItem => lineItem && this.lineItem.next(lineItem)),\n catchError(error =>\n throwError(() => new Error(error.error?.message || error.message || JSON.stringify(error))),\n ),\n );\n }\n\n public configureExternal$(productId: string, qty?: number): Observable<LineItem> {\n // TODO: uncomment when procedure issue is fixed on backend side\n // this.updateCurrentStates({\n // currentState: this.quoteDraftService.quoteSnapshot?.currentState ?? [],\n // });\n\n return this.runtimeService.init({ productId, defaultQty: qty }).pipe(\n switchMap(() => this.configure()),\n first(),\n catchError(error => {\n this.messageService.add({ severity: ToastType.error, summary: error });\n throw error;\n }),\n finalize(() => this.reset()),\n );\n }\n\n private createRequest(lineItem: LineItem): ConfigurationRequest {\n return {\n lineItem,\n mode: this.mode,\n step: !this.lineItem.value ? RuntimeStep.START : RuntimeStep.UPDATE,\n attributeDomainMode: 'ALL',\n context: this.contextService.resolve(),\n };\n }\n\n private showInactiveProductsConfirmation() {\n this.dialogService\n .open(ConfirmationComponent, {\n dismissableMask: false,\n closeOnEscape: false,\n closable: false,\n showHeader: true,\n header: `Inactive Products in Quote`,\n width: '440px',\n data: {\n confirmationConfig: {\n title: ' ',\n description: 'This quote contains inactive products. Do you want to remove them?',\n submitBtn: 'Remove products',\n cancelBtn: 'Back to Quote',\n },\n },\n })\n .onClose.subscribe(result => {\n if (!result) {\n const context = this.contextService.resolve();\n window['VELO_BACK_FN'].apply(null, [context.headerId]);\n }\n });\n }\n}\n","import { Injectable } from '@angular/core';\nimport { LineItem } from '@veloce/core';\nimport { flatten } from 'lodash';\nimport moment from 'moment';\nimport { LineItemWorker } from '../../../utils';\nimport { FlowUpdateParams } from '../types/update.types';\n\n@Injectable()\nexport class FlowUpdateService {\n public update(rootLineItems: LineItem[], updates: FlowUpdateParams[]) {\n let remainingUpdates = [...updates];\n let currentLevel = rootLineItems;\n\n while (currentLevel.length && remainingUpdates.length) {\n currentLevel.forEach(li => {\n const unhandledUpdates: FlowUpdateParams[] = [];\n\n remainingUpdates.forEach(update => {\n let updated = false;\n\n switch (update.dataType) {\n case 'LINEITEM':\n updated = this.applyLineItemUpdate(li, update);\n break;\n case 'CHARGE':\n updated = this.applyChargeUpdate(li, update);\n break;\n case 'GROUP_CHARGE':\n updated = this.applyChargeGroupUpdate(li, update);\n break;\n default:\n // Unknown dataType. Do not try to handle it anymore\n updated = true;\n }\n\n if (!updated) {\n unhandledUpdates.push(update);\n }\n });\n\n remainingUpdates = unhandledUpdates;\n });\n\n currentLevel = flatten(currentLevel.map(parent => parent.lineItems));\n }\n }\n\n public delete(lineItems: LineItem[], id: string): LineItem[] {\n const idsToRemove: string[] = [id];\n const topLevelLineItem = lineItems.find(li => li.id === id);\n\n if (topLevelLineItem) {\n // find term-related line items (which are only top level)\n // expired term line items won't be deleted\n let foundTermLineItem: LineItem | undefined = topLevelLineItem;\n\n while (foundTermLineItem) {\n foundTermLineItem = lineItems.find(li => foundTermLineItem && li.rampInstanceId === foundTermLineItem.id);\n if (foundTermLineItem) {\n idsToRemove.push(foundTermLineItem.id);\n }\n }\n }\n\n const filtered = lineItems.filter(lineItem => !idsToRemove.includes(lineItem.id));\n return filtered.map(lineItem => new LineItemWorker(lineItem).remove(id).li);\n }\n\n private applyLineItemUpdate(lineItem: LineItem, update: FlowUpdateParams): boolean {\n if (lineItem.id !== update.id) {\n return false;\n }\n\n switch (update.attributeType) {\n case 'QTY':\n lineItem.qty = update.newValue;\n break;\n case 'EFFECTIVE_START_DATE':\n lineItem.properties.StartDate = moment(update.newValue).format('YYYY-MM-DD');\n break;\n case 'END_DATE':\n lineItem.properties.EndDate = moment(update.newValue).format('YYYY-MM-DD');\n break;\n case 'PRICE_ADJUSTMENT':\n {\n const [charge] = lineItem.chargeItems;\n if (charge) {\n charge.priceAdjustment = update.newValue;\n }\n }\n break;\n default:\n throw new Error(`Not suppored AttributeType for LineItem update: ${update.attributeType}`);\n }\n\n return true;\n }\n\n private applyChargeUpdate(lineItem: LineItem, update: FlowUpdateParams): boolean {\n const foundCharge = lineItem.chargeItems.find(({ id }) => id === update.id);\n if (!foundCharge) {\n return false;\n }\n\n if (update.attributeType === 'PRICE_ADJUSTMENT') {\n foundCharge.priceAdjustment = update.newValue;\n } else {\n throw new Error(`Not suppored AttributeType for Charge Item update: ${update.attributeType}`);\n }\n\n return true;\n }\n\n private applyChargeGroupUpdate(lineItem: LineItem, update: FlowUpdateParams): boolean {\n const foundChargeGroup = lineItem.chargeGroupItems.find(({ id }) => id === update.id);\n if (!foundChargeGroup) {\n return false;\n }\n\n if (update.attributeType === 'PRICE_ADJUSTMENT') {\n foundChargeGroup.priceAdjustment = update.newValue;\n } else {\n throw new Error(`Not suppored AttributeType for Charge Group Item update: ${update.attributeType}`);\n }\n\n return true;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { PriceApiService } from '@veloce/api';\nimport { ConfigurationContext, LineItem, PricePlanCharge, PriceSummary } from '@veloce/core';\nimport { cloneDeep, Dictionary } from 'lodash';\nimport { MessageService } from 'primeng/api';\nimport {\n BehaviorSubject,\n catchError,\n combineLatest,\n map,\n noop,\n Observable,\n of,\n shareReplay,\n Subscription,\n switchMap,\n tap,\n throwError,\n} from 'rxjs';\nimport { ContextService, QuoteDraftService } from '../../../services';\nimport { ConfigurationService } from '../../configuration';\nimport { FlowUpdateParams } from '../types/update.types';\nimport { FlowUpdateService } from './flow-update.service';\n\n@Injectable()\nexport class FlowConfigurationService {\n private charges = new BehaviorSubject<Dictionary<PricePlanCharge>>({});\n private bounceBackUpdate$ = new BehaviorSubject(true);\n\n private resetSubscription?: Subscription;\n\n constructor(\n private priceApiService: PriceApiService,\n private contextService: ContextService,\n private quoteDraftService: QuoteDraftService,\n private messageService: MessageService,\n private updateService: FlowUpdateService,\n private configurationService: ConfigurationService,\n ) {}\n\n private reset() {\n this.charges.next({});\n }\n\n initialize$(): Observable<void> {\n this.resetSubscription?.unsubscribe();\n this.resetSubscription = this.quoteDraftService.reset$.subscribe(() => this.reset());\n\n return this.calculate$(this.getSnapshot()).pipe(map(noop));\n }\n\n calculate$(currentState: LineItem[]): Observable<PriceSummary> {\n const context = this.contextService.resolve();\n\n return this.priceApiService.calculate({ context, currentState }).pipe(\n tap((result: PriceSummary) => {\n this.quoteDraftService.updateByPriceSummary(result);\n\n this.charges.next(result.charges);\n\n if (context) {\n this.contextService.update({ properties: context.properties });\n }\n }),\n this.handleError(),\n );\n }\n\n calculate(currentState: LineItem[]): void {\n this.calculate$(currentState).subscribe();\n }\n\n update$(updates: FlowUpdateParams[]): Observable<PriceSummary> {\n const lineItems = cloneDeep(this.getSnapshot());\n\n return of([]).pipe(\n tap(() => this.updateService.update(lineItems, updates)),\n this.handleError(),\n switchMap(() => this.calculate$(lineItems)),\n );\n }\n\n update(updates: FlowUpdateParams[]): void {\n this.update$(updates).subscribe();\n }\n\n delete$(ids: string[]): Observable<PriceSummary> {\n return of([]).pipe(\n map(() => ids.reduce((result, id) => this.updateService.delete(result, id), this.getSnapshot())),\n this.handleError(),\n switchMap(currentState => this.calculate$(currentState)),\n );\n }\n\n delete(ids: string[]): void {\n this.delete$(ids).subscribe();\n }\n\n public get(): Observable<LineItem[]> {\n return combineLatest([this.quoteDraftService.quote$, this.bounceBackUpdate$]).pipe(\n map(([quoteDraft]) => quoteDraft.currentState),\n shareReplay(),\n );\n }\n\n public addToCart$(productId: string, qty?: number): Observable<void> {\n return this.configurationService.configureExternal$(productId, qty).pipe(\n tap(lineItem => {\n const currentState = this.quoteDraftService.quoteSnapshot?.currentState ?? [];\n this.quoteDraftService.setCurrentLineItemState([...currentState, lineItem]);\n }),\n map(noop),\n );\n }\n\n public getSnapshot(): LineItem[] {\n return this.quoteDraftService.quoteSnapshot?.currentState.slice() ?? [];\n }\n\n public get charges$(): Observable<Dictionary<PricePlanCharge>> {\n return this.charges.asObservable();\n }\n\n public get chargesSnapshot(): Dictionary<PricePlanCharge> {\n return this.charges.value;\n }\n\n public get contextSnapshot(): ConfigurationContext {\n return this.contextService.resolve();\n }\n\n public get context$(): Observable<ConfigurationContext> {\n return this.contextService.resolve$();\n }\n\n private handleError() {\n return <T>(source$: Observable<T>): Observable<T> => {\n return source$.pipe(\n catchError(error => {\n console.error(error);\n this.messageService.add({ severity: 'error', summary: error });\n\n // bounce back if configuration call has failed\n this.bounceBackUpdate$.next(true);\n\n return throwError(() => error);\n }),\n );\n };\n }\n}\n","import { NgModule } from '@angular/core';\nimport { PriceApiService } from '@veloce/api';\nimport { FlowConfigurationService } from './services/flow-configuration.service';\nimport { FlowUpdateService } from './services/flow-update.service';\n\n@NgModule({\n imports: [],\n providers: [FlowConfigurationService, FlowUpdateService, PriceApiService],\n})\nexport class FlowConfigurationModule {}\n","import { NgModule } from '@angular/core';\nimport { ConfigurationApiService, ContextApiService, ProductModelApiService } from '@veloce/api';\nimport { ConfirmationDialogModule } from '@veloce/components';\nimport { ConfigurationRuntimeService } from './services/configuration-runtime.service';\nimport { ConfigurationService } from './services/configuration.service';\nimport { RuntimeContextService } from './services/runtime-context.service';\n\n@NgModule({\n imports: [ConfirmationDialogModule],\n providers: [\n ContextApiService,\n ProductModelApiService,\n ConfigurationApiService,\n ConfigurationRuntimeService,\n RuntimeContextService,\n ConfigurationService,\n ],\n})\nexport class ConfigurationModule {}\n","import { NgModule } from '@angular/core';\nimport { FlowConfigurationModule } from './modules';\nimport { ConfigurationModule } from './modules/configuration/configuration.module';\nimport { ContextService, ProductImagesService, QuoteDraftService } from './services';\n\n@NgModule({\n imports: [ConfigurationModule, FlowConfigurationModule],\n providers: [ContextService, QuoteDraftService, ProductImagesService],\n})\nexport class SdkCoreModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["map","tap","catchError","switchMap"],"mappings":";;;;;;;;;;;;;MAGa,kBAAkB,GAAG,CAChC,OAAuB,EACvB,sBAAyC,EACzC,GAAG,GAAG,CAAC;;IAEP,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAEvB,MAAM,QAAQ,GAAa,gBACzB,EAAE,EACF,IAAI,EAAE,MAAA,sBAAsB,CAAC,QAAQ,mCAAI,EAAE,EAC3C,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,KAAK,EACjB,GAAG,EACH,WAAW,EAAE,CAAA,MAAA,OAAO,CAAC,UAAU,0CAAE,WAAW,KAAI,OAAO,CAAC,WAAW,EACnE,SAAS,EAAE,MAAA,OAAO,CAAC,SAAS,mCAAI,EAAE,KAC9B,OAAO,CAAC,UAAU;UAClB,EAAE,UAAU,EAAE,OAAO,CAA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;oBACR,OAAO,EAAE,EAAE;oBACX,SAAS,EAAE,CAAC,wBAAwB,EAAE,iBAAiB,EAAE,eAAe,CAAC;iBAC1E;;;MCUY,mBAAmB;;iHAAnB,mBAAmB;kHAAnB,mBAAmB,YAVpB,wBAAwB;kHAUvB,mBAAmB,aATnB;QACT,iBAAiB;QACjB,sBAAsB;QACtB,uBAAuB;QACvB,2BAA2B;QAC3B,qBAAqB;QACrB,oBAAoB;KACrB,YARQ,CAAC,wBAAwB,CAAC;4FAUxB,mBAAmB;kBAX/B,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,wBAAwB,CAAC;oBACnC,SAAS,EAAE;wBACT,iBAAiB;wBACjB,sBAAsB;wBACtB,uBAAuB;wBACvB,2BAA2B;wBAC3B,qBAAqB;wBACrB,oBAAoB;qBACrB;iBACF;;;MCRY,aAAa;;2GAAb,aAAa;4GAAb,aAAa,YAHd,mBAAmB,EAAE,uBAAuB;4GAG3C,aAAa,aAFb,CAAC,cAAc,EAAE,iBAAiB,EAAE,oBAAoB,CAAC,YAD3D,CAAC,mBAAmB,EAAE,uBAAuB,CAAC;4FAG5C,aAAa;kBAJzB,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,mBAAmB,EAAE,uBAAuB,CAAC;oBACvD,SAAS,EAAE,CAAC,cAAc,EAAE,iBAAiB,EAAE,oBAAoB,CAAC;iBACrE;;;ACRD;;;;;;"}
|
package/fesm2015/veloce-sdk.js
CHANGED
@@ -1167,10 +1167,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
1167
1167
|
}] });
|
1168
1168
|
|
1169
1169
|
class ProductComponent {
|
1170
|
-
constructor(contextService, runtimeService,
|
1170
|
+
constructor(contextService, runtimeService, configurationService, quoteDraftService, messageService, customizationService) {
|
1171
1171
|
this.contextService = contextService;
|
1172
1172
|
this.runtimeService = runtimeService;
|
1173
|
-
this.
|
1173
|
+
this.configurationService = configurationService;
|
1174
1174
|
this.quoteDraftService = quoteDraftService;
|
1175
1175
|
this.messageService = messageService;
|
1176
1176
|
this.customizationService = customizationService;
|
@@ -1207,14 +1207,14 @@ class ProductComponent {
|
|
1207
1207
|
const currentStateItem = EntityUtil.findById(lineItemId, quote.currentState);
|
1208
1208
|
const { offeringId } = currentStateItem !== null && currentStateItem !== void 0 ? currentStateItem : {};
|
1209
1209
|
if (currentStateItem) {
|
1210
|
-
this.
|
1210
|
+
this.configurationService.updateCurrentStates({
|
1211
1211
|
configurableRamp: currentStateItem,
|
1212
1212
|
currentState: quote.currentState,
|
1213
1213
|
});
|
1214
1214
|
}
|
1215
1215
|
this.runtimeService
|
1216
1216
|
.init({ productId, offeringId })
|
1217
|
-
.pipe(tap(context => (this.uiDefinition = context === null || context === void 0 ? void 0 : context.uiDefinition)), switchMap(() => this.customize(productId)), switchMap(() => this.
|
1217
|
+
.pipe(tap(context => (this.uiDefinition = context === null || context === void 0 ? void 0 : context.uiDefinition)), switchMap(() => this.customize(productId)), switchMap(() => this.configurationService.configure()), tap(() => this.state$.next({ loading: false, failure: false })), catchError(error => {
|
1218
1218
|
var _a, _b;
|
1219
1219
|
if (!((_b = (_a = this.uiDefinition) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.suppressToastMessages)) {
|
1220
1220
|
this.messageService.add({ severity: 'error', summary: error });
|