This commit is contained in:
SepehrYahyaee
2026-04-15 11:43:19 +03:30
parent 0e2789c209
commit f8fbbb7ac6
5 changed files with 131 additions and 55 deletions

View File

@@ -27,14 +27,14 @@ import { Roles } from "src/decorators/roles.decorator";
import { RoleEnum } from "src/Types&Enums/role.enum";
import { RequestManagementService } from "./request-management.service";
import { CreateExpertInitiatedFileDto } from "./dto/expert-initiated.dto";
import { ExpertCompleteThirdPartyFormDto } from "./dto/expert-complete-third-party-form.dto";
import { ExpertCompleteCarBodyFormDto } from "./dto/expert-complete-car-body-form.dto";
import { ExpertCompleteThirdPartyFormV2Dto } from "./dto/expert-complete-third-party-form.v2.dto";
import { ExpertCompleteCarBodyFormV2Dto } from "./dto/expert-complete-car-body-form.v2.dto";
import { ExpertAccidentFieldsDto } from "./dto/expert-accident-fields.dto";
import { ExpertCompleteClaimDataDto } from "./dto/expert-complete-claim-data.dto";
import { ExpertUploadPartySignatureDto } from "./dto/expert-upload-party-signature.dto";
import { VerifyPartyOtpsDto } from "./dto/verify-party-otps.dto";
import { SendPartyOtpsDto } from "./dto/send-party-otps.dto";
import { ExpertCompleteLocationsDto } from "./dto/expert-complete-locations.dto";
import { ExpertCompleteLocationV2Dto } from "./dto/expert-complete-location.v2.dto";
import { ClaimRequestManagementService } from "src/claim-request-management/claim-request-management.service";
import { PartyRole } from "./entities/schema/partyRole.enum";
@@ -225,11 +225,11 @@ export class ExpertInitiatedV2Controller {
@ApiOperation({
summary: "[V2] Submit all blame data (IN_PERSON)",
description:
"For IN_PERSON files only. Send THIRD_PARTY or CAR_BODY form EXCEPT locations. After this, call add-locations to submit lat/lon and move workflow to WAITING_FOR_SIGNATURES.",
"For IN_PERSON files only. Send THIRD_PARTY or CAR_BODY form EXCEPT location. Use one shared expertDescription (not per-party descriptions). After this, call add-locations once to submit scene lat/lon and move workflow to WAITING_FOR_SIGNATURES.",
})
@ApiParam({ name: "requestId", description: "Blame request ID" })
@ApiBody({
description: "Choose THIRD_PARTY or CAR_BODY example according to the file type. All nested fields are listed so you can fill or test without guessing property names.",
description: "Choose THIRD_PARTY or CAR_BODY example according to the file type. IN_PERSON v2 uses one shared expertDescription for the scene.",
examples: {
THIRD_PARTY: {
summary: "THIRD_PARTY",
@@ -253,7 +253,7 @@ export class ExpertInitiatedV2Controller {
insurerBirthday: 13770624,
driverBirthday: "1370-01-01",
},
firstPartyDescription: { desc: "توضیح حادثه طرف اول" },
expertDescription: { desc: "توضیح حادثه کارشناس (مشترک برای صحنه)" },
secondParty: {
phoneNumber: "09187654321",
initialForm: {
@@ -273,7 +273,6 @@ export class ExpertInitiatedV2Controller {
insurerBirthday: 13700720,
driverBirthday: "1370-01-01",
},
description: { desc: "توضیح حادثه طرف دوم" },
},
guiltyPartyPhoneNumber: "09123456789",
},
@@ -302,7 +301,7 @@ export class ExpertInitiatedV2Controller {
insurerBirthday: 1370,
driverBirthday: "1370-01-01",
},
firstPartyDescription: {
expertDescription: {
desc: "توضیح حادثه",
accidentDate: "2025-01-15",
accidentTime: "14:30",
@@ -319,7 +318,7 @@ export class ExpertInitiatedV2Controller {
async completeBlameDataV2(
@CurrentUser() expert: any,
@Param("requestId") requestId: string,
@Body() formData: any,
@Body() formData: ExpertCompleteThirdPartyFormV2Dto | ExpertCompleteCarBodyFormV2Dto,
) {
return this.requestManagementService.expertCompleteBlameDataV2(
expert,
@@ -330,25 +329,18 @@ export class ExpertInitiatedV2Controller {
@Post("add-locations/:requestId")
@ApiOperation({
summary: "[V2] Submit location(s) for expert-initiated IN_PERSON blame",
summary: "[V2] Submit one scene location for expert-initiated IN_PERSON blame",
description:
"Submit first party (and second party for THIRD_PARTY) location after complete-blame-data. This transitions workflow to WAITING_FOR_SIGNATURES.",
"Submit one scene location after complete-blame-data. This transitions workflow to WAITING_FOR_SIGNATURES.",
})
@ApiParam({ name: "requestId", description: "Blame request ID" })
@ApiBody({
type: ExpertCompleteLocationsDto,
type: ExpertCompleteLocationV2Dto,
examples: {
THIRD_PARTY: {
summary: "THIRD_PARTY locations",
scene: {
summary: "One scene location (all IN_PERSON types)",
value: {
firstPartyLocation: { lat: 35.6892, lon: 51.389 },
secondPartyLocation: { lat: 35.7001, lon: 51.4102 },
},
},
CAR_BODY: {
summary: "CAR_BODY location",
value: {
firstPartyLocation: { lat: 35.6892, lon: 51.389 },
location: { lat: 35.6892, lon: 51.389 },
},
},
},
@@ -357,12 +349,12 @@ export class ExpertInitiatedV2Controller {
async addLocationsV2(
@CurrentUser() expert: any,
@Param("requestId") requestId: string,
@Body() dto: ExpertCompleteLocationsDto,
@Body() dto: ExpertCompleteLocationV2Dto,
) {
return this.requestManagementService.expertAddLocationsForBlameV2(
expert,
requestId,
dto,
dto as any,
);
}