forked from Yara724/api
Removed the guard of accidentWay
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
import { extname } from "node:path";
|
import { extname } from "node:path";
|
||||||
import {
|
import {
|
||||||
BadRequestException,
|
|
||||||
Body,
|
Body,
|
||||||
Controller,
|
Controller,
|
||||||
Param,
|
Param,
|
||||||
@@ -362,20 +361,6 @@ export class ExpertInitiatedBlameMirrorController {
|
|||||||
@CurrentUser() expert: any,
|
@CurrentUser() expert: any,
|
||||||
@UploadedFile() sign: Express.Multer.File,
|
@UploadedFile() sign: Express.Multer.File,
|
||||||
) {
|
) {
|
||||||
// Guard: accident fields (accidentWay, etc.) must be filled before signing.
|
|
||||||
// This prevents the expert from bypassing add-accident-fields and avoids the
|
|
||||||
// double-sign bug where add-accident-fields re-enters WAITING_FOR_SIGNATURES
|
|
||||||
// after a signature was already recorded.
|
|
||||||
const requestData = await this.requestManagementService.getBlameRequestV2(
|
|
||||||
requestId,
|
|
||||||
expert,
|
|
||||||
);
|
|
||||||
if (!(requestData?.expert?.decision as any)?.fields?.accidentWay) {
|
|
||||||
throw new BadRequestException(
|
|
||||||
"Accident fields (accidentWay, accidentReason, accidentType) must be submitted via add-accident-fields before signing.",
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
await this.mediaPolicyService.assertForBlame(sign, requestId, "image");
|
await this.mediaPolicyService.assertForBlame(sign, requestId, "image");
|
||||||
const partyRole =
|
const partyRole =
|
||||||
body?.partyRole === "SECOND" ? PartyRole.SECOND : PartyRole.FIRST;
|
body?.partyRole === "SECOND" ? PartyRole.SECOND : PartyRole.FIRST;
|
||||||
|
|||||||
Reference in New Issue
Block a user