Added v3 of field-expert

This commit is contained in:
SepehrYahyaee
2026-06-22 13:05:11 +03:30
parent 89e715b0c9
commit 8f29bb564c
15 changed files with 2988 additions and 622 deletions

View File

@@ -19,6 +19,7 @@ import {
ApiProduces,
ApiTags,
ApiOperation,
ApiExcludeController,
} from "@nestjs/swagger";
import { Response, Request } from "express";
import { LocalActorAuthGuard } from "src/auth/guards/actor-local.guard";
@@ -35,7 +36,8 @@ import {
} from "./dto/reply.dto";
import { ExpertBlameService } from "./expert-blame.service";
@ApiTags("expert-blame-panel")
@ApiExcludeController()
// @ApiTags("expert-blame-panel")
@Controller("expert-blame")
@ApiBearerAuth()
@UseGuards(LocalActorAuthGuard, RolesGuard)
@@ -45,35 +47,35 @@ export class ExpertBlameController {
// TODO role guard for expert fix
@Roles(RoleEnum.EXPERT)
@ApiOperation({ deprecated: true })
// @ApiOperation({ deprecated: true })
@Get()
async findAll(@CurrentUser() actor, @ClientKey() client) {
return await this.expertBlameService.findAll(actor);
}
@Roles(RoleEnum.EXPERT)
@ApiOperation({ deprecated: true })
// @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 })
// @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 })
// @ApiOperation({ deprecated: true })
@Get("request/accident-fields")
async getAccidentFields() {
return await this.expertBlameService.getAccidentField();
}
@Roles(RoleEnum.EXPERT)
@ApiOperation({ deprecated: true })
// @ApiOperation({ deprecated: true })
@Put("reply/submit/:id")
@ApiBody({ type: SubmitReplyDto })
@ApiParam({ name: "id" })
@@ -100,10 +102,10 @@ export class ExpertBlameController {
}
@Roles(RoleEnum.EXPERT)
@ApiOperation({ deprecated: true })
// @ApiOperation({ deprecated: true })
@Put("reply/resend/first/:id")
@ApiBody({ type: ResendFirstPartyDto })
@ApiParam({ name: "id" })
// @ApiBody({ type: ResendFirstPartyDto })
// @ApiParam({ name: "id" })
async resendFirstParty(
@Param("id") id: string,
@Body() body: SendAginIF,
@@ -113,11 +115,11 @@ export class ExpertBlameController {
return this.handleResendRequest(id, body, actor.sub, req);
}
@Roles(RoleEnum.EXPERT)
@ApiOperation({ deprecated: true })
// @ApiOperation({ deprecated: true })
@Put("reply/resend/second/:id")
@Roles(RoleEnum.EXPERT)
@ApiBody({ type: ResendSecondPartyDto })
@ApiParam({ name: "id" })
// @ApiBody({ type: ResendSecondPartyDto })
// @ApiParam({ name: "id" })
async resendSecondParty(
@Param("id") id: string,
@Body() body: SendAginIF,
@@ -127,25 +129,25 @@ export class ExpertBlameController {
return this.handleResendRequest(id, body, actor.sub, req);
}
@Roles(RoleEnum.EXPERT)
@ApiOperation({ deprecated: true })
// @ApiOperation({ deprecated: true })
@Get("stream/:requestId")
@ApiParam({ name: "requestId" })
async streamVideo(@Param("requestId") requestId: string) {
return this.expertBlameService.streamVideo(requestId);
}
@ApiOperation({ deprecated: true })
// @ApiOperation({ deprecated: true })
@Get("voice/:requestId/:voiceId")
@Roles(RoleEnum.EXPERT, RoleEnum.DAMAGE_EXPERT)
@ApiParam({ name: "requestId" })
@ApiParam({ name: "voiceId" })
@ApiOkResponse({
schema: {
type: "string",
format: "binary",
},
})
@ApiProduces("mp3")
// @ApiParam({ name: "requestId" })
// @ApiParam({ name: "voiceId" })
// @ApiOkResponse({
// schema: {
// type: "string",
// format: "binary",
// },
// })
// @ApiProduces("mp3")
async downloadVoice(
@Param("voiceId") voiceId,
@Param("requestId") requestId: string,
@@ -156,8 +158,8 @@ export class ExpertBlameController {
return await this.expertBlameService.streamVoice(requestId, voiceId);
}
@ApiParam({ name: "id" })
@ApiOperation({ deprecated: true })
// @ApiParam({ name: "id" })
// @ApiOperation({ deprecated: true })
@Patch(":id/visit")
async inPersonVisit(@Param("id") requestId: string, @CurrentUser() actor) {
return await this.expertBlameService.inPersonVisit(requestId, actor);