File

projects/apttus/ecommerce/src/lib/modules/abo/services/asset/asset.service.ts

Description

Assets are the products own by customer and a user may wish to renew/terminate/update existing assets.

Extends

AssetServiceCore

Index

Methods

Methods

Public amendAssets
amendAssets(assetIds: Array)

The primary method to amend the existing assets.

Example:

import { AssetService } from '@apttus/ecommerce';

export class MyComponent implements OnInit{
    lineItemMap: Array<any>;
    lineItemMap$: Observable<Array<any>>;

    constructor(private assetService: AssetService){}

    ngOnInit(){
        this.assetService.amendAssets(assetIds: Array<string>)subscribe(lineItemMap => {...});
        // or
        this.lineItemMap$ = this.assetService.amendAssets(assetIds: Array<string>);
    }
}
Parameters :
Name Type Optional Description
assetIds Array<string> No

list of asset ids to amend

Returns : Observable<any>

Observable<Array> returns an observable list of all line items with all their field values.

Public cancelAssets
cancelAssets(assetIds: Array, cancelDate: Date)

The primary method to terminate the existing assets.

Example:

import { AssetService } from '@apttus/ecommerce';

export class MyComponent implements OnInit{
    lineItemMap: Array<any>;
    lineItemMap$: Observable<Array<any>>;

    constructor(private assetService: AssetService){}

    ngOnInit(){
        this.assetService.cancelAssets(assetIds: Array<string>, cancelDate: Date)subscribe(lineItemMap => {...});
        // or
        this.lineItemMap$ = this.assetService.cancelAssets(assetIds: Array<string>, cancelDate: Date);
    }
}
Parameters :
Name Type Optional Description
assetIds Array<string> No

list of asset ids to terminate

cancelDate Date No

cancel date for asset termination

Returns : Observable<any>

Observable<Array> returns an observable list of all line items with all their field values.

Public getAssetLineItemForAccount
getAssetLineItemForAccount(accountId?: string, adtlConditions?: Array, sort?: Array, pageInfo?: APageInfo)

The primary method to get the asset line items for given account.

Example:

import { AssetService } from '@apttus/ecommerce';

export class MyComponent implements OnInit{
    assetLineItems: Array<AssetLineItem>;
    assetLineItems$: Observable<Array<AssetLineItem>>;

    constructor(private assetService: AssetService){}

    ngOnInit(){
        this.assetService.getAssetLineItemForAccount().subscribe(assetLineItems => {...});
        // or
        this.assetLineItems$ = this.assetService.getAssetLineItemForAccount();
        // or
        this.assetService.getAssetLineItemForAccount(accountId: string, adtlConditions: Array<ACondition>)subscribe(assetLineItems => {...});
        // or
        this.assetLineItems$ = this.assetService.getAssetLineItemForAccount(accountId: string, adtlConditions: Array<ACondition>);
    }
}
Parameters :
Name Type Optional Description
accountId string Yes

optional accountId, if accountId null then account details for logged in user is used to retrieve asset line item records

adtlConditions Array<ACondition> Yes

optional list of ACondition to filter asset line item records

sort Array<ASort> Yes

optional list of ASort objects for sorting the results.

pageInfo APageInfo Yes
Returns : Observable<Array<AssetLineItemExtended>>

Observable<Array> returns an observable list of asset line item records

Public getBundleItemsForAssetLineItem
getBundleItemsForAssetLineItem(assetLineItem: string | AssetLineItemExtended)

This method returns the bundled options for the asset line item passed.

Parameters :
Name Type Optional Description
assetLineItem string | AssetLineItemExtended No

Instance of the quote line item passed.

Returns : Observable<Array<AssetLineItemExtended>>

An observable containing the array of asset line items for a given asset line item.

Public groupFormItems
groupFormItems(items: Array)
Parameters :
Name Type Optional
items Array<any> No
Returns : Object
Public incrementAssets
incrementAssets(incrementAssetDOs: Array)

The primary method to increment the existing assets.

Example:

import { AssetService, IncrementAssetDO, IncrementLineAction } from '@apttus/ecommerce';

export class MyComponent implements OnInit{
    lineItemMap: Array<any>;
    lineItemMap$: Observable<Array<any>>;

    constructor(private assetService: AssetService){}

    ngOnInit(){
        this.assetService.incrementAssets(incrementAssetDO: Array<IncrementAssetDO>)subscribe(lineItemMap => {...});
        // or
        this.lineItemMap$ = this.assetService.incrementAssets(incrementAssetDO: Array<IncrementAssetDO>);
    }
}
Parameters :
Name Type Optional Description
incrementAssetDOs Array<IncrementAssetDO> No

list of increment asset data objects for incrementing the existing assets

Returns : Observable<any>

Observable<Array> returns an observable list of all line items with all their field values.

renewAssets
renewAssets(assetIds: Array, renewEndDate: Date, renewTerm: number, farthestAssetEndDate: boolean)

The primary method to renew the existing assets.

Example:

import { AssetService } from '@apttus/ecommerce';

export class MyComponent implements OnInit{
    lineItemMap: Array<any>;
    lineItemMap$: Observable<Array<any>>;

    constructor(private assetService: AssetService){}

    ngOnInit(){
        this.assetService.renewAssets(assetIds: Array<string>, renewEndDate: Date, renewTerm: number, cartId: string, farthestAssetEndDate: boolean)subscribe(lineItemMap => {...});
        // or
        this.assetService.renewAssets(assetIds: Array<string>, renewEndDate: Date, renewTerm: number, cartId: string, farthestAssetEndDate: boolean);
    }
}
Parameters :
Name Type Optional Description
assetIds Array<string> No

list of asset ids to renew

renewEndDate Date No

renew end date for asset renewal

renewTerm number No

renew term for asset renewal

farthestAssetEndDate boolean No

farthest asset end date for asset renewal

Returns : Observable<boolean>

Observable<Array> returns an observable list of all line items with all their field values.

Public swapAssets
swapAssets(assetIds: Array, productIds: Array, newStartDate: Date)

The primary method to swap the existing assets. Creates line items for the cancelled asset line item and new line items for swapped product.

Example:

import { AssetService } from '@apttus/ecommerce';

export class MyComponent implements OnInit{
    lineItemMap: Array<any>;
    lineItemMap$: Observable<Array<any>>;

    constructor(private assetService: AssetService){}

    ngOnInit(){
        this.assetService.swapAssets(assetIds: Array<string>)subscribe(lineItemMap => {...});
        // or
        this.lineItemMap$ = this.assetService.swapAssets(assetIds: Array<string>);
    }
}
Parameters :
Name Type Optional Description
assetIds Array<string> No

list of asset ids which are swapped

productIds Array<string> No

list of ids of the product with which the asset is being swapped

newStartDate Date No

new asset start date on swapping

Returns : Observable<any>

Observable<Array> returns an observable list of all line items with all their field values.

result-matching ""

    No results matching ""