-
-
Save jlongster/6c04de7117780efb3c6c7a2887363e19 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let actual = require('@actual-app/api'); | |
async function run() { | |
let accounts = await actual.getAccounts(); | |
let accountId = accounts[0].id; | |
let transactions = []; | |
for (let i = 0; i < 10; i++) { | |
transactions.push({ | |
payee: 'Payee ' + ((Math.random() * 10) | 0), | |
amount: (-Math.random() * 10000) | 0, | |
date: '2019-08-18' | |
}); | |
} | |
await actual.importTransactions(accountId, transactions); | |
} | |
actual.runWithBudget('My-Stash2', run); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let actual = require('@actual-app/api'); | |
async function run() { | |
let categories = await actual.getCategories({ asList: true }); | |
for (let category of categories) { | |
if (!category.is_income) { | |
await actual.setBudgetAmount( | |
'2019-08', | |
category.id, | |
(Math.random() * 10000) | 0 | |
); | |
} | |
} | |
} | |
actual.runWithBudget('My-Stash2', run); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment