7958d2fa72
Add a read-only User Detail dashboard for super admins, reachable by clicking a user name in the admin users list. Backend: new `admin` module aggregating existing domain services (no new entities). ADMIN-only endpoints under /api/v1/admin: overview (profile, account status, wallet balance, revenue, summary counts), wallet transactions, applications (incl. deleted/docked with restore eligibility), build/deploy errors, tickets with conversation, and a composite activity timeline. Adds BillingService.getRevenueSummary and guards against a wallet get-or-create race in the overview reads. Frontend: tabbed detail page (overview/applications/activity/errors/ tickets) with lazy per-tab queries; user names in the admin list link to it (admin only); fa/en i18n keys and response types. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
74 lines
2.5 KiB
TypeScript
74 lines
2.5 KiB
TypeScript
import { Module } from '@nestjs/common';
|
|
import { ConfigModule, ConfigService } from '@nestjs/config';
|
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
|
import { BullModule } from '@nestjs/bull';
|
|
import { AuthModule } from './auth/auth.module';
|
|
import { UsersModule } from './users/users.module';
|
|
import { ApplicationsModule } from './applications/applications.module';
|
|
import { DeploymentsModule } from './deployments/deployments.module';
|
|
import { ClustersModule } from './clusters/clusters.module';
|
|
import { KubernetesModule } from './kubernetes/kubernetes.module';
|
|
import { BuildModule } from './build/build.module';
|
|
import { TicketsModule } from './tickets/tickets.module';
|
|
import { BillingModule } from './billing/billing.module';
|
|
import { SnapshotsModule } from './snapshots/snapshots.module';
|
|
import { LifecycleModule } from './lifecycle/lifecycle.module';
|
|
import { ApplicationMigrationsModule } from './application-migrations/application-migrations.module';
|
|
import { AdminModule } from './admin/admin.module';
|
|
import configuration from './config/configuration';
|
|
|
|
@Module({
|
|
imports: [
|
|
// Configuration
|
|
ConfigModule.forRoot({
|
|
isGlobal: true,
|
|
load: [configuration],
|
|
}),
|
|
|
|
// Database
|
|
TypeOrmModule.forRootAsync({
|
|
imports: [ConfigModule],
|
|
useFactory: (configService: ConfigService) => ({
|
|
type: 'postgres',
|
|
host: configService.get('database.host'),
|
|
port: configService.get('database.port'),
|
|
username: configService.get('database.username'),
|
|
password: configService.get('database.password'),
|
|
database: configService.get('database.name'),
|
|
entities: [__dirname + '/**/*.entity{.ts,.js}'],
|
|
synchronize: configService.get('nodeEnv') === 'development',
|
|
logging: configService.get('nodeEnv') === 'development' ? ['error', 'warn'] : false,
|
|
}),
|
|
inject: [ConfigService],
|
|
}),
|
|
|
|
// Redis / Bull Queue
|
|
BullModule.forRootAsync({
|
|
imports: [ConfigModule],
|
|
useFactory: (configService: ConfigService) => ({
|
|
redis: {
|
|
host: configService.get('redis.host'),
|
|
port: configService.get('redis.port'),
|
|
},
|
|
}),
|
|
inject: [ConfigService],
|
|
}),
|
|
|
|
// Feature modules
|
|
AuthModule,
|
|
UsersModule,
|
|
ApplicationsModule,
|
|
DeploymentsModule,
|
|
ClustersModule,
|
|
KubernetesModule,
|
|
BuildModule,
|
|
TicketsModule,
|
|
BillingModule,
|
|
SnapshotsModule,
|
|
LifecycleModule,
|
|
ApplicationMigrationsModule,
|
|
AdminModule,
|
|
],
|
|
})
|
|
export class AppModule {}
|