F4: remove obsolete survey execution controller
This commit is contained in:
@@ -1,61 +0,0 @@
|
||||
import {
|
||||
Body,
|
||||
Controller,
|
||||
Get,
|
||||
Param,
|
||||
ParseUUIDPipe,
|
||||
Post,
|
||||
Put,
|
||||
Req,
|
||||
} from '@nestjs/common';
|
||||
import { CurrentAuth } from '../auth/decorators/current-auth.decorator';
|
||||
import { RequirePermissions } from '../authorization/decorators/require-permissions.decorator';
|
||||
import type { AuthPrincipal, RequestWithContext } from '../common/http/request-context';
|
||||
import { ReviewSurveyReportDto } from './dto/review-survey-report.dto';
|
||||
import { SaveSurveyReportDto } from './dto/save-survey-report.dto';
|
||||
import { SurveyExecutionService } from './survey-execution.service';
|
||||
|
||||
@Controller('survey-campaign-targets/:targetId/report')
|
||||
export class SurveyExecutionController {
|
||||
constructor(private readonly execution: SurveyExecutionService) {}
|
||||
|
||||
@Get()
|
||||
@RequirePermissions('surveys.read_reports')
|
||||
get(
|
||||
@Param('targetId', new ParseUUIDPipe({ version: '4' })) targetId: string,
|
||||
) {
|
||||
return this.execution.get(targetId);
|
||||
}
|
||||
|
||||
@Put()
|
||||
@RequirePermissions('surveys.capture')
|
||||
save(
|
||||
@Param('targetId', new ParseUUIDPipe({ version: '4' })) targetId: string,
|
||||
@Body() dto: SaveSurveyReportDto,
|
||||
@CurrentAuth() principal: AuthPrincipal,
|
||||
@Req() request: RequestWithContext,
|
||||
) {
|
||||
return this.execution.save(targetId, dto, principal, request);
|
||||
}
|
||||
|
||||
@Post('submit')
|
||||
@RequirePermissions('surveys.capture')
|
||||
submit(
|
||||
@Param('targetId', new ParseUUIDPipe({ version: '4' })) targetId: string,
|
||||
@CurrentAuth() principal: AuthPrincipal,
|
||||
@Req() request: RequestWithContext,
|
||||
) {
|
||||
return this.execution.submit(targetId, principal, request);
|
||||
}
|
||||
|
||||
@Post('review')
|
||||
@RequirePermissions('surveys.review')
|
||||
review(
|
||||
@Param('targetId', new ParseUUIDPipe({ version: '4' })) targetId: string,
|
||||
@Body() dto: ReviewSurveyReportDto,
|
||||
@CurrentAuth() principal: AuthPrincipal,
|
||||
@Req() request: RequestWithContext,
|
||||
) {
|
||||
return this.execution.review(targetId, dto, principal, request);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user