1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2025-07-02 20:28:38 -04:00

Add symbols for securities

This commit is contained in:
2015-08-26 07:38:13 -04:00
parent 01f0f9e68f
commit 099f42e4fe
3 changed files with 34 additions and 8 deletions

View File

@ -92,6 +92,7 @@ for (var type in SecurityType) {
function Security() {
this.SecurityId = -1;
this.Name = "";
this.Symbol = "";
this.Precision = -1;
this.Type = -1;
}
@ -100,6 +101,7 @@ Security.prototype.toJSON = function() {
var json_obj = {};
json_obj.SecurityId = this.SecurityId;
json_obj.Name = this.Name;
json_obj.Symbol = this.Symbol;
json_obj.Precision = this.Precision;
json_obj.Type = this.Type;
return JSON.stringify(json_obj);
@ -112,6 +114,8 @@ Security.prototype.fromJSON = function(json_input) {
this.SecurityId = json_obj.SecurityId;
if (json_obj.hasOwnProperty("Name"))
this.Name = json_obj.Name;
if (json_obj.hasOwnProperty("Symbol"))
this.Symbol = json_obj.Symbol;
if (json_obj.hasOwnProperty("Precision"))
this.Precision = json_obj.Precision;
if (json_obj.hasOwnProperty("Type"))