-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
45 lines (43 loc) · 1.47 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
const axios = require("axios");
const equity = require("./equity");
const debt = require("./debt");
const hybrid = require("./hybrid");
const others = require("./others");
const data = require("./data.json");
const { asyncForEach, ALL_FUNDS_URL } = require("./common/utils");
const getAllfundSchemes = async () => {
try {
let { data } = await axios.get(ALL_FUNDS_URL);
await asyncForEach(Object.keys(data), async type => {
console.log(type);
switch (type) {
case "Equity":
// Analyze Equity funds
await equity(data[type]);
break;
case "Others":
// Analyze Others funds
await others(data[type]);
break;
case "Debt":
// Analyze Debt funds
await debt(data[type]);
break;
case "Hybrid":
// Analyze Hybrid funds
await hybrid(data[type]);
break;
case "Solution Oriented":
// Analyze Solution Oriented funds
break;
default:
console.log(type + " funds not found");
break;
}
});
// equity.analyzeEquityFunds("test");
} catch(err) {
console.error("Error while getting fund schemes", err);
}
}
getAllfundSchemes();