forked from Yara724/api
YARA-832
This commit is contained in:
@@ -28,6 +28,7 @@ export class ClaimDetailV2ResponseDto {
|
||||
actorId: string;
|
||||
actorName: string;
|
||||
lockedAt: string;
|
||||
expiredAt?: string;
|
||||
};
|
||||
|
||||
@ApiPropertyOptional()
|
||||
|
||||
@@ -2104,12 +2104,15 @@ export class ExpertClaimService {
|
||||
}
|
||||
|
||||
const lockSnapshot = await this.snapshotDamageExpert(actor.sub);
|
||||
const lockAt = new Date();
|
||||
const expiredAt = new Date(lockAt.getTime() + this.claimV2WorkflowLockTtlMs);
|
||||
|
||||
await this.claimCaseDbService.findByIdAndUpdate(claimRequestId, {
|
||||
status: ClaimCaseStatus.EXPERT_REVIEWING,
|
||||
claimStatus: ClaimStatus.UNDER_REVIEW,
|
||||
'workflow.locked': true,
|
||||
'workflow.lockedAt': new Date(),
|
||||
'workflow.lockedAt': lockAt,
|
||||
'workflow.expiredAt': expiredAt,
|
||||
'workflow.lockedBy': {
|
||||
actorId: new Types.ObjectId(actor.sub),
|
||||
actorName: actor.fullName,
|
||||
@@ -2206,6 +2209,7 @@ export class ExpertClaimService {
|
||||
},
|
||||
$unset: {
|
||||
"workflow.lockedAt": "",
|
||||
"workflow.expiredAt": "",
|
||||
"workflow.lockedBy": "",
|
||||
},
|
||||
$push: {
|
||||
@@ -2372,6 +2376,11 @@ export class ExpertClaimService {
|
||||
status: nextCaseStatus,
|
||||
claimStatus: nextClaimStatus,
|
||||
'workflow.locked': false,
|
||||
$unset: {
|
||||
'workflow.lockedAt': '',
|
||||
'workflow.expiredAt': '',
|
||||
'workflow.lockedBy': '',
|
||||
},
|
||||
'workflow.currentStep': nextStep,
|
||||
'workflow.nextStep': needsFactorUpload
|
||||
? ClaimWorkflowStep.INSURER_REVIEW
|
||||
@@ -2486,6 +2495,11 @@ export class ExpertClaimService {
|
||||
await this.claimCaseDbService.findByIdAndUpdate(claimRequestId, {
|
||||
claimStatus: ClaimStatus.NEEDS_REVISION,
|
||||
'workflow.locked': false,
|
||||
$unset: {
|
||||
'workflow.lockedAt': '',
|
||||
'workflow.expiredAt': '',
|
||||
'workflow.lockedBy': '',
|
||||
},
|
||||
...(note ? { 'evaluation.visitLocation': note } : {}),
|
||||
...(visitSnapshot && {
|
||||
'evaluation.inPersonVisitExpertProfileSnapshot': visitSnapshot,
|
||||
@@ -2952,6 +2966,7 @@ export class ExpertClaimService {
|
||||
actorId: claim.workflow.lockedBy.actorId?.toString(),
|
||||
actorName: claim.workflow.lockedBy.actorName,
|
||||
lockedAt: (claim.workflow as any).lockedAt?.toISOString(),
|
||||
expiredAt: (claim.workflow as any).expiredAt?.toISOString(),
|
||||
}
|
||||
: undefined,
|
||||
owner: claim.owner
|
||||
|
||||
Reference in New Issue
Block a user