First attempt at "create transaction"-form for v2 users.

This commit is contained in:
James Cole
2023-10-08 16:11:04 +02:00
parent 2ea9369f99
commit 1fe36044f1
56 changed files with 901 additions and 130 deletions

View File

@@ -22,7 +22,7 @@
*
* @param entries
*/
export function parseFromEntries(entries) {
export function parseFromEntries(entries, transactionType) {
let returnArray = [];
for (let i in entries) {
if (entries.hasOwnProperty(i)) {
@@ -36,8 +36,16 @@ export function parseFromEntries(entries) {
current.amount = entry.amount;
current.date = entry.date;
// if ID is set:
if ('' !== entry.source_account.id.toString()) {
current.source_id = entry.source_account.id;
}
if ('' !== entry.destination_account.id.toString()) {
current.destination_id = entry.destination_account.id;
}
// TODO transaction type is hard coded:
current.type = 'withdrawal';
current.type = transactionType;
returnArray.push(current);