VehicleHullAccessoryId

This commit is contained in:
2026-09-20 12:31:39 +03:30
parent 1e13bb3a3c
commit bbe5b7b77b
2 changed files with 5 additions and 28 deletions

View File

@@ -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,
});
});