refactor(admin): the admin routes other domains serve keep their DTOs in those domains

NotificationsController, SettingsController, OidcController and the packing
template controller each imported their body DTO from admin/admin.dto.ts,
and AdminController imported the same four without using them. Those
imports tied the notifications, settings, packing and oidc domains to the
admin domain and through it to everything admin depends on. The classes
move unchanged (same names, same @trek/shared schemas) into each domain's
own dto file.
This commit is contained in:
Maurice
2026-10-10 12:20:13 +02:00
parent e40bc71e9f
commit 01fd4e3739
11 changed files with 27 additions and 65 deletions
@@ -3,8 +3,7 @@ import type { Request } from 'express';
import { MASKED_SETTING_VALUE } from '@trek/shared';
import type { User } from '../../types';
import { SettingsService, isAdminOnlyEndpointSetting } from './settings.service';
import { SettingUpsertDto, SettingsBulkDto } from './settings.dto';
import { AdminDefaultUserSettingsDto } from '../admin/admin.dto';
import { AdminDefaultUserSettingsDto, SettingUpsertDto, SettingsBulkDto } from './settings.dto';
import { JwtAuthGuard } from '../auth-core/jwt-auth.guard';
import { AdminGuard } from '../auth-core/admin.guard';
import { AuditService } from '../audit/audit.service';
+4 -1
View File
@@ -1,5 +1,5 @@
import { createZodDto } from 'nestjs-zod';
import { settingUpsertRequestSchema, settingsBulkRequestSchema } from '@trek/shared';
import { adminDefaultUserSettingsRequestSchema, settingUpsertRequestSchema, settingsBulkRequestSchema } from '@trek/shared';
/**
* Server-side createZodDto wrappers over the @trek/shared settings contracts.
@@ -9,3 +9,6 @@ import { settingUpsertRequestSchema, settingsBulkRequestSchema } from '@trek/sha
*/
export class SettingUpsertDto extends createZodDto(settingUpsertRequestSchema) {}
export class SettingsBulkDto extends createZodDto(settingsBulkRequestSchema) {}
/** The admin route for the instance-wide user-setting defaults. */
export class AdminDefaultUserSettingsDto extends createZodDto(adminDefaultUserSettingsRequestSchema) {}