Martin Berg Alstad 480c0356f9
Fixes
- Added Actual account ids and log level to .env.example.
- Fixed timestamp error by downloading the budget after init.
- Hardcoded date in test.
- Separate logging file for configurations.
- Organized test
- More logging in main
- Fixed wrong paths for some files
- Load a .env.test.local file when running tests

Signed-off-by: Martin Berg Alstad <git@martials.no>
2024-12-23 16:47:07 +01:00

50 lines
1.1 KiB
TypeScript

import type { Bank, OAuthTokenResponse, Transaction } from "@/bank/sparebank1.ts"
const tokenResponse: OAuthTokenResponse = {
access_token: "my_access_token",
token_type: "Bearer",
expires_in: 3600,
refresh_token: "my_refresh_token",
refresh_token_expires_in: 3600,
refresh_token_absolute_expires_in: 3600,
}
export class BankStub implements Bank {
async accessToken(): Promise<OAuthTokenResponse> {
return tokenResponse
}
async refreshToken(_unused: string): Promise<OAuthTokenResponse> {
return tokenResponse
}
async transactionsPastDay(
_accountIds: ReadonlyArray<string> | string,
_accessToken: string,
): Promise<ReadonlyArray<Transaction>> {
const someFields = {
date: "2019-08-20",
description: "Test transaction",
cleanedDescription: "Test transaction",
remoteAccountName: "Test account",
}
return [
{
id: "1",
amount: 100,
...someFields,
},
{
id: "2",
amount: 200,
...someFields,
},
{
id: "3",
amount: -50,
...someFields,
},
]
}
}