forked from Yara724/api
Fixed v2 flow
This commit is contained in:
@@ -6637,11 +6637,11 @@ export class RequestManagementService {
|
||||
);
|
||||
}
|
||||
await this.verifyExpertAccessForBlameV2(req, expert);
|
||||
// if (req.status !== CaseStatus.WAITING_FOR_SIGNATURES) {
|
||||
// throw new BadRequestException(
|
||||
// "Request is not waiting for signatures. Current status: " + req.status,
|
||||
// );
|
||||
// }
|
||||
if (req.status !== CaseStatus.WAITING_FOR_SIGNATURES) {
|
||||
throw new BadRequestException(
|
||||
"Request is not waiting for signatures. Current status: " + req.status,
|
||||
);
|
||||
}
|
||||
const partyIndex = this.getPartyIndex(req, partyRole);
|
||||
if (partyIndex === -1) {
|
||||
throw new BadRequestException(
|
||||
@@ -6753,6 +6753,19 @@ export class RequestManagementService {
|
||||
);
|
||||
}
|
||||
await this.verifyExpertAccessForBlameV2(req, expert);
|
||||
// In the V2 IN_PERSON mirror flow guilt is resolved automatically during
|
||||
// addDescriptionV2 — accident-fields must only be called once the file has
|
||||
// reached WAITING_FOR_SIGNATURES (both parties' narrative steps are done).
|
||||
// Calling it earlier would overwrite the workflow and skip the sign step.
|
||||
if (
|
||||
req.creationMethod === CreationMethod.IN_PERSON &&
|
||||
req.status !== CaseStatus.WAITING_FOR_SIGNATURES &&
|
||||
req.status !== CaseStatus.COMPLETED
|
||||
) {
|
||||
throw new BadRequestException(
|
||||
`accident-fields can only be submitted after both parties have completed their narrative steps (current status: ${req.status}). Make sure both parties have gone through location, voice, and description before calling this endpoint.`,
|
||||
);
|
||||
}
|
||||
|
||||
if (!req.expert) req.expert = {} as any;
|
||||
if (!req.expert.decision) req.expert.decision = {} as any;
|
||||
|
||||
Reference in New Issue
Block a user