From bbe5b7b77bab7be93b9b888a9a6739bae8ef5331 Mon Sep 17 00:00:00 2001 From: "s.hajizadeh" Date: Sun, 20 Sep 2026 12:31:39 +0330 Subject: [PATCH] VehicleHullAccessoryId --- .../claim-request-management.service.ts | 31 ++----------------- .../fanavaran-hull-expertise-lookups.ts | 2 ++ 2 files changed, 5 insertions(+), 28 deletions(-) diff --git a/src/claim-request-management/claim-request-management.service.ts b/src/claim-request-management/claim-request-management.service.ts index 9624edc..665a208 100644 --- a/src/claim-request-management/claim-request-management.service.ts +++ b/src/claim-request-management/claim-request-management.service.ts @@ -69,13 +69,12 @@ import { FANAVARAN_DEFAULT_HULL_REPAIR_DURATION, } from "./fanavaran-hull-expertise"; import { - asHullDmgAccessoryRows, FANAVARAN_DEFAULT_HULL_DMG_COST_KIND_ID, FANAVARAN_DEFAULT_HULL_DMG_KIND_ID, + FANAVARAN_DEFAULT_HULL_VEHICLE_ACCESSORY_ID, FANAVARAN_HULL_DMG_COST_KIND_CAPTION, FANAVARAN_HULL_DMG_KIND_CAPTION, findLookupIdByCaption, - resolveVehicleHullAccessoryId, } from "./fanavaran-hull-expertise-lookups"; import { BlameRequestDbService } from "src/request-management/entities/db-service/blame-request.db.service"; import { CreateClaimFromBlameResponseDto } from "./dto/create-claim-v2.dto"; @@ -4436,7 +4435,7 @@ export class ClaimRequestManagementService { ), }; - const [dmgKindRows, dmgCostKindRows, policyRecord, accessoriesRaw] = + const [dmgKindRows, dmgCostKindRows, policyRecord] = await Promise.all([ this.getFanavaranLookupRows(input.clientKey, "vehicle-hull-dmg-kind"), this.getFanavaranLookupRows( @@ -4450,13 +4449,6 @@ export class ClaimRequestManagementService { contractOptions, ) : Promise.resolve(null), - policyId != null - ? this.fanavaranLookupService.vehicleHullDmgAccessoriesByPolicyId( - input.clientKey, - policyId, - contractOptions, - ) - : Promise.resolve([]), ]); const dmgKindId = @@ -4468,13 +4460,6 @@ export class ClaimRequestManagementService { FANAVARAN_HULL_DMG_COST_KIND_CAPTION, ) ?? FANAVARAN_DEFAULT_HULL_DMG_COST_KIND_ID; - const accessories = asHullDmgAccessoryRows(accessoriesRaw); - if (policyId != null && accessories.length === 0) { - input.warnings.push( - `No hull dmg-accessories for policy ${policyId}; VehicleHullAccessoryId may be missing.`, - ); - } - let vehicle = pickHullVehicleIdentity(input.blame); let colorId: number | null = null; const policy = asObjectRecord(policyRecord); @@ -4518,16 +4503,6 @@ export class ClaimRequestManagementService { ); const hullSections = input.parts.map((part: any) => { - const accessoryKindId = parseCatalogPartIdInput(part?.partId); - const vehicleHullAccessoryId = resolveVehicleHullAccessoryId( - accessories, - accessoryKindId, - ); - if (vehicleHullAccessoryId == null) { - input.warnings.push( - `No VehicleHullAccessoryId for part "${this.fanavaranPartLabel(part)}" (AccessoryKindId=${accessoryKindId ?? "none"}).`, - ); - } return toFanavaranHullExpertiseDmgSection({ partId: part?.partId, desc: this.fanavaranPartLabel(part), @@ -4537,7 +4512,7 @@ export class ClaimRequestManagementService { this.parseFanavaranMoney(part?.salary), dmgKindId, dmgCostKindId, - vehicleHullAccessoryId, + vehicleHullAccessoryId: FANAVARAN_DEFAULT_HULL_VEHICLE_ACCESSORY_ID, }); }); diff --git a/src/claim-request-management/fanavaran-hull-expertise-lookups.ts b/src/claim-request-management/fanavaran-hull-expertise-lookups.ts index 6e834a8..6137adf 100644 --- a/src/claim-request-management/fanavaran-hull-expertise-lookups.ts +++ b/src/claim-request-management/fanavaran-hull-expertise-lookups.ts @@ -7,6 +7,8 @@ export const FANAVARAN_HULL_DMG_COST_KIND_CAPTION = "مجموع لوازم"; export const FANAVARAN_DEFAULT_HULL_DMG_KIND_ID = 5485; /** Fallback when lookup fetch fails (`vehicle-hull-dmg-cost-kinds` Id). */ export const FANAVARAN_DEFAULT_HULL_DMG_COST_KIND_ID = 1; +/** GEN.06 factory (فابریک) accessory row. Used for every hull DmgSection. */ +export const FANAVARAN_DEFAULT_HULL_VEHICLE_ACCESSORY_ID = 3043330; export type FanavaranHullDmgAccessoryRow = { Id?: unknown;