Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
myinvestor.prototype.getDividendSummaries = function (exchangeName, callback) {
models.instance.DividendSummary.find({
g_exchange_name: exchangeName
}, function (err, dividendSummaries) {
callback(err, dividendSummaries);
});
}
myinvestor.prototype.getChosenStocks = function (callback) {
models.instance.ChosenStock.find({}, function (err, chosenStocks) {
callback(err, chosenStocks);
});
}
const insertData = (data, cb) => {
const processId = models.uuid();
data['id'] = _.toString(processId);
const batch = new models.instance.bulk_upload_process(data);
batch.save(err => {
if (err) {
cb(err, null);
} else {
cb(null, processId);
}
});
}
myinvestor.prototype.getStocks = function (exchangeName, callback) {
models.instance.Stock.find({ exchange_name: exchangeName, $orderby: { '$asc': 'stock_symbol' }, }, function (err, stocks) {
callback(err, stocks);
});
}
myinvestor.prototype.getExchanges = function (callback) {
models.instance.Exchange.find({}, function (err, exchanges) {
callback(err, exchanges);
});
}
myinvestor.prototype.getStockHistories = function (exchangeName, stockSymbol, callback) {
models.instance.StockHistory.find({
exchange_name: exchangeName,
stock_symbol: stockSymbol,
$orderby: { '$desc': ['stock_symbol', 'history_date'] }
}, function (err, histories) {
callback(err, histories);
});
}