diff --git a/src/main.ts b/src/main.ts index e1848f2..6f7a7c3 100644 --- a/src/main.ts +++ b/src/main.ts @@ -15,7 +15,6 @@ import { Sparebank1Impl } from "@sb1impl/sparebank1.ts" // TODO move tsx to devDependency. Requires ts support for Node with support for @ alias // TODO verbatimSyntax in tsconfig, conflicts with jest // TODO store last fetched date in db, and refetch from that date, if app has been offline for some time -// TODO do not fetch if saturday or sunday async function main(): Promise { logger.info("Starting application") @@ -38,6 +37,11 @@ export async function moveTransactions( ) logger.info(`Fetched ${actualTransactions.length} transactions`) + if (actualTransactions.length === 0) { + logger.debug("No transactions to import, skipping") + return + } + const transactionsByAccount = Object.groupBy( actualTransactions, (transaction) => transaction.account,