forked from Yara724/api
Fixed resend blame and claim sms start
This commit is contained in:
@@ -22,7 +22,10 @@ import {
|
||||
ApiParam,
|
||||
ApiTags,
|
||||
} from "@nestjs/swagger";
|
||||
import { FileFieldsInterceptor, FileInterceptor } from "@nestjs/platform-express";
|
||||
import {
|
||||
FileFieldsInterceptor,
|
||||
FileInterceptor,
|
||||
} from "@nestjs/platform-express";
|
||||
import { diskStorage } from "multer";
|
||||
import { Request } from "express";
|
||||
import { GlobalGuard } from "src/auth/guards/global.guard";
|
||||
@@ -59,7 +62,7 @@ export class RequestManagementV2Controller {
|
||||
constructor(
|
||||
private readonly requestManagementService: RequestManagementService,
|
||||
private readonly mediaPolicyService: MediaPolicyService,
|
||||
) { }
|
||||
) {}
|
||||
|
||||
@Post()
|
||||
@UseGuards(GlobalGuard)
|
||||
@@ -114,7 +117,11 @@ export class RequestManagementV2Controller {
|
||||
@Body() body: BlameConfessionDtoV2,
|
||||
@CurrentUser() user,
|
||||
) {
|
||||
return this.requestManagementService.blameConfessionV2(requestId, body, user);
|
||||
return this.requestManagementService.blameConfessionV2(
|
||||
requestId,
|
||||
body,
|
||||
user,
|
||||
);
|
||||
}
|
||||
|
||||
/** CAR_BODY only: submit accident type (car vs object). Call this when nextStep is CAR_BODY_ACCIDENT_TYPE. */
|
||||
@@ -127,7 +134,11 @@ export class RequestManagementV2Controller {
|
||||
@Body() body: CarBodyFormDto,
|
||||
@CurrentUser() user,
|
||||
) {
|
||||
return this.requestManagementService.carBodyAccidentTypeFormV2(requestId, body, user);
|
||||
return this.requestManagementService.carBodyAccidentTypeFormV2(
|
||||
requestId,
|
||||
body,
|
||||
user,
|
||||
);
|
||||
}
|
||||
|
||||
@ApiBody({
|
||||
@@ -195,7 +206,11 @@ export class RequestManagementV2Controller {
|
||||
@Body() body: LocationDto,
|
||||
@CurrentUser() user,
|
||||
) {
|
||||
return this.requestManagementService.addDetailLocationV2(requestId, body, user);
|
||||
return this.requestManagementService.addDetailLocationV2(
|
||||
requestId,
|
||||
body,
|
||||
user,
|
||||
);
|
||||
}
|
||||
|
||||
@ApiBody({
|
||||
@@ -269,7 +284,11 @@ export class RequestManagementV2Controller {
|
||||
@Body() body: DescriptionDto,
|
||||
@CurrentUser() user,
|
||||
) {
|
||||
return this.requestManagementService.addDescriptionV2(requestId, body, user);
|
||||
return this.requestManagementService.addDescriptionV2(
|
||||
requestId,
|
||||
body,
|
||||
user,
|
||||
);
|
||||
}
|
||||
|
||||
@Post("add-second-party/:phoneNumber/:requestId/:frontendRoute")
|
||||
@@ -355,9 +374,8 @@ export class RequestManagementV2Controller {
|
||||
await this.mediaPolicyService.assertForBlame(sign, requestId, "image");
|
||||
|
||||
// Convert string "true"/"false" to boolean
|
||||
const acceptDecision = typeof isAccept === "string"
|
||||
? isAccept === "true"
|
||||
: Boolean(isAccept);
|
||||
const acceptDecision =
|
||||
typeof isAccept === "string" ? isAccept === "true" : Boolean(isAccept);
|
||||
|
||||
return this.requestManagementService.userSignDecisionV2(
|
||||
requestId,
|
||||
@@ -405,17 +423,15 @@ export class RequestManagementV2Controller {
|
||||
format: "binary",
|
||||
description: "Voice recording file (if requested)",
|
||||
},
|
||||
video: {
|
||||
carPlate: {
|
||||
type: "string",
|
||||
format: "binary",
|
||||
description: "Video file (if requested)",
|
||||
description: "car plate",
|
||||
},
|
||||
chassisNumber: {
|
||||
type: "string",
|
||||
description: "chassis number شماره شاسی",
|
||||
},
|
||||
description: {
|
||||
type: "string",
|
||||
description:
|
||||
"Text description when expert requested ResendItemType.description",
|
||||
},
|
||||
textDescription: {
|
||||
type: "string",
|
||||
description:
|
||||
"Alias for `description` (same semantics); either field may be used.",
|
||||
@@ -431,7 +447,8 @@ export class RequestManagementV2Controller {
|
||||
{ name: "nationalCertificate", maxCount: 1 },
|
||||
{ name: "carGreenCard", maxCount: 1 },
|
||||
{ name: "voice", maxCount: 1 },
|
||||
{ name: "video", maxCount: 1 },
|
||||
{ name: "carPlate", maxCount: 1 },
|
||||
{ name: "chassisNumber", maxCount: 1 },
|
||||
],
|
||||
{
|
||||
storage: diskStorage({
|
||||
@@ -460,7 +477,8 @@ export class RequestManagementV2Controller {
|
||||
nationalCertificate?: Express.Multer.File[];
|
||||
carGreenCard?: Express.Multer.File[];
|
||||
voice?: Express.Multer.File[];
|
||||
video?: Express.Multer.File[];
|
||||
carPlate?: Express.Multer.File[];
|
||||
chassisNumber?: Express.Multer.File[];
|
||||
},
|
||||
@Body("description") description?: string,
|
||||
@Body("textDescription") textDescription?: string,
|
||||
@@ -474,7 +492,8 @@ export class RequestManagementV2Controller {
|
||||
nationalCertificate: "image",
|
||||
carGreenCard: "image",
|
||||
voice: "voice",
|
||||
video: "video",
|
||||
carPlate: "carPlate",
|
||||
chassisNumber: "chassisNumber",
|
||||
});
|
||||
|
||||
const descCandidates = [description, textDescription]
|
||||
@@ -490,4 +509,3 @@ export class RequestManagementV2Controller {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user