"use strict"; /** * Value object for asset item. * * @constructor */ function PersonAssetVO() { // database fields this.reconciliationId = ''; this.name = ''; this.desc = ''; this.type = ''; this.assetType = ''; this.ticketCount = 0; this.selected = false; this.receivedDate = ''; this.classId = ''; this.categories = null; this.product = null; this.entityLink = ''; this.assetExtension = {}; this.status = {}; this.manufacturer = ''; } // inherit BaseVO PersonAssetVO.prototype = new BaseVO(); // correct the constructor pointer PersonAssetVO.prototype.constructor = PersonAssetVO; /** * @override * @return {Array} */ PersonAssetVO.prototype.getProps = function () { return BaseVO.prototype.getProps().concat('reconciliationId', 'name', 'desc', 'type', 'assetType', 'ticketCount', 'receivedDate', 'classId', 'product', 'role', 'assetExtension', 'status', 'manufacturer'); }; /** * @override */ PersonAssetVO.prototype.postBuild = function () { this.assetReceivedDate = moment(this.receivedDate).fromNow(true); this.categories = this.product.categorizations; this.entityLink = '#/' + EntityVO.TYPE_ASSET + '/' + this.reconciliationId + '/' + this.classId; };