This commit is contained in:
SepehrYahyaee
2026-06-03 12:05:19 +03:30
parent 077bae429e
commit 2c810afcb6
4 changed files with 121 additions and 25 deletions

View File

@@ -1,4 +1,17 @@
import { Body, Controller, Get, Header, Param, Headers, Patch, Post, Put, UseGuards, Query, Res } from "@nestjs/common";
import {
Body,
Controller,
Get,
Header,
Param,
Headers,
Patch,
Post,
Put,
UseGuards,
Query,
Res,
} from "@nestjs/common";
import {
ApiBearerAuth,
ApiBody,
@@ -19,7 +32,10 @@ import { ExpertFileAssignResultDto } from "src/common/dto/expert-file-assign-res
import { ExpertClaimService } from "./expert-claim.service";
import { ListQueryV2Dto } from "src/common/dto/list-query-v2.dto";
import { GetClaimListV2ResponseDto } from "./dto/claim-list-v2.dto";
import { ClaimSubmitResendV2Dto, 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";
import {
ClaimPriceDropContextV2Dto,
@@ -32,7 +48,7 @@ import { OuterPartCatalogItemDto } from "src/claim-request-management/dto/select
import { ClaimVehicleTypeV2 } from "src/static/outer-car-parts-catalog";
class InPersonVisitV2Dto {
@ApiPropertyOptional({ example: 'Paint damage requires physical inspection' })
@ApiPropertyOptional({ example: "Paint damage requires physical inspection" })
@IsOptional()
@IsString()
note?: string;
@@ -120,7 +136,10 @@ export class ExpertClaimV2Controller {
@Param("claimRequestId") claimRequestId: string,
@CurrentUser() actor,
) {
return await this.expertClaimService.getClaimDetailV2(claimRequestId, actor);
return await this.expertClaimService.getClaimDetailV2(
claimRequestId,
actor,
);
}
@Get("request/:claimRequestId/price-drop")
@@ -193,13 +212,17 @@ export class ExpertClaimV2Controller {
"1. **Damage review queue** — claim status `WAITING_FOR_DAMAGE_EXPERT`. Locking advances the claim to `status=EXPERT_REVIEWING`, `claimStatus=UNDER_REVIEW`, `workflow.currentStep=EXPERT_DAMAGE_ASSESSMENT`.\n" +
"2. **Factor validation queue** — claim status `EXPERT_VALIDATING_REPAIR_FACTORS` (or legacy `WAITING_FOR_INSURER_APPROVAL`) with `claimStatus=UNDER_REVIEW` and `workflow.currentStep=EXPERT_COST_EVALUATION`. Locking only sets the workflow lock fields; status/claimStatus/currentStep are left untouched so the claim stays in the factor-validation queue when the lock expires.\n\n" +
"Only one expert can hold the lock at a time. Re-locking by the same expert is idempotent. Same assignment logic as POST `assign/:claimRequestId`, but returns the legacy lock shape and maps conflicts to 400 instead of 409.",
deprecated: true,
})
@ApiParam({ name: "claimRequestId" })
async lockClaimRequestV2(
@Param("claimRequestId") claimRequestId: string,
@CurrentUser() actor,
) {
return await this.expertClaimService.lockClaimRequestV2(claimRequestId, actor);
return await this.expertClaimService.lockClaimRequestV2(
claimRequestId,
actor,
);
}
@Put("reply/submit/:claimRequestId")
@@ -221,7 +244,11 @@ export class ExpertClaimV2Controller {
@Body() body: SubmitExpertReplyV2Dto,
@CurrentUser() actor,
) {
return await this.expertClaimService.submitExpertReplyV2(claimRequestId, body, actor);
return await this.expertClaimService.submitExpertReplyV2(
claimRequestId,
body,
actor,
);
}
@Put("reply/resend/:claimRequestId")
@@ -239,7 +266,11 @@ export class ExpertClaimV2Controller {
@Body() body: ClaimSubmitResendV2Dto,
@CurrentUser() actor,
) {
return await this.expertClaimService.submitResendDocsV2(claimRequestId, body, actor);
return await this.expertClaimService.submitResendDocsV2(
claimRequestId,
body,
actor,
);
}
@Patch(":claimRequestId/visit")