Added GET car-other-parts in v2 as well; deprecated old endpoints and reordered swagger documents

This commit is contained in:
SepehrYahyaee
2026-04-28 10:01:45 +03:30
parent 8caf13cf18
commit bcedd8c6f3
7 changed files with 104 additions and 7 deletions

View File

@@ -18,6 +18,7 @@ import {
ApiParam,
ApiProduces,
ApiTags,
ApiOperation,
} from "@nestjs/swagger";
import { Response, Request } from "express";
import { LocalActorAuthGuard } from "src/auth/guards/actor-local.guard";
@@ -45,30 +46,35 @@ export class ExpertBlameController {
// TODO role guard for expert fix
@Roles(RoleEnum.EXPERT)
@ApiOperation({ deprecated: true })
@Get()
async findAll(@CurrentUser() actor, @ClientKey() client) {
return await this.expertBlameService.findAll(actor);
}
@Roles(RoleEnum.EXPERT)
@ApiOperation({ deprecated: true })
@Get(":id")
async findOne(@Param("id") id: string, @CurrentUser() actor) {
return await this.expertBlameService.findOne(id, actor.sub);
}
@Roles(RoleEnum.EXPERT)
@ApiOperation({ deprecated: true })
@Put("lock/:id")
async lockRequest(@Param("id") id: string, @CurrentUser() actor) {
return await this.expertBlameService.lockRequest(id, actor);
}
@Roles(RoleEnum.EXPERT)
@ApiOperation({ deprecated: true })
@Get("request/accident-fields")
async getAccidentFields() {
return await this.expertBlameService.getAccidentField();
}
@Roles(RoleEnum.EXPERT)
@ApiOperation({ deprecated: true })
@Put("reply/submit/:id")
@ApiBody({ type: SubmitReplyDto })
@ApiParam({ name: "id" })
@@ -95,6 +101,7 @@ export class ExpertBlameController {
}
@Roles(RoleEnum.EXPERT)
@ApiOperation({ deprecated: true })
@Put("reply/resend/first/:id")
@ApiBody({ type: ResendFirstPartyDto })
@ApiParam({ name: "id" })
@@ -107,6 +114,7 @@ export class ExpertBlameController {
return this.handleResendRequest(id, body, actor.sub, req);
}
@Roles(RoleEnum.EXPERT)
@ApiOperation({ deprecated: true })
@Put("reply/resend/second/:id")
@Roles(RoleEnum.EXPERT)
@ApiBody({ type: ResendSecondPartyDto })
@@ -120,6 +128,7 @@ export class ExpertBlameController {
return this.handleResendRequest(id, body, actor.sub, req);
}
@Roles(RoleEnum.EXPERT)
@ApiOperation({ deprecated: true })
@Get("stream/:requestId")
@ApiParam({ name: "requestId" })
async streamVideo(@Param("requestId") requestId: string) {
@@ -127,6 +136,7 @@ export class ExpertBlameController {
}
@UseInterceptors(LoggingInterceptor)
@ApiOperation({ deprecated: true })
@Get("voice/:requestId/:voiceId")
@Roles(RoleEnum.EXPERT, RoleEnum.DAMAGE_EXPERT)
@ApiParam({ name: "requestId" })
@@ -149,6 +159,7 @@ export class ExpertBlameController {
}
@ApiParam({ name: "id" })
@ApiOperation({ deprecated: true })
@Patch(":id/visit")
async inPersonVisit(@Param("id") requestId: string, @CurrentUser() actor) {
return await this.expertBlameService.inPersonVisit(requestId, actor);