Changed:
- Env key to be more generic - Cache directory to .cache - Multiply bank amount by 100 to get correct conversion rate Removed: - Unused functions in Actual.ts Added: - Test for main functionality - BankStub for testing - Added imported_id to Actual Transaction to avoid duplicates
This commit is contained in:
@ -3,14 +3,17 @@ import type { TransactionEntity } from "@actual-app/api/@types/loot-core/types/m
|
||||
import type { UUID } from "node:crypto"
|
||||
|
||||
// TODO more fields / correct fields?
|
||||
export function transactionIntoActualTransaction(
|
||||
export function bankTransactionIntoActualTransaction(
|
||||
transaction: Transaction,
|
||||
accountId: UUID,
|
||||
): TransactionEntity {
|
||||
return {
|
||||
id: transaction.id,
|
||||
// Transactions with the same id will be ignored
|
||||
imported_id: transaction.id,
|
||||
account: accountId,
|
||||
amount: transaction.amount,
|
||||
// The value without decimals
|
||||
amount: transaction.amount * 100,
|
||||
date: transaction.date,
|
||||
payee: transaction.description,
|
||||
}
|
||||
|
Reference in New Issue
Block a user