feat: Complete stub services with real implementations and graceful not-configured responses
All checks were successful
Test Asgard Runner / test (push) Successful in 2s
All checks were successful
Test Asgard Runner / test (push) Successful in 2s
- ChangelogService: inject PlatformChangelog repo, query with findAndCount(skip/take), return actual data
- ChangelogModule: add TypeOrmModule.forFeature([PlatformChangelog])
- MapsService: add uploadMap() — SHA-256 checksum, storage path, full entity save
- MapsController: add POST /maps/upload with FileInterceptor, map.manage permission, @UploadedFile
- AuthService: replace console.log stubs with Logger; forgotPassword returns 200 with clear message; resetPassword throws NotImplementedException
- PluginsService: searchUmod returns { results: [], message: 'not yet configured' } instead of bare []
- SteamService: add Logger.warn on every stub path (checkForceWipe, getPlayerSummary)
- SettingsService: add Logger; both Cloudflare DNS stubs emit Logger.warn before DB save
- MigrationService: add Logger; exportConfig logs warning + returns note field; importConfig throws NotImplementedException
- Install @types/multer dev dependency for Express.Multer.File type support
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,16 +1,22 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, NotImplementedException, Logger } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { MigrationExport } from '../../entities/migration-export.entity';
|
||||
|
||||
@Injectable()
|
||||
export class MigrationService {
|
||||
private readonly logger = new Logger(MigrationService.name);
|
||||
|
||||
constructor(
|
||||
@InjectRepository(MigrationExport)
|
||||
private readonly exportRepo: Repository<MigrationExport>,
|
||||
) {}
|
||||
|
||||
async exportConfig(licenseId: string, userId: string, exportType: string = 'full'): Promise<MigrationExport> {
|
||||
async exportConfig(licenseId: string, userId: string, exportType: string = 'full'): Promise<MigrationExport & { note: string }> {
|
||||
this.logger.warn(
|
||||
`Export requested for license ${licenseId} by user ${userId} — file generation not yet implemented, DB record only`,
|
||||
);
|
||||
|
||||
const expiresAt = new Date();
|
||||
expiresAt.setDate(expiresAt.getDate() + 7); // 7 days expiry
|
||||
|
||||
@@ -18,12 +24,17 @@ export class MigrationService {
|
||||
license_id: licenseId,
|
||||
export_type: exportType,
|
||||
storage_path: `/exports/${licenseId}/${Date.now()}.json`,
|
||||
file_size_bytes: 0, // Stub - would calculate after actual export
|
||||
file_size_bytes: 0,
|
||||
created_by: userId,
|
||||
expires_at: expiresAt,
|
||||
});
|
||||
|
||||
return this.exportRepo.save(exportRecord);
|
||||
const saved = await this.exportRepo.save(exportRecord);
|
||||
|
||||
return {
|
||||
...saved,
|
||||
note: 'Export record created. File generation is pending implementation.',
|
||||
};
|
||||
}
|
||||
|
||||
async getExports(licenseId: string): Promise<MigrationExport[]> {
|
||||
@@ -33,8 +44,8 @@ export class MigrationService {
|
||||
});
|
||||
}
|
||||
|
||||
async importConfig(licenseId: string, data: any): Promise<{ message: string }> {
|
||||
// Stub implementation - would validate and import data in production
|
||||
return { message: 'Import complete' };
|
||||
async importConfig(licenseId: string, _data: any): Promise<never> {
|
||||
this.logger.warn(`Import attempted for license ${licenseId} — not yet implemented`);
|
||||
throw new NotImplementedException('Migration import not yet available');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user