- CronJob
- interface and simple impl for Actual
- interface and simple impl for Sparebank1
- Mappings between sparebank1 transactions and actual transactions
- Requires type keyword on type imports
This commit is contained in:
2024-11-17 22:27:29 +01:00
parent 90bcf94f14
commit 01af64349e
6 changed files with 167 additions and 34 deletions

22
src/mappings.ts Normal file
View File

@ -0,0 +1,22 @@
import type { Transaction } from "@/sparebank1.ts"
import type { TransactionEntity } from "@actual-app/api/@types/loot-core/types/models"
// TODO more fields / correct fields?
export function transactionIntoActualTransaction(
transaction: Transaction,
account: string,
): TransactionEntity {
return {
id: transaction.id,
account,
amount: transaction.amount,
date: transaction.date,
payee: transaction.description,
}
}
// TODO take the account from the bank and match it to the actual account
// Use ENV
export function bankAccountIntoActualAccount(account: string): string {
throw new Error("Not implemented")
}