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