feat: add access number routing and admin list improvements
This commit is contained in:
@@ -2,6 +2,7 @@ import { Body, Controller, Get, Param, Post, Query } from '@nestjs/common';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
import { SendChainService } from '../send-chain/send-chain.service';
|
||||
import {
|
||||
BatchReviewSmsTasksDto,
|
||||
CreateRiskRuleDto,
|
||||
ReviewSmsTaskDto,
|
||||
RiskReviewService,
|
||||
@@ -44,6 +45,16 @@ export class AdminRiskReviewController {
|
||||
return task;
|
||||
}
|
||||
|
||||
@Post('tasks/batch/reject')
|
||||
async rejectTasks(@Body() body: BatchReviewSmsTasksDto) {
|
||||
const tasks = await this.riskReview.rejectTasks(body);
|
||||
const reason = body.reason?.trim() ?? '';
|
||||
for (const task of tasks) {
|
||||
await this.sendChain.handleReviewDecision(task.id, 'rejected', reason);
|
||||
}
|
||||
return tasks;
|
||||
}
|
||||
|
||||
@Post('tasks/:id/reject')
|
||||
async rejectTask(@Param('id') taskId: string, @Body() body: ReviewSmsTaskDto) {
|
||||
const task = await this.riskReview.rejectTask(taskId, body);
|
||||
|
||||
Reference in New Issue
Block a user