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
@@ -12,12 +12,8 @@ import {
AdminPermissionsDto,
AdminInviteCreateDto,
AdminFeatureToggleDto,
AdminTemplateNameDto,
AdminOidcUpdateDto,
AdminAddonUpdateDto,
AdminCollabFeaturesDto,
AdminNotificationPreferencesDto,
AdminDefaultUserSettingsDto,
AdminTestNotificationDto,
AdminTransitProviderDto,
} from './admin.dto';
+4 -13
View File
@@ -5,13 +5,8 @@ import {
adminPermissionsRequestSchema,
adminInviteCreateRequestSchema,
adminFeatureToggleRequestSchema,
adminTemplateNameRequestSchema,
adminOidcUpdateRequestSchema,
adminAddonUpdateRequestSchema,
adminCollabFeaturesRequestSchema,
adminNotificationPreferencesRequestSchema,
notificationDefaultsUpdateRequestSchema,
adminDefaultUserSettingsRequestSchema,
adminTestNotificationRequestSchema,
adminTransitProviderRequestSchema,
} from '@trek/shared';
@@ -22,21 +17,17 @@ import {
* parameter typed with one of these classes by metatype — the Zod schemas in
* shared/ remain the single source of truth for the wire contract.
*
* Thirteen classes cover the AdminController body contracts:
* the four feature toggles share AdminFeatureToggleDto and the six
* packing-template create/update routes share AdminTemplateNameDto.
* These cover the AdminController body contracts; the four feature toggles
* share AdminFeatureToggleDto. The admin routes served by other domains
* (packing templates, OIDC, notification and user-setting defaults) keep their
* DTOs in those domains, so a domain controller never imports the admin domain.
*/
export class AdminUserCreateDto extends createZodDto(adminUserCreateRequestSchema) {}
export class AdminUserUpdateDto extends createZodDto(adminUserUpdateRequestSchema) {}
export class AdminPermissionsDto extends createZodDto(adminPermissionsRequestSchema) {}
export class AdminInviteCreateDto extends createZodDto(adminInviteCreateRequestSchema) {}
export class AdminFeatureToggleDto extends createZodDto(adminFeatureToggleRequestSchema) {}
export class AdminTemplateNameDto extends createZodDto(adminTemplateNameRequestSchema) {}
export class AdminOidcUpdateDto extends createZodDto(adminOidcUpdateRequestSchema) {}
export class AdminAddonUpdateDto extends createZodDto(adminAddonUpdateRequestSchema) {}
export class AdminCollabFeaturesDto extends createZodDto(adminCollabFeaturesRequestSchema) {}
export class AdminNotificationPreferencesDto extends createZodDto(adminNotificationPreferencesRequestSchema) {}
export class NotificationDefaultsUpdateDto extends createZodDto(notificationDefaultsUpdateRequestSchema) {}
export class AdminDefaultUserSettingsDto extends createZodDto(adminDefaultUserSettingsRequestSchema) {}
export class AdminTestNotificationDto extends createZodDto(adminTestNotificationRequestSchema) {}
export class AdminTransitProviderDto extends createZodDto(adminTransitProviderRequestSchema) {}