forked from Yara724/api
Fix v5 + Fix ToDate field for damaged parts
This commit is contained in:
@@ -11081,6 +11081,9 @@ export class RequestManagementService {
|
||||
: { ...(req as any) };
|
||||
// Attach linked claim ID if present
|
||||
const claim = await this.claimCaseDbService.findOne({ blameRequestId: (req as any)._id });
|
||||
const claimPlain = claim && typeof (claim as any).toObject === "function"
|
||||
? (claim as any).toObject({ versionKey: false })
|
||||
: claim ? { ...(claim as any) } : null;
|
||||
return {
|
||||
_id: plain._id,
|
||||
publicId: plain.publicId,
|
||||
@@ -11115,7 +11118,19 @@ export class RequestManagementService {
|
||||
inquiryComplete: !!(p.person?.inquiriesCompleted),
|
||||
hasSigned: p.confirmation != null,
|
||||
})),
|
||||
linkedClaimId: claim ? String((claim as any)._id) : null,
|
||||
linkedClaimId: claimPlain ? String(claimPlain._id) : null,
|
||||
...(claimPlain ? {
|
||||
claimStatus: claimPlain.status,
|
||||
claimWorkflow: claimPlain.workflow,
|
||||
fileMakerRejectionCount: claimPlain.fileMakerRejectionCount ?? 0,
|
||||
fileMakerRejectionReason: claimPlain.fileMakerRejectionReason ?? null,
|
||||
evaluation: claimPlain.evaluation
|
||||
? {
|
||||
damageExpertReply: claimPlain.evaluation.damageExpertReply ?? null,
|
||||
damageExpertReplyFinal: claimPlain.evaluation.damageExpertReplyFinal ?? null,
|
||||
}
|
||||
: null,
|
||||
} : {}),
|
||||
createdAt: plain.createdAt,
|
||||
updatedAt: plain.updatedAt,
|
||||
};
|
||||
@@ -11169,6 +11184,9 @@ export class RequestManagementService {
|
||||
? (req as any).toObject({ versionKey: false })
|
||||
: { ...(req as any) };
|
||||
const claim = await this.claimCaseDbService.findOne({ blameRequestId: (req as any)._id });
|
||||
const claimPlain = claim && typeof (claim as any).toObject === "function"
|
||||
? (claim as any).toObject({ versionKey: false })
|
||||
: claim ? { ...(claim as any) } : null;
|
||||
return {
|
||||
_id: plain._id,
|
||||
publicId: plain.publicId,
|
||||
@@ -11216,7 +11234,19 @@ export class RequestManagementService {
|
||||
} : undefined,
|
||||
accidentFields: plain.expert.accidentFields,
|
||||
} : undefined,
|
||||
linkedClaimId: claim ? String((claim as any)._id) : null,
|
||||
linkedClaimId: claimPlain ? String(claimPlain._id) : null,
|
||||
...(claimPlain ? {
|
||||
claimStatus: claimPlain.status,
|
||||
claimWorkflow: claimPlain.workflow,
|
||||
fileMakerRejectionCount: claimPlain.fileMakerRejectionCount ?? 0,
|
||||
fileMakerRejectionReason: claimPlain.fileMakerRejectionReason ?? null,
|
||||
evaluation: claimPlain.evaluation
|
||||
? {
|
||||
damageExpertReply: claimPlain.evaluation.damageExpertReply ?? null,
|
||||
damageExpertReplyFinal: claimPlain.evaluation.damageExpertReplyFinal ?? null,
|
||||
}
|
||||
: null,
|
||||
} : {}),
|
||||
createdAt: plain.createdAt,
|
||||
updatedAt: plain.updatedAt,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user