feat: add risk review phase
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
import { Body, Controller, Get, Param, Post, Query } from '@nestjs/common';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
import {
|
||||
CreateRiskRuleDto,
|
||||
ReviewSmsTaskDto,
|
||||
RiskReviewService,
|
||||
} from './risk-review.service';
|
||||
|
||||
@ApiTags('risk-review')
|
||||
@Controller('admin/risk-review')
|
||||
export class AdminRiskReviewController {
|
||||
constructor(private readonly riskReview: RiskReviewService) {}
|
||||
|
||||
@Get('rules')
|
||||
listRules(@Query('tenantId') tenantId?: string) {
|
||||
return this.riskReview.listRules(tenantId);
|
||||
}
|
||||
|
||||
@Post('rules')
|
||||
createRule(@Body() body: CreateRiskRuleDto) {
|
||||
return this.riskReview.createRule(body);
|
||||
}
|
||||
|
||||
@Get('hits')
|
||||
listHits(@Query('tenantId') tenantId?: string, @Query('taskId') taskId?: string) {
|
||||
return this.riskReview.listHits(tenantId, taskId);
|
||||
}
|
||||
|
||||
@Get('tasks')
|
||||
listTasks(@Query('tenantId') tenantId?: string, @Query('status') status?: string) {
|
||||
return this.riskReview.listTasks(tenantId, status);
|
||||
}
|
||||
|
||||
@Get('tasks/pending')
|
||||
listPendingTasks() {
|
||||
return this.riskReview.listPendingTasks();
|
||||
}
|
||||
|
||||
@Post('tasks/:id/approve')
|
||||
approveTask(@Param('id') taskId: string, @Body() body: ReviewSmsTaskDto) {
|
||||
return this.riskReview.approveTask(taskId, body);
|
||||
}
|
||||
|
||||
@Post('tasks/:id/reject')
|
||||
rejectTask(@Param('id') taskId: string, @Body() body: ReviewSmsTaskDto) {
|
||||
return this.riskReview.rejectTask(taskId, body);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user