- 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:
2024-12-01 20:48:42 +01:00
parent cc325b9f08
commit 9ed0a19393
9 changed files with 88 additions and 50 deletions

View File

@ -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,
}