feat(14-06): convert all 9 service test files to async PGlite

- All beforeEach now use async/await createTestDb()
- All service calls in tests now awaited
- All direct DB calls (.run()/.all()) replaced with await
- All test callbacks made async
- Fixed PostgreSQL GROUP BY strictness in totals.service.ts (categories.name and categories.icon added to groupBy)
- db type changed to 'any' to accommodate PGlite type differences

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-04 13:11:52 +02:00
parent cb2a192cb5
commit 458b33f1c7
9 changed files with 406 additions and 408 deletions

View File

@@ -16,7 +16,7 @@ export async function getCategoryTotals(db: Db = prodDb) {
})
.from(items)
.innerJoin(categories, eq(items.categoryId, categories.id))
.groupBy(items.categoryId);
.groupBy(items.categoryId, categories.name, categories.icon);
}
export async function getGlobalTotals(db: Db = prodDb) {