-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathold-index.js
34 lines (26 loc) · 1009 Bytes
/
old-index.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
const assetDb = require('./database/asset-db')
const investorDb = require('./database/investor-db')
const transactionDb = require('./database/transaction-db')
const { createTestData } = require('./create-data')
const { resetDb } = require('./reset-db')
// const { loadTransactions } = require('./lib/utils')
async function main () {
await resetDb()
await createTestData()
const assets = await assetDb.load()
const investors = await investorDb.load()
const transactions = await transactionDb.load()
console.log('\nLOADED : ' + assets.length + ' Assets')
assets.forEach(asset => {
console.log(asset.id + ' ' + asset.name)
})
console.log('\nLOADED : ' + investors.length + ' Investors')
investors.forEach(investor => {
console.log(investor.id + ' ' + investor.name)
})
console.log('\nLOADED : ' + transactions.length + ' Transactions')
transactions.forEach(tx => {
console.log(`${tx.id} : ${tx.amount} ${tx.asset.symbol} : ${tx.type} : $ ${tx.price}`)
})
}
main()