forked from Yara724/api
Fix damaged-parts flow bug on carAngles
This commit is contained in:
@@ -65,6 +65,10 @@ import {
|
||||
enrichBlamePartiesForAgreementView,
|
||||
} from "src/helpers/blame-party-agreement-decision";
|
||||
import { resendRequestHasPayload } from "src/helpers/claim-expert-resend";
|
||||
import {
|
||||
getClaimCarAngleCaptureBlob,
|
||||
type ClaimCarAngleKey,
|
||||
} from "src/helpers/claim-car-angle-media";
|
||||
import { snapshotFromDamageExpert } from "src/helpers/expert-profile-snapshot";
|
||||
import { DamageExpertModel } from "src/users/entities/schema/damage-expert.schema";
|
||||
import { SmsOrchestrationService } from "src/sms-orchestration/sms-orchestration.service";
|
||||
@@ -3263,9 +3267,14 @@ export class ExpertClaimService {
|
||||
|
||||
// Build car angles map
|
||||
const carAnglesData = claim.media?.carAngles as any;
|
||||
const damagedPartsDataForAngles = claim.media?.damagedParts as any;
|
||||
const carAngles: Record<string, { captured: boolean; url?: string }> = {};
|
||||
for (const k of ['front', 'back', 'left', 'right']) {
|
||||
const cap = hasCapture(carAnglesData, k);
|
||||
const cap = getClaimCarAngleCaptureBlob(
|
||||
carAnglesData,
|
||||
damagedPartsDataForAngles,
|
||||
k as ClaimCarAngleKey,
|
||||
) as { url?: string; path?: string } | undefined;
|
||||
carAngles[k] = {
|
||||
captured: !!cap,
|
||||
url: cap?.url || (cap?.path ? buildFileLink(cap.path) : undefined),
|
||||
|
||||
Reference in New Issue
Block a user