@dhyasama/totem-models 8.49.0 → 8.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/Fund.js +1 -43
  2. package/package.json +1 -1
package/lib/Fund.js CHANGED
@@ -104,48 +104,6 @@ module.exports = function(mongoose, config) {
104
104
  .exec(cb);
105
105
  };
106
106
 
107
- Fund.statics.getPerformance = function getPerformance(id, cb) {
108
-
109
- var getLatestVehicle = function(rounds) {
110
-
111
- var latestVehicles = [];
112
-
113
- _.each(rounds, function (r) {
114
- latestVehicles.push(_.max(r.vehicles, function (v) {
115
- return v.valuationDate;
116
- }));
117
- });
118
-
119
- latestVehicles = _.compact(latestVehicles);
120
-
121
- return _.max(latestVehicles, function (v) { return v.valuationDate; });
122
-
123
- };
124
-
125
- Round.getByFund(id, function(err, rounds) {
126
-
127
- if (err) return cb(err, null);
128
- if (!rounds || rounds.length == 0) return cb(null, []);
129
-
130
- // filter vehicles down to this fund
131
- _.each(rounds, function (r) {
132
- r.vehicles = _.filter(r.vehicles, function (v) {
133
- return v.fund._id.toString() == id.toString();
134
- });
135
- });
136
-
137
- var latestVehicle = getLatestVehicle(rounds);
138
-
139
- return cb(null, {
140
- cost: latestVehicle.cost,
141
- fairValue: latestVehicle.fairValue,
142
- multiple: latestVehicle.multiple
143
- });
144
-
145
- });
146
-
147
- };
148
-
149
107
  Fund.statics.list = function list(cb) {
150
108
  this
151
109
  .find()
@@ -196,4 +154,4 @@ module.exports = function(mongoose, config) {
196
154
 
197
155
  mongoose.model('Fund', Fund);
198
156
 
199
- };
157
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "8.49.0",
3
+ "version": "8.50.0",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",