import {catchError, tap, map} from 'rxjs/operators'; /** * @Service: Catalog Service * @Creation Date: Aug 3, 2017 * @Author: sbaireddy * @Version: 1.0 */ import { Injectable } from '@angular/core'; // import { HttpClient, Headers, RequestOptions, Response } from '@angular/_http'; import { HttpClient } from '@angular/common/http'; // import { Observable } from 'rxjs/observable'; import { Observable } from 'rxjs/Rx'; // for debugging import { BaseService } from './base.service'; import * as ServiceConstants from '../shared/service.constants'; import * as Constants from '../shared/constants'; import Utils from '../shared/utils'; import { restUrl } from '../rest.url'; import { KeyValue } from '../shared/modal/key.value'; import { IRateplan, IDevice, IFeature, IAccessory, IFilterList, IMoreInfoList, IInventoryStatus } from '../shared/modal/common'; /** * This class provides the Catalog Service with methods rateplan,device,feature and accessory list. */ @Injectable({providedIn:'root'}) export class CatalogService extends BaseService { gsmRateplans: IRateplan[]; gsmRateplanFilters: IFilterList[]; miRateplans: IRateplan[]; miRateplanFilters: IFilterList[]; gsmDevices: IDevice[]; gsmDeviceFilters: IFilterList[]; miDevices: IDevice[]; miDeviceFilters: IFilterList[]; features: IFeature[]; featureFilters: IFilterList[]; accessories: IAccessory[]; accessoryFilters: IFilterList[]; inventoryList: IInventoryStatus[]; /**Gets the master gsm rateplans */ getGSMRateplans(): IRateplan[] { if (this.gsmRateplans) { return this.gsmRateplans; } else { return Utils.getRateplanList(Constants.PRODUCT_TYPE_GSM); } } /**Sets the master gsm rateplans */ setGSMRateplans(gsmRateplans: IRateplan[]) { this.gsmRateplans = gsmRateplans; Utils.storeRateplanList(gsmRateplans, Constants.PRODUCT_TYPE_GSM); } /**Gets the master mi rateplans */ getMIRateplans(): IRateplan[] { if (this.miRateplans) { return this.miRateplans; } else { return Utils.getRateplanList(Constants.PRODUCT_TYPE_DATA); } } /**Sets the master mi rateplans */ setMIRateplans(miRateplans: IRateplan[]) { this.miRateplans = miRateplans; Utils.storeRateplanList(miRateplans, Constants.PRODUCT_TYPE_DATA); } /**Gets the master gsm rateplan filetrs */ getGSMRateplanFiletrs(): IFilterList[] { if (this.gsmRateplanFilters) { return this.gsmRateplanFilters; } else { return Utils.getRateplanFilterList(Constants.PRODUCT_TYPE_GSM); } } /**Sets the master gsm rateplan filetrs */ setGSMRateplanFilters(gsmRateplanFilters: IFilterList[]) { this.gsmRateplanFilters = gsmRateplanFilters; Utils.storeRateplanFilterList(gsmRateplanFilters, Constants.PRODUCT_TYPE_GSM); } /**Gets the master mi rateplan filetrs */ getMIRateplanFiletrs(): IFilterList[] { if (this.miRateplanFilters) { return this.miRateplanFilters; } else { return Utils.getRateplanFilterList(Constants.PRODUCT_TYPE_DATA); } } /**Sets the master mi rateplan filetrs */ setMIRateplanFilters(miRateplanFilters: IFilterList[]) { this.miRateplanFilters = miRateplanFilters; Utils.storeRateplanFilterList(miRateplanFilters, Constants.PRODUCT_TYPE_DATA); } /**Gets the master gsm devices */ getGSMDevices(): IDevice[] { if (this.gsmDevices) { return this.gsmDevices; } else { return Utils.getDeviceList(Constants.PRODUCT_TYPE_GSM); } } /**Sets the master gsm devices */ setGSMDevices(gsmDevices: IDevice[]) { this.gsmDevices = gsmDevices; Utils.storeDeviceList(gsmDevices, Constants.PRODUCT_TYPE_GSM); } /**Gets the master mi devices */ getMIDevices(): IDevice[] { if (this.miDevices) { return this.miDevices; } else { return Utils.getDeviceList(Constants.PRODUCT_TYPE_DATA); } } /**Sets the master mi devices */ setMIDevices(miDevices: IDevice[]) { this.miDevices = miDevices; Utils.storeDeviceList(miDevices, Constants.PRODUCT_TYPE_DATA); } /**Gets the master gsm device filetrs */ getGSMDeviceFiletrs(): IFilterList[] { if (this.gsmDeviceFilters) { return this.gsmDeviceFilters; } else { return Utils.getDeviceFilterList(Constants.PRODUCT_TYPE_GSM); } } /**Sets the master gsm device filetrs */ setGSMDeviceFilters(gsmDeviceFilters: IFilterList[]) { this.gsmDeviceFilters = gsmDeviceFilters; Utils.storeDeviceFilterList(gsmDeviceFilters, Constants.PRODUCT_TYPE_GSM); } /**Gets the master mi device filetrs */ getMIDeviceFiletrs(): IFilterList[] { if (this.miDeviceFilters) { return this.miDeviceFilters; } else { return Utils.getDeviceFilterList(Constants.PRODUCT_TYPE_DATA); } } /**Sets the master mi device filetrs */ setMIDeviceFilters(miDeviceFilters: IFilterList[]) { this.miDeviceFilters = miDeviceFilters; Utils.storeDeviceFilterList(miDeviceFilters, Constants.PRODUCT_TYPE_DATA); } /**Gets the master gsm features */ getFeatures(): IFeature[] { if (this.features) { return this.features; } else { return Utils.getFeatureList(); } } /**Sets the master gsm features */ setFeatures(features: IFeature[]) { this.features = features; Utils.storeFeatureList(features); } /**Gets the master feature filetrs */ getFeatureFiletrs(): IFilterList[] { if (this.featureFilters) { return this.featureFilters; } else { return Utils.getFeatureFilterList(); } } /**Sets the master feature filetrs */ setFeatureFilters(featureFilters: IFilterList[]) { this.featureFilters = featureFilters; Utils.storeFeatureFilterList(featureFilters); } /**Gets the master accessories */ getAccessories(): IAccessory[] { if (this.accessories) { return this.accessories; } else { return Utils.getAccessoryList(); } } /**Sets the master accessories */ setAccessories(accessories: IAccessory[]) { this.accessories = accessories; Utils.storeAccessoryList(accessories); } /**Gets the master accessories filetrs */ getAccessoryFiletrs(): IFilterList[] { if (this.accessoryFilters) { return this.accessoryFilters; } else { return Utils.getAccessoryFilterList(); } } /**Sets the master accessories filetrs */ setAccessoryFilters(accessoryFilters: IFilterList[]) { this.accessoryFilters = accessoryFilters; Utils.storeAccessoryFilterList(accessoryFilters); } /**Gets the inventory list */ getInventoryList(): IInventoryStatus[] { if (this.inventoryList) { return this.inventoryList; } else { return Utils.getInventoryList(); } } /**Sets the inventory list */ setInventoryList(inventoryList: IInventoryStatus[]) { this.inventoryList = inventoryList; Utils.storeInventoryList(inventoryList); } /** * Creates a new UserService with the injected HttpClient. * @param {HttpClient} _http - The injected HttpClient. * @constructor */ constructor(public _http: HttpClient) { super(); } /** * Returns an Observable for the HTTP GET request for the JSON resource. * @return {IRateplan[]} The Observable for the HTTP request. */ getRateplanList(storeId: number, productType: string): Observable { if (ServiceConstants.LOGGING) { console.log('[start]-catalogService.getRateplanList ( )'); } // getting the request options const options = this.httpOptions(); // constracting the path params const pathParams: Array = new Array(); pathParams.push(new KeyValue(ServiceConstants.STORE_ID, storeId)); const queryParams: Array = new Array(); if (productType) { queryParams.push(new KeyValue(ServiceConstants.PRODUCT_TYPE, productType)); } // getting the final url const url = Utils.replaceAppendParams(restUrl.catalog.getRateplanList, pathParams, queryParams); // service calling // return this._http.get ( 'assets/data/rateplans.json', options) return this._http.get(url, options).pipe( map((res: any) => res.products), tap(data => { if (ServiceConstants.LOGGING) { console.log('[end]-catalogService.getRateplanList ( )'); } }),// for debug catchError(this.handleError)); } /** * Returns an Observable for the HTTP GET request for the JSON resource. * @return {IFilterList} The Observable for the HTTP request. */ getRateplanFilterList(storeId: number, productType: string): Observable { if (ServiceConstants.LOGGING) { console.log('[start]-catalogService.getRateplanFilterList ( )'); } // getting the request options const options = this.httpOptions(); // constracting the path params const pathParams: Array = new Array(); pathParams.push(new KeyValue(ServiceConstants.STORE_ID, storeId)); const queryParams: Array = new Array(); if (productType) { queryParams.push(new KeyValue(ServiceConstants.PRODUCT_TYPE, productType)); } // getting the final url const url = Utils.replaceAppendParams(restUrl.catalog.getRateplanFilterList, pathParams, queryParams); // service calling // return this._http.get ( 'assets/data/rateplan-filetrs.json', options) return this._http.get(url, options).pipe( map((res: any) => res.filters), tap(data => { if (ServiceConstants.LOGGING) { console.log('[end]-catalogService.getRateplanFilterList ( )'); } }),// for debug catchError(this.handleError)); } /** * Returns an Observable for the HTTP GET request for the JSON resource. * @return {number[]} The Observable for the HTTP request. */ getRateplansByZipCode( storeId: number, zipCode: string, marketCode: string, productType: string, deviceSKU: string, accountNumber: number, accountType: string, isNCFPlan: boolean, isTIPlan: boolean, numberOfVoiceLines: number, hasDuplicateLines: boolean, dateOfBirth: string, orderId: number): Observable { if (ServiceConstants.LOGGING) { console.log('[start]-catalogService.getRateplansByZipCode ( )'); } // getting the request options const options = this.httpOptions(); // constracting the path params const pathParams: Array = new Array(); pathParams.push(new KeyValue(ServiceConstants.STORE_ID, storeId)); pathParams.push(new KeyValue('zipCode', zipCode)); const queryParams: Array = new Array(); if (marketCode) { queryParams.push(new KeyValue('marketCode', marketCode)); } if (productType) { queryParams.push(new KeyValue(ServiceConstants.PRODUCT_TYPE, productType)); } if (deviceSKU) { queryParams.push(new KeyValue('deviceSKU', deviceSKU)); } if (accountNumber) { queryParams.push(new KeyValue('accountNumber', accountNumber)); } if (accountType) { queryParams.push(new KeyValue('accountType', accountType)); } if (isNCFPlan) { queryParams.push(new KeyValue('isNCFPlan', isNCFPlan)); } if (isTIPlan) { queryParams.push(new KeyValue('isTIPlan', isTIPlan)); }// isTIPlan if (numberOfVoiceLines) { queryParams.push(new KeyValue('numberOfVoiceLines', numberOfVoiceLines)); } else { queryParams.push(new KeyValue('numberOfVoiceLines', 0)); } if (hasDuplicateLines || hasDuplicateLines === false) { queryParams.push(new KeyValue ('hasDuplicateLines', hasDuplicateLines)); } // hasDuplicatelines if (dateOfBirth) { queryParams.push(new KeyValue('dateOfBirth', dateOfBirth)); } /* @Manivannan -> As per Sushant Saxena's comment in qc, orderId is added to the query params */ if (orderId) { queryParams.push(new KeyValue('orderId', orderId)); } // getting the final url const url = Utils.replaceAppendParams(restUrl.catalog.getRateplansByZipCode, pathParams, queryParams); // service calling return this._http.get(url, options).pipe( map((res: any) => res.productIds), tap(data => { if (ServiceConstants.LOGGING) { console.log('[end]-catalogService.getRateplansByZipCode ( )'); } }),// for debug catchError(this.handleError)); } /** * Returns an Observable for the HTTP GET request for the JSON resource. * @return {IDevice[]} The Observable for the HTTP request. */ getDeviceList(storeId: number, productType: string): Observable { if (ServiceConstants.LOGGING) { console.log('[start]-catalogService.getDeviceList ( )'); } // getting the request options const options = this.httpOptions(); // constracting the path params const pathParams: Array = new Array(); pathParams.push(new KeyValue(ServiceConstants.STORE_ID, storeId)); const queryParams: Array = new Array(); if (productType) { queryParams.push(new KeyValue(ServiceConstants.PRODUCT_TYPE, productType)); } // getting the final url const url = Utils.replaceAppendParams(restUrl.catalog.getDeviceList, pathParams, queryParams); // service calling // return this._http.get ( 'assets/data/devices.json', options) return this._http.get(url, options).pipe( map((res: any) => res.products), tap(data => { if (ServiceConstants.LOGGING) { console.log('[end]-catalogService.getDeviceList ( )'); } }),// for debug catchError(this.handleError)); } /** * Returns an Observable for the HTTP GET request for the JSON resource. * @return {IFilterList} The Observable for the HTTP request. */ getDeviceFilterList(storeId: number, productType: string): Observable { if (ServiceConstants.LOGGING) { console.log('[start]-catalogService.getDeviceFilterList ( )'); } // getting the request options const options = this.httpOptions(); // constracting the path params const pathParams: Array = new Array(); pathParams.push(new KeyValue(ServiceConstants.STORE_ID, storeId)); const queryParams: Array = new Array(); if (productType) { queryParams.push(new KeyValue(ServiceConstants.PRODUCT_TYPE, productType)); } // getting the final url const url = Utils.replaceAppendParams(restUrl.catalog.getDeviceFilterList, pathParams, queryParams); // service calling // return this._http.get ( 'assets/data/device-filters.json', options) return this._http.get(url, options).pipe( map((res: any) => res.filters), tap(data => { if (ServiceConstants.LOGGING) { console.log('[end]-catalogService.getDeviceFilterList ( )'); } }),// for debug catchError(this.handleError)); } /** * Returns an Observable for the HTTP GET request for the JSON resource. * @return {number[]} The Observable for the HTTP request. */ getDevicesByRateplan(storeId: number, rateplanSOC: string): Observable { if (ServiceConstants.LOGGING) { console.log('[start]-catalogService.getDevicesByRateplan ( )'); } // getting the request options const options = this.httpOptions(); // constracting the path params const pathParams: Array = new Array(); pathParams.push(new KeyValue(ServiceConstants.STORE_ID, storeId)); pathParams.push(new KeyValue('rateplanSOC', rateplanSOC)); const queryParams: Array = new Array(); // if ( productType) { queryParams.push ( new KeyValue ( ServiceConstants.PRODUCT_TYPE, productType)); } // getting the final url const url = Utils.replaceAppendParams(restUrl.catalog.getDevicesByRateplan, pathParams, queryParams); // service calling return this._http.get(url, options).pipe( map((res: any) => res.productIds), tap(data => { if (ServiceConstants.LOGGING) { console.log('[end]-catalogService.getDevicesByRateplan ( )'); } }),// for debug catchError(this.handleError)); } /** * Returns an Observable for the HTTP GET request for the JSON resource. * @return {number[]} The Observable for the HTTP request. */ getDevicesByZipCode(storeId: number, zipCode: string, productType: string): Observable { if (ServiceConstants.LOGGING) { console.log('[start]-catalogService.getDevicesByZipCode ( )'); } // getting the request options const options = this.httpOptions(); // constracting the path params const pathParams: Array = new Array(); pathParams.push(new KeyValue(ServiceConstants.STORE_ID, storeId)); pathParams.push(new KeyValue('zipCode', zipCode)); const queryParams: Array = new Array(); if (productType) { queryParams.push(new KeyValue(ServiceConstants.PRODUCT_TYPE, productType)); } // getting the final url const url = Utils.replaceAppendParams(restUrl.catalog.getDevicesByZipCode, pathParams, queryParams); // service calling return this._http.get(url, options).pipe( map((res: any) => res.productIds), tap(data => { if (ServiceConstants.LOGGING) { console.log('[end]-catalogService.getDevicesByZipCode ( )'); } }),// for debug catchError(this.handleError)); } /** * Returns an Observable for the HTTP GET request for the JSON resource. * @return {IFeature[]} The Observable for the HTTP request. */ getFeatureList(storeId: number): Observable { if (ServiceConstants.LOGGING) { console.log('[start]-catalogService.getFeatureList ( )'); } // getting the request options const options = this.httpOptions(); // constracting the path params const pathParams: Array = new Array(); pathParams.push(new KeyValue(ServiceConstants.STORE_ID, storeId)); // const queryParams: Array= new Array ( ); // if ( productType) queryParams.push ( new KeyValue ( ServiceConstants.PRODUCT_TYPE, productType)); // getting the final url const url = Utils.replacePathParams(restUrl.catalog.getFeatureList, pathParams); // service calling // return this._http.get ( 'assets/data/features.json', options) return this._http.get(url, options).pipe( map((res: any) => res.products), tap(data => { if (ServiceConstants.LOGGING) { console.log('[end]-catalogService.getFeatureList ( )'); } }),// for debug catchError(this.handleError)); } /** * Returns an Observable for the HTTP GET request for the JSON resource. * @return {IFilterList} The Observable for the HTTP request. */ getFeatureFilterList(storeId: number): Observable { if (ServiceConstants.LOGGING) { console.log('[start]-catalogService.getFeatureFilterList ( )'); } // getting the request options const options = this.httpOptions(); // constracting the path params const pathParams: Array = new Array(); pathParams.push(new KeyValue(ServiceConstants.STORE_ID, storeId)); // const queryParams: Array= new Array ( ); // if ( productType) queryParams.push ( new KeyValue ( ServiceConstants.PRODUCT_TYPE, productType)); // getting the final url const url = Utils.replacePathParams(restUrl.catalog.getFeatureFilterList, pathParams); // service calling // return this._http.get ( 'assets/data/feature-filetrs.json', options) return this._http.get(url, options).pipe( map((res: any) => res.filters), tap(data => { if (ServiceConstants.LOGGING) { console.log('[end]-catalogService.getFeatureFilterList ( )'); } }),// for debug catchError(this.handleError)); } /** * Returns an Observable for the HTTP GET request for the JSON resource. * @return {number[]} The Observable for the HTTP request. */ getFeaturesByRateplanDevice(storeId: number, rateplanSOC: string, deviceSKU: string, zipCode: string, financeType: string): Observable { if (ServiceConstants.LOGGING) { console.log('[start]-catalogService.getFeaturesByRateplanDevice ( )'); } // getting the request options const options = this.httpOptions(); // constracting the path params const pathParams: Array = new Array(); pathParams.push(new KeyValue(ServiceConstants.STORE_ID, storeId)); pathParams.push(new KeyValue('rateplanSOC', rateplanSOC)); pathParams.push(new KeyValue('deviceSKU', deviceSKU)); const queryParams: Array = new Array(); if (zipCode) { queryParams.push(new KeyValue(ServiceConstants.ZIP_CODE, zipCode)); } queryParams.push(new KeyValue('financeType', financeType)); // getting the final url const url = Utils.replaceAppendParams(restUrl.catalog.getFeaturesByRateplanDevice, pathParams, queryParams); // service calling return this._http.get(url, options).pipe( map((res: any) => res.productIds), tap(data => { if (ServiceConstants.LOGGING) { console.log('[end]-catalogService.getFeaturesByRateplanDevice ( )'); } }),// for debug catchError(this.handleError)); } /** * Returns an Observable for the HTTP GET request for the JSON resource. * @return {IAccessory[]} The Observable for the HTTP request. */ getAccessoryList(storeId: number): Observable { if (ServiceConstants.LOGGING) { console.log('[start]-catalogService.getAccessoryList ( )'); } // getting the request options const options = this.httpOptions(); // constracting the path params const pathParams: Array = new Array(); pathParams.push(new KeyValue(ServiceConstants.STORE_ID, storeId)); // getting the final url const url = Utils.replacePathParams(restUrl.catalog.getAccessoryList, pathParams); // service calling // return this._http.get ( 'assets/data/accessories.json', options) return this._http.get(url, options).pipe( map((res: any) => res.products), tap(data => { if (ServiceConstants.LOGGING) { console.log('[end]-catalogService.getAccessoryList ( )'); } }),// for debug catchError(this.handleError)); } /** * Returns an Observable for the HTTP GET request for the JSON resource. * @return {IFilterList} The Observable for the HTTP request. */ getAccessoryFilterList(storeId: number): Observable { if (ServiceConstants.LOGGING) { console.log('[start]-catalogService.getAccessoryFilterList ( )'); } // getting the request options const options = this.httpOptions(); // constracting the path params const pathParams: Array = new Array(); pathParams.push(new KeyValue(ServiceConstants.STORE_ID, storeId)); // getting the final url const url = Utils.replacePathParams(restUrl.catalog.getAccessoryFilterList, pathParams); // service calling // return this._http.get ( 'assets/data/accessory-filters.json', options) return this._http.get(url, options).pipe( map((res: any) => res.filters), tap(data => { if (ServiceConstants.LOGGING) { console.log('[end]-catalogService.getAccessoryFilterList ( )'); } }),// for debug catchError(this.handleError)); } /** * Returns an Observable for the HTTP GET request for the JSON resource. * @return {number[]} The Observable for the HTTP request. */ getAccessoriesByDevice(storeId: number, deviceSKU: string, promotedOnly: boolean): Observable { if (ServiceConstants.LOGGING) { console.log('[start]-catalogService.getAccessoriesByDevice ( )'); } // getting the request options const options = this.httpOptions(); // constracting the path params const pathParams: Array = new Array(); pathParams.push(new KeyValue(ServiceConstants.STORE_ID, storeId)); pathParams.push(new KeyValue('deviceSKU', deviceSKU)); // constracting the query params const queryParams: Array = new Array(); queryParams.push(new KeyValue('promotedOnly', promotedOnly)); // getting the final url const url = Utils.replaceAppendParams(restUrl.catalog.getAccessoriesByDevice, pathParams, queryParams); // service calling return this._http.get(url, options).pipe( map((res: any) => res.productIds), tap(data => { if (ServiceConstants.LOGGING) { console.log('[end]-catalogService.getAccessoriesByDevice ( )'); } }),// for debug catchError(this.handleError)); } /** * Returns an Observable for the HTTP GET request for the JSON resource. * @return {IMoreInfoList[]} The Observable for the HTTP request. */ getMoreInfoByProduct(storeId: number, productId: number): Observable { if (ServiceConstants.LOGGING) { console.log('[start]-catalogService.getMoreInfoByProduct ( )'); } // getting the request options const options = this.httpOptions(); // constracting the path params const pathParams: Array = new Array(); pathParams.push(new KeyValue(ServiceConstants.STORE_ID, storeId)); // @mani ==> Changed the API to get more details based on ProductId pathParams.push(new KeyValue('productId', productId)); // getting the final url const url = Utils.replacePathParams(restUrl.catalog.getMoreInfoByProduct, pathParams); // service calling // return this._http.get ( 'assets/data/moreinfo-device.json', options) return this._http.get(url, options).pipe( map((res: any) => res.groups), tap(data => { if (ServiceConstants.LOGGING) { console.log('[end]-catalogService.getMoreInfoByProduct ( )'); } }),// for debug catchError(this.handleError)); } /** * Returns an Observable for the HTTP GET request for the JSON resource. * @return {IMoreInfoList[]} The Observable for the HTTP request. */ getProductMoreInfo(storeId: number, productId: string): Observable { if (ServiceConstants.LOGGING) { console.log('[start]-catalogService.getProductMoreInfo ( )'); } // getting the request options const options = this.httpOptions(); // constracting the path params const pathParams: Array = new Array(); pathParams.push(new KeyValue(ServiceConstants.STORE_ID, storeId)); pathParams.push(new KeyValue('productId', productId)); // getting the final url const url = Utils.replacePathParams(restUrl.catalog.getMoreInfoByProduct, pathParams); // service calling // return this._http.get ( 'assets/data/moreinfo-device.json', options) return this._http.get(url, options).pipe( map((res: any) => res.groups), tap(data => { if (ServiceConstants.LOGGING) { console.log('[end]-catalogService.getProductMoreInfo ( )'); } }),// for debug catchError(this.handleError)); } /** * Returns an Observable for the HTTP GET request for the JSON resource. * @return {IInventoryStatus[]} The Observable for the HTTP request. */ getInventoryStatus(storeId: number): Observable { if (ServiceConstants.LOGGING) { console.log('[start]-catalogService.getInventoryStatus ( )'); } // getting the request options const options = this.httpOptions(); // constracting the path params const pathParams: Array = new Array(); pathParams.push(new KeyValue(ServiceConstants.STORE_ID, storeId)); // getting the final url const url = Utils.replacePathParams(restUrl.catalog.getInventoryStatus, pathParams); // service calling return this._http.get(url, options).pipe( map((res: any) => res.inventoryArray), tap(data => { if (ServiceConstants.LOGGING) { console.log('[end]-catalogService.getInventoryStatus ( )'); } }),// for debug catchError(this.handleError)); } }