feat: harden platform workflows and UI governance
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { Body, Controller, Get, Param, Post } from '@nestjs/common';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
import { CurrentSessionUserId } from '../auth/current-session-user.decorator';
|
||||
import { RequireRecentAuthentication } from '../auth/require-recent-authentication.decorator';
|
||||
import { ReviewDecisionDto, ReviewGovernanceService, ReviewTargetType } from './review-governance.service';
|
||||
|
||||
@ApiTags('review-governance')
|
||||
@Controller('admin/reviews')
|
||||
export class ReviewGovernanceController {
|
||||
constructor(private readonly reviews: ReviewGovernanceService) {}
|
||||
|
||||
@Get(':type/:id/preflight')
|
||||
preflight(@Param('type') type: ReviewTargetType, @Param('id') id: string) {
|
||||
return this.reviews.preflight(type, id);
|
||||
}
|
||||
|
||||
@Post(':type/:id/decision')
|
||||
@RequireRecentAuthentication()
|
||||
decide(
|
||||
@Param('type') type: ReviewTargetType,
|
||||
@Param('id') id: string,
|
||||
@Body() body: ReviewDecisionDto,
|
||||
@CurrentSessionUserId() reviewerId?: string,
|
||||
) {
|
||||
return this.reviews.decide(type, id, { ...body, reviewerId });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user