Added:
- 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:
22
src/mappings.ts
Normal file
22
src/mappings.ts
Normal 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")
|
||||
}
|
Reference in New Issue
Block a user