23 lines
645 B
TypeScript
23 lines
645 B
TypeScript
|
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")
|
||
|
}
|