Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/admin/admin.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
HttpStatus,
} from '@nestjs/common';
import { Response } from 'express';
import { ApiTags, ApiOperation, ApiQuery } from '@nestjs/swagger';

Check warning on line 21 in src/admin/admin.controller.ts

View workflow job for this annotation

GitHub Actions / lint

'ApiQuery' is defined but never used

Check warning on line 21 in src/admin/admin.controller.ts

View workflow job for this annotation

GitHub Actions / lint

'ApiOperation' is defined but never used
import { CurrentUser } from '../auth/decorators/current-user.decorator';
import { Roles } from '../auth/decorators/roles.decorator';
import { JwtAuthGuard } from '../auth/guards/jwt-auth.guard';
Expand Down Expand Up @@ -55,17 +55,17 @@
) {}

@Get('dashboard')
getDashboard() {

Check warning on line 58 in src/admin/admin.controller.ts

View workflow job for this annotation

GitHub Actions / lint

Missing return type on function

Check warning on line 58 in src/admin/admin.controller.ts

View workflow job for this annotation

GitHub Actions / lint

Missing return type on function
return this.adminService.getDashboard();
}

@Get('backups')
listBackups() {

Check warning on line 63 in src/admin/admin.controller.ts

View workflow job for this annotation

GitHub Actions / lint

Missing return type on function

Check warning on line 63 in src/admin/admin.controller.ts

View workflow job for this annotation

GitHub Actions / lint

Missing return type on function
return this.adminService.listBackups();
}

@Get('backups/status')
getBackupStatus() {

Check warning on line 68 in src/admin/admin.controller.ts

View workflow job for this annotation

GitHub Actions / lint

Missing return type on function
return this.adminService.getBackupStatus();
}

Expand Down Expand Up @@ -163,21 +163,25 @@
return this.adminService.updateTransactionStatus(transactionId, payload, user.sub);
}

@ApiTags('Fraud')
@Get('fraud/alerts')
listFraudAlerts(@Query() query: FraudAlertsQueryDto) {
return this.adminService.listFraudAlerts(query);
}

@ApiTags('Fraud')
@Get('fraud/alerts/summary')
getFraudAlertsSummary() {
return this.adminService.getFraudAlertsSummary();
}

@ApiTags('Fraud')
@Get('fraud/alerts/:id')
getFraudAlertDetails(@Param('id') alertId: string) {
return this.adminService.getFraudAlertDetails(alertId);
}

@ApiTags('Fraud')
@Patch('fraud/alerts/:id')
reviewFraudAlert(
@Param('id') alertId: string,
Expand All @@ -187,6 +191,7 @@
return this.adminService.reviewFraudAlert(alertId, payload, user.sub);
}

@ApiTags('Fraud')
@Post('fraud/alerts/:id/notes')
addFraudAlertNote(
@Param('id') alertId: string,
Expand All @@ -196,6 +201,7 @@
return this.adminService.addFraudAlertNote(alertId, payload, user.sub);
}

@ApiTags('Fraud')
@Post('fraud/alerts/:id/block-user')
blockFraudUser(
@Param('id') alertId: string,
Expand All @@ -205,11 +211,13 @@
return this.adminService.blockFraudUser(alertId, user.sub, payload);
}

@ApiTags('Fraud')
@Post('fraud/users/:id/scan')
scanUserForFraud(@Param('id') userId: string, @CurrentUser() user: AuthUserPayload) {
return this.adminService.scanUserForFraud(userId, user.sub);
}

@ApiTags('Fraud')
@Post('fraud/properties/:id/scan')
scanPropertyForFraud(@Param('id') propertyId: string, @CurrentUser() user: AuthUserPayload) {
return this.adminService.scanPropertyForFraud(propertyId, user.sub);
Expand Down
6 changes: 6 additions & 0 deletions src/config/swagger.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ export function setupSwagger(app: INestApplication): void {
.addTag('Trust Score', 'Trust score calculation and management')
.addTag('Email', 'Email verification endpoints')
.addTag('Versioning', 'API versioning information')
.addTag('Admin', 'Administrative endpoints — admin role only (role-restricted)')
.addTag(
'Fraud',
'Fraud detection and investigation endpoints — admin role only (role-restricted). ' +
'Currently routed through the Admin module; a future change may extract these into a dedicated controller.',
)
.build();

const document = SwaggerModule.createDocument(app, config);
Expand Down
Loading