forked from Yara724/api
update the expert claim dto
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { Body, Controller, Get, Param, Patch, Put, UseGuards } from "@nestjs/common";
|
||||
import { Body, Controller, Get, Header, Param, Headers, Patch, Put, UseGuards, Query, Res } from "@nestjs/common";
|
||||
import {
|
||||
ApiBearerAuth,
|
||||
ApiBody,
|
||||
ApiOperation,
|
||||
ApiParam,
|
||||
ApiPropertyOptional,
|
||||
ApiQuery,
|
||||
ApiTags,
|
||||
} from "@nestjs/swagger";
|
||||
import { IsOptional, IsString } from "class-validator";
|
||||
@@ -14,7 +15,7 @@ import { Roles } from "src/decorators/roles.decorator";
|
||||
import { CurrentUser } from "src/decorators/user.decorator";
|
||||
import { RoleEnum } from "src/Types&Enums/role.enum";
|
||||
import { ExpertClaimService } from "./expert-claim.service";
|
||||
import { SubmitExpertReplyV2Dto } from "./dto/expert-claim-v2.dto";
|
||||
import { ClaimSubmitResendV2Dto, SubmitExpertReplyV2Dto } from "./dto/expert-claim-v2.dto";
|
||||
import { UpdateClaimDamagedPartsV2Dto } from "./dto/update-claim-damaged-parts-v2.dto";
|
||||
|
||||
class InPersonVisitV2Dto {
|
||||
@@ -30,7 +31,7 @@ class InPersonVisitV2Dto {
|
||||
@UseGuards(LocalActorAuthGuard, RolesGuard)
|
||||
@Roles(RoleEnum.DAMAGE_EXPERT)
|
||||
export class ExpertClaimV2Controller {
|
||||
constructor(private readonly expertClaimService: ExpertClaimService) {}
|
||||
constructor(private readonly expertClaimService: ExpertClaimService) { }
|
||||
|
||||
@Get("requests")
|
||||
@ApiOperation({
|
||||
@@ -89,6 +90,22 @@ export class ExpertClaimV2Controller {
|
||||
return await this.expertClaimService.submitExpertReplyV2(claimRequestId, body, actor);
|
||||
}
|
||||
|
||||
@Put("reply/resend/:claimRequestId")
|
||||
@ApiOperation({
|
||||
summary: "Submit expert damage resend request. ",
|
||||
description:
|
||||
"Claim must be locked by this expert (status EXPERT_REVIEWING). Submitting unlocks the claim. If any part has factorNeeded=true the claim moves to EXPERT_COST_EVALUATION; otherwise moves to INSURER_REVIEW. Total payment cap is 30,000,000.",
|
||||
})
|
||||
@ApiParam({ name: "claimRequestId" })
|
||||
@ApiBody({ type: ClaimSubmitResendV2Dto })
|
||||
async submitExpertResendV2(
|
||||
@Param("claimRequestId") claimRequestId: string,
|
||||
@Body() body: ClaimSubmitResendV2Dto,
|
||||
@CurrentUser() actor,
|
||||
) {
|
||||
return await this.expertClaimService.submitResendDocsV2(claimRequestId, body, actor);
|
||||
}
|
||||
|
||||
@Patch(":claimRequestId/visit")
|
||||
@ApiOperation({
|
||||
summary: "Request in-person visit for claim",
|
||||
@@ -128,4 +145,21 @@ export class ExpertClaimV2Controller {
|
||||
actor,
|
||||
);
|
||||
}
|
||||
|
||||
@ApiQuery({
|
||||
name: "query",
|
||||
enum: ["car-capture", "accident"],
|
||||
required: true,
|
||||
})
|
||||
@Get("stream/:id/video")
|
||||
@Header("Accept-Ranges", "bytes")
|
||||
@Header("Content-Type", "video/mp4")
|
||||
async claimStream(
|
||||
@Headers() headers,
|
||||
@Param("id") id: string,
|
||||
@Query("query") query: "car-capture" | "accident",
|
||||
@Res() res,
|
||||
) {
|
||||
return this.expertClaimService.streamServiceV2(id, query, res, headers);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user