refactor(realtime, systemNotices, addons, airports, audit, categories, permissions, query-helpers, tags, transit, trip-membership): async DB-touching methods; transactions through UnitOfWork

This commit is contained in:
jubnl
2026-09-21 20:48:03 +02:00
parent 27d044f9e8
commit 0cf99a9939
306 changed files with 3656 additions and 3189 deletions
@@ -44,11 +44,11 @@ describe('AdminDefaultUserSettingsController', () => {
expect(controller().c.get()).toEqual({ theme: 'dark' });
});
it('DEFAULTS-002 PUT writes, audits, and answers with the STORED defaults', () => {
it('DEFAULTS-002 PUT writes, audits, and answers with the STORED defaults', async () => {
const { c, settings } = controller();
// Not the request body: the service normalises and drops unknown keys, and the
// admin panel renders straight from this response.
expect(c.update(user, { theme: 'light' } as never, req)).toEqual({ theme: 'dark' });
expect(await c.update(user, { theme: 'light' } as never, req)).toEqual({ theme: 'dark' });
expect(settings.setAdminUserDefaults).toHaveBeenCalledWith({ theme: 'light' });
expect(writeAudit).toHaveBeenCalledWith(
expect.objectContaining({ userId: 1, action: 'admin.default_user_settings_update', details: { theme: 'light' } }),