Represents a saleable item that can be provided/distributed in terms of one purchase.

An asset is characterized by the following:

  • Every asset reflects some purchase (somebody purchases either a service or a good).
  • Purchase action can be reverted (canceled) or terminated when terms of purchase are expired.
  • Asset can be subscription-based (when customer pay for usage in some time terms) or one-time based.
  • Matter of asset is defined as list of purchased items with purchased quantities (asset items).
  • Item in asset may be either reservation-based, when customer decides how many items of SKU to be purchased or Pay-Per-User based when actual use of the SKU defines quantity for asset item.
  • Asset may be modified using change requests: either set of items may be changed or quantities of reservation-based items may be changed.
  • Some assets can be put into suspend state, when service is not actually provided and no charges happened.
  • Assets also may be parametrized by one or more parameters which differentiate one asset from another.

Static methods

staticget(id:String):Asset

Returns:

The Asset with the given id, or null if it was not found.

staticlist(filters:Query):Collection<Asset>

Lists all Assets that match the given filters. Supported filters are:

  • id
  • conection.hub.id
  • connection.provider.id
  • tiers.customer.id
  • tiers.tier1.id
  • tiers.tier2.id
  • connection.id
  • status
  • created
  • updated
  • marketplace.id
  • contract.id
  • product.id
  • connection.type

Returns:

A Collection of Assets.

Constructor

new()

Variables

configuration:Configuration

Product and Marketplace Configuration Phase Parameter.

connection:Connection

Connection object reference.

contract:Contract

Contract object reference.

events:Events

Events that have taken place on this asset (i.e: created, updated).

externalId:String

Identification for asset object on eCommerce.

externalName:String

Name of asset.

externalUid:String

Id of asset in eCommerce system.

items:Collection<Item>

Collection of asset product items.

marketplace:Marketplace

Marketplace object reference.

params:Collection<Param>

Collection of product parameters.

product:Product

Product object reference.

status:String

Assets may have one of the following statuses:

  • new: First purchase requested.
  • processing: Until first purchase request is either completed or rejected.
  • active: After the first purchase request is completed. NOTE: Asset stays active regardless of any other requests except cancel.
  • rejected: Asset becomes rejected once the first purchase request is rejected.
  • terminated: Asset becomes terminated once the 'cancel' request type is fulfilled.
  • suspended: Asset becomes suspended once 'suspend' request type is fulfilled.

tiers:Tiers

Supply chain accounts.

Methods

getChangedItems():Collection<Item>

Returns:

A collection with this Asset's changed items.

getCustomerConfig():TierConfig

Returns:

The TierConfig object for the customer tier of this asset, or null.

getItemByGlobalId(globalId:String):Item

Returns:

The item with the given global id, or null if it was not found.

getItemById(itemId:String):Item

Returns:

The item with the given id, or null if it was not found.

getItemByMpn(mpn:String):Item

Returns:

The item with the given Manufacture Part Number, or null if it was not found.

getNewItems():Collection<Item>

Returns:

A collection with this Asset's new items.

getParamById(paramId:String):Param

Returns:

The param with the given id, or null if it was not found.

getRemovedItems():Collection<Item>

Returns:

A collection with this Asset's removed items.

getRequests():Collection<AssetRequest>

Returns:

A collection with all the requests for the this Asset.

getTier1Config():TierConfig

Returns:

The TierConfig object for the tier1 of this asset, or null.

getTier2Config():TierConfig

Returns:

The TierConfig object for the tier2 of this asset, or null.

Inherited Variables

Defined by IdModel

id:String

Id of the model.

Inherited Methods

Defined by Model

toObject():Dynamic

Returns:

A Haxe dynamic object with a shallow copy of this model's properties.

toString():String

Returns:

A String with the JSON representation of this Model.