mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-06 10:44:23 +00:00
refactor(server): provide MaintenanceRepository through DI
MaintenanceRepository was built with new over an injected EntityManager in the readiness probe and in UserCleanupService, outside the container. MaintenanceModule now provides it, as a factory over the same context-resolving EntityManager Nest injects everywhere, and both inject it. The class itself stays free of Nest decorators, like the rest of src/db, so tests keep building one over their own EntityManager. No behaviour changes: the probe still pings and the erasure still runs inside the account deletion's transaction.
This commit is contained in:
@@ -34,6 +34,7 @@ import { UserCleanupService } from './user-cleanup.service';
|
||||
import { WebauthnConfigService } from './webauthn-config.service';
|
||||
import { AppConfigModule } from '../app-config/app-config.module';
|
||||
import { BudgetModule } from '../budget/budget.module';
|
||||
import { MaintenanceModule } from '../database/maintenance.module';
|
||||
import { AuditModule } from '../audit/audit.module';
|
||||
import { MailerModule } from '../notifications/mailer/mailer.module';
|
||||
import { PermissionsModule } from '../permissions/permissions.module';
|
||||
@@ -84,6 +85,8 @@ import { AllowedFileTypesModule } from '../files/allowed-file-types.module';
|
||||
StorageModule,
|
||||
AllowedFileTypesModule,
|
||||
EphemeralTokenModule, RateLimitModule, AuditModule, PermissionsModule, TripMembershipModule, MailerModule, AppConfigModule, TokensModule, BudgetModule,
|
||||
// MaintenanceRepository: UserCleanupService's UC1 plugin-table erasure.
|
||||
MaintenanceModule,
|
||||
// AppSettings/Users: AuthService/UserProfileService each pass their own
|
||||
// AppSettingsRepository/UsersRepository to instance-api-keys.ts's
|
||||
// resolveApiKey/readInstanceApiKey/writeInstanceApiKey now (Plan 3a Task
|
||||
|
||||
Reference in New Issue
Block a user