projects/congarevenuecloud/ecommerce/src/lib/modules/abo/services/asset.service.ts
This service is a work in progress.
Assets are the products owned by customers, and a user may wish to renew,terminate, or update existing assets.
import { AssetService, AObjectService} from '@congarevenuecloud/ecommerce';
export class MyComponent implements OnInit{
constructor( private assetService: AssetService)
}
// or
export class MyService extends AObjectService {
private assetService: AssetService = this.injector.get(AssetService);
}
AObjectService
Properties |
|
Methods |
|
| Public cancelAssets | ||||||||||||
cancelAssets(assetIds: Array
|
||||||||||||
|
The primary method to terminate the existing assets. Example:
Parameters :
Returns :
Observable<Array<CartItem>>
Observable<Array |
| getAssetAggregates | ||||||||||||||||||||||||||||||
getAssetAggregates(account?: Account, aggregateFields?: Array<AggregateFields>, queryFields: Array
|
||||||||||||||||||||||||||||||
|
This method returns an aggregate result based on asset aggregate criteria. Example:See AggregateFields for more details on the structure and fields required.
Parameters :
Returns :
Observable<AggregateResultSet>
observable containing aggregate response. |
| getAssetFilters | ||||||||
getAssetFilters(productList?: Array<Product> | Array<string>)
|
||||||||
|
Generates an array of field filters to retrieve assets. This method combines a default set of filters with additional filters derived from the provided product list. Allows customization of the filter criteria. If provided, the method will generate a filter based on the product IDs. The filters defined by this method are as follows: The common/default filters are:
If the productList is provided with more than one item, a filter is created based on
the product IDs using the
Parameters :
Returns :
Array<FieldFilter>
An array of field filters. |
| Public getAssetLineItemsforProducts | |||||||||||||||
getAssetLineItemsforProducts(productList: Array<Product> | Array<string>, memoizeOptions: MemoizeOptions)
|
|||||||||||||||
Decorators :
@MemoizeWithHash()
|
|||||||||||||||
|
This method can be used to get the asset line items for a given set of products. ABO must be enabled in the storefront to get asset line item records. Example:See MemoizeOptions for more details on the structure and fields required.
Parameters :
Returns :
Observable<Array<AssetLineItemExtended>>
returns an observable list of asset line item records. |
| Public incrementAssets | ||||||||
incrementAssets(incrementAssetDOs: Array
|
||||||||
|
The primary method to increment the existing assets. Example:See IncrementAssetDO for more details on the structure and fields required.
Parameters :
Returns :
Observable<Array<CartItem>>
an observable list of cart line items records. |
| Public renewAssets | ||||||||||||||||||||
renewAssets(assetIds: Array
|
||||||||||||||||||||
|
The primary method to renew the existing assets. Example:
Parameters :
Returns :
Observable<Array<CartItem>>
Observable<Array |
| restoreAssetLineItem | ||||||||
restoreAssetLineItem(lineItems: Array
|
||||||||
|
This method reverts a list of line items to their previous state after they have been canceled. It changes the status of these line items back to what it was before the cancellation. Example:
Parameters :
Returns :
Observable<Array<CartItem>>
An observable that emits the response from the API call, which typically contains updated information about the restored line items. |
| Protected accountService |
Default value : this.injector.get(AccountService)
|
| apiService |
Type : ApiService
|
Default value : this.injector.get(ApiService)
|
| storefrontService |
Type : StorefrontService
|
Default value : this.injector.get(StorefrontService)
|
| type |
Default value : AssetLineItemExtended
|