Created
January 18, 2018 14:12
-
-
Save kyranjamie/7e1689070ee7714df475955102757a28 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(["require", "exports"], function (require, exports) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { value: true }); | |
var Account = /** @class */ (function () { | |
function Account() { | |
} | |
Account.prototype.entityType = function () { | |
return this.companyType; | |
}; | |
Account.prototype.completeAddress = function () { | |
return this.city + " " + this.address + " " + this.postcode; | |
}; | |
Account.prototype.cash = function () { | |
var accountCurrency = this.currency.toLowerCase(); | |
return this.cashBalance ? this.cashBalance[accountCurrency] : 0; | |
}; | |
Account.prototype.totalPortfolio = function () { | |
var accountCurrency = this.currency.toLowerCase(); | |
return this.totalPortfolioValue ? this.totalPortfolioValue[accountCurrency] : 0; | |
}; | |
Account.prototype.isSuspect = function () { | |
return this.modelType === 'SuspectAccount'; | |
}; | |
Account.prototype.bullionAssets = function () { | |
return this.assets ? this.assets.filter(function (a) { return a.type === 'bullion'; }) : []; | |
}; | |
Account.prototype.cashAssets = function () { | |
return this.assets ? this.assets.filter(function (a) { return a.type === 'cash'; }) : []; | |
}; | |
Account.prototype.sumTotalAssets = function () { | |
return this.assets ? this.assets : []; | |
}; | |
Account.prototype.sumTotalBullionAssets = function () { | |
return this.bullionAssets; | |
}; | |
Account.prototype.sumTotalCashAssets = function () { | |
return this.cashAssets; | |
}; | |
Account.prototype.sumTotalGoldAssets = function () { | |
return this.bullionAssets.filter(function (a) { return a.metadata.type === 'au'; }); | |
}; | |
Account.prototype.sumTotalSilverAssets = function () { | |
return this.bullionAssets.filter(function (a) { return a.metadata.type === 'ag'; }); | |
}; | |
Account.prototype.sumTotalPlatinumAssets = function () { | |
return this.bullionAssets.filter(function (a) { return a.metadata.type === 'pt'; }); | |
}; | |
Account.prototype.blockStatuses = function () { | |
return { | |
account: this.isBlocked, | |
directdebits: this.isBlockedDirectDebits, | |
mgm: this.isBlockedMgm, | |
primary: this.isBlockedPrimary, | |
secondary: this.isBlockedSecondary, | |
savings: this.isBlockedSavings, | |
withdrawals: this.isBlockedWithdrawals, | |
}; | |
}; | |
Object.defineProperty(Account.prototype, "addresses", { | |
set: function (addresses) { | |
this._addresses = addresses; | |
}, | |
enumerable: true, | |
configurable: true | |
}); | |
Account.prototype.addresses = function () { | |
var _this = this; | |
return this._addresses ? this._addresses.map(function (address) { | |
address.isPrimaryDelivery = address.id === _this.primaryDeliveryAddress; | |
address.isPrimaryInvoice = address.id === _this.primaryInvoiceAddress; | |
return address; | |
}, this) : []; | |
}; | |
return Account; | |
}()); | |
exports.Account = Account; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(["require", "exports"], function (require, exports) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { value: true }); | |
var Account = /** @class */ (function () { | |
function Account() { | |
} | |
Object.defineProperty(Account.prototype, "entityType", { | |
get: function () { | |
return this.companyType; | |
}, | |
enumerable: true, | |
configurable: true | |
}); | |
Object.defineProperty(Account.prototype, "completeAddress", { | |
get: function () { | |
return this.city + " " + this.address + " " + this.postcode; | |
}, | |
enumerable: true, | |
configurable: true | |
}); | |
Object.defineProperty(Account.prototype, "cash", { | |
get: function () { | |
var accountCurrency = this.currency.toLowerCase(); | |
return this.cashBalance ? this.cashBalance[accountCurrency] : 0; | |
}, | |
enumerable: true, | |
configurable: true | |
}); | |
Object.defineProperty(Account.prototype, "totalPortfolio", { | |
get: function () { | |
var accountCurrency = this.currency.toLowerCase(); | |
return this.totalPortfolioValue ? this.totalPortfolioValue[accountCurrency] : 0; | |
}, | |
enumerable: true, | |
configurable: true | |
}); | |
Object.defineProperty(Account.prototype, "isSuspect", { | |
get: function () { | |
return this.modelType === 'SuspectAccount'; | |
}, | |
enumerable: true, | |
configurable: true | |
}); | |
Object.defineProperty(Account.prototype, "bullionAssets", { | |
get: function () { | |
return this.assets ? this.assets.filter(function (a) { return a.type === 'bullion'; }) : []; | |
}, | |
enumerable: true, | |
configurable: true | |
}); | |
Object.defineProperty(Account.prototype, "cashAssets", { | |
get: function () { | |
return this.assets ? this.assets.filter(function (a) { return a.type === 'cash'; }) : []; | |
}, | |
enumerable: true, | |
configurable: true | |
}); | |
Object.defineProperty(Account.prototype, "sumTotalAssets", { | |
get: function () { | |
return this.assets ? this.assets : []; | |
}, | |
enumerable: true, | |
configurable: true | |
}); | |
Object.defineProperty(Account.prototype, "sumTotalBullionAssets", { | |
get: function () { | |
return this.bullionAssets; | |
}, | |
enumerable: true, | |
configurable: true | |
}); | |
Object.defineProperty(Account.prototype, "sumTotalCashAssets", { | |
get: function () { | |
return this.cashAssets; | |
}, | |
enumerable: true, | |
configurable: true | |
}); | |
Object.defineProperty(Account.prototype, "sumTotalGoldAssets", { | |
get: function () { | |
return this.bullionAssets.filter(function (a) { return a.metadata.type === 'au'; }); | |
}, | |
enumerable: true, | |
configurable: true | |
}); | |
Object.defineProperty(Account.prototype, "sumTotalSilverAssets", { | |
get: function () { | |
return this.bullionAssets.filter(function (a) { return a.metadata.type === 'ag'; }); | |
}, | |
enumerable: true, | |
configurable: true | |
}); | |
Object.defineProperty(Account.prototype, "sumTotalPlatinumAssets", { | |
get: function () { | |
return this.bullionAssets.filter(function (a) { return a.metadata.type === 'pt'; }); | |
}, | |
enumerable: true, | |
configurable: true | |
}); | |
Object.defineProperty(Account.prototype, "blockStatuses", { | |
get: function () { | |
return { | |
account: this.isBlocked, | |
directdebits: this.isBlockedDirectDebits, | |
mgm: this.isBlockedMgm, | |
primary: this.isBlockedPrimary, | |
secondary: this.isBlockedSecondary, | |
savings: this.isBlockedSavings, | |
withdrawals: this.isBlockedWithdrawals, | |
}; | |
}, | |
enumerable: true, | |
configurable: true | |
}); | |
Object.defineProperty(Account.prototype, "addresses", { | |
get: function () { | |
var _this = this; | |
return this._addresses ? this._addresses.map(function (address) { | |
address.isPrimaryDelivery = address.id === _this.primaryDeliveryAddress; | |
address.isPrimaryInvoice = address.id === _this.primaryInvoiceAddress; | |
return address; | |
}, this) : []; | |
}, | |
set: function (addresses) { | |
this._addresses = addresses; | |
}, | |
enumerable: true, | |
configurable: true | |
}); | |
return Account; | |
}()); | |
exports.Account = Account; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment