forked from Yara724/api
Rollback uploadDocument step resume
This commit is contained in:
@@ -121,6 +121,14 @@ export class SubmitExpertReplyV2Dto {
|
||||
@IsString()
|
||||
description?: string;
|
||||
|
||||
@ApiPropertyOptional({
|
||||
example: '1_000_000_000',
|
||||
description: "Today's car price",
|
||||
})
|
||||
@IsOptional()
|
||||
@IsMoneyAmountString()
|
||||
carPrice?: string;
|
||||
|
||||
@ApiProperty({
|
||||
type: [PartPricingV2Dto],
|
||||
description:
|
||||
|
||||
@@ -3263,6 +3263,7 @@ export class ExpertClaimService {
|
||||
) {
|
||||
if (actor.role !== RoleEnum.FIELD_EXPERT) requireActorClientKey(actor);
|
||||
const claim = await this.claimCaseDbService.findById(claimRequestId);
|
||||
const blame = await this.blameRequestDbService.findById(claim.blameRequestId);
|
||||
|
||||
if (!claim) {
|
||||
throw new NotFoundException(
|
||||
@@ -3303,6 +3304,14 @@ export class ExpertClaimService {
|
||||
);
|
||||
}
|
||||
|
||||
if (reply.carPrice && blame.type !== BlameRequestType.CAR_BODY) {
|
||||
throw new ForbiddenException("قیمت روز خودرو فقط در پرونده های بدنه باید بررسی شود")
|
||||
}
|
||||
|
||||
if (blame.type === BlameRequestType.THIRD_PARTY && reply.carPrice) {
|
||||
throw new ForbiddenException("قیمت روز خودرو فقط در پرونده های بدنه باید بررسی شود")
|
||||
}
|
||||
|
||||
const pricingValidationError = getExpertReplyPricingValidationError(
|
||||
reply.parts,
|
||||
{ locale: "fa", enforceAmountBounds: true },
|
||||
@@ -3531,6 +3540,7 @@ export class ExpertClaimService {
|
||||
"evaluation.ownerInsurerApproval": "",
|
||||
"evaluation.ownerPricedPartsApproval": "",
|
||||
},
|
||||
"vehicle.price": reply.carPrice,
|
||||
"workflow.currentStep": currentStep,
|
||||
"workflow.nextStep": nextWorkflowStep,
|
||||
[`evaluation.${replyField}`]: replyPayload,
|
||||
|
||||
Reference in New Issue
Block a user