Commit 2c5b7b4b authored by Jan's avatar Jan
Browse files

Add manually editable accounts

parent 18a20f21
......@@ -37,9 +37,11 @@ function addBackend(exportObject) {
// Add backends here.
import * as mockBackend from './sources/mock';
import * as manualBackend from './sources/manual';
import * as weboobBackend from './sources/weboob';
addBackend(mockBackend);
addBackend(manualBackend);
addBackend(weboobBackend);
// Connect static bank information to their backends.
......
// This modules mocks output generated by weboob.
import Account from '../../models/account';
import Operation from '../../models/operation';
export const SOURCE_NAME = 'manual';
export const fetchAccounts = async access => {
let accounts = await Account.byAccess(access);
if (!accounts.length) {
accounts = [{
accountNumber: 'manual1',
label: 'Manual Account',
balance: '0',
currency: 'EUR'
}];
}
return accounts;
};
export const fetchTransactions = async access => {
let accounts = await Account.byAccess(access);
let accountNumbers = accounts.map(account => account.accountNumber);
return await Operation.byAccounts(accountNumbers);
};
......@@ -911,6 +911,11 @@
"backend": "weboob",
"name": "Yomoni"
},
{
"name": "Manual Bank",
"uuid": "manualbank",
"backend": "manual"
},
{
"name": "Fake Bank 1",
"uuid": "fakebank1",
......
static/images/banks/fakebank2.png
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment