🎉 Working prototype

- Added missing field payee_name to TransactionEntity type
- Date function to convert DayJs to DateString
- Temp disabled cronjob for testing
- Fixed mapping to ActualModel
- fetchToken db function returns DayJs object for date
- Fixed fetching tokens from db
- Logging
- Fixed fetch previous day transactions
- Fixed token refresh
- Fixed stub based on model changes
This commit is contained in:
2025-01-25 18:01:47 +01:00
parent 9a00592a7a
commit b61903f5c8
8 changed files with 128 additions and 71 deletions

View File

@ -1,31 +1,36 @@
import type { Bank, Transaction } from "@/bank/sparebank1.ts"
import type { Bank, TransactionResponse } from "@/bank/sparebank1.ts"
import dayjs from "dayjs"
export class BankStub implements Bank {
async transactionsPastDay(
_accountIds: ReadonlyArray<string> | string,
): Promise<ReadonlyArray<Transaction>> {
): Promise<TransactionResponse> {
const someFields = {
date: "2019-08-20",
description: "Test transaction",
date: dayjs("2019-08-20").unix(),
cleanedDescription: "Test transaction",
remoteAccountName: "Test account",
}
return [
{
id: "1",
amount: 100,
...someFields,
},
{
id: "2",
amount: 200,
...someFields,
},
{
id: "3",
amount: -50,
...someFields,
},
]
return {
transactions: [
{
id: "1",
nonUniqueId: "1",
amount: 100,
...someFields,
},
{
id: "2",
nonUniqueId: "2",
amount: 200,
...someFields,
},
{
id: "3",
nonUniqueId: "3",
amount: -50,
...someFields,
},
],
}
}
}