forked from Yara724/api
badane update is implemented now
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
import { PartyRole } from "src/request-management/entities/schema/partyRole.enum";
|
||||
import {
|
||||
pickHullVehicleIdentity,
|
||||
toFanavaranHullExpertiseDmgSection,
|
||||
toFanavaranHullExpertisePayload,
|
||||
} from "./fanavaran-hull-expertise";
|
||||
|
||||
describe("fanavaran hull expertise", () => {
|
||||
it("maps car-body inquiry identity onto GEN.06 vehicle fields", () => {
|
||||
const vehicle = pickHullVehicleIdentity({
|
||||
parties: [
|
||||
{
|
||||
role: PartyRole.FIRST,
|
||||
insurance: {
|
||||
carBodyInsurance: {
|
||||
chassisNumber: "NAS431100K1050805",
|
||||
motorNumber: "M136251767",
|
||||
vin: "VIN123",
|
||||
},
|
||||
},
|
||||
vehicle: {
|
||||
inquiry: {
|
||||
carBody: {
|
||||
mapped: {
|
||||
platePartOne: "29",
|
||||
plateLetterTitle: "د",
|
||||
platePartThree: "782",
|
||||
plateSerialNumber: "60",
|
||||
builtYear: 1398,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
expect(vehicle).toEqual({
|
||||
motorNo: "M136251767",
|
||||
chassisNo: "NAS431100K1050805",
|
||||
vin: "VIN123",
|
||||
plaqueNo: "29د782",
|
||||
plaqueSerial: "60",
|
||||
builtYear: 1398,
|
||||
});
|
||||
});
|
||||
|
||||
it("builds a GEN.06 payload without ثالث expertise fields", () => {
|
||||
const payload = toFanavaranHullExpertisePayload({
|
||||
claimExpertId: 29,
|
||||
dmgAssessmentDate: "1405/06/24",
|
||||
inspectionTime: "10:33",
|
||||
wage: 1000,
|
||||
componentReplacementCost: 2000,
|
||||
wasteValue: 0,
|
||||
dropAmount: 12,
|
||||
vehicleCurrentValue: 1900000000,
|
||||
vehicle: {
|
||||
motorNo: "M1",
|
||||
chassisNo: "C1",
|
||||
vin: null,
|
||||
plaqueNo: "695ط61",
|
||||
plaqueSerial: "87",
|
||||
builtYear: 1398,
|
||||
},
|
||||
dmgSections: [
|
||||
toFanavaranHullExpertiseDmgSection({
|
||||
partId: 9,
|
||||
desc: "bumper",
|
||||
wasteValue: 0,
|
||||
amount: 3000,
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
expect(payload.Wage).toBe(1000);
|
||||
expect(payload.RepairWage).toBeUndefined();
|
||||
expect(payload.DmgCaseId).toBeUndefined();
|
||||
expect(payload.InspectionPlaceId).toBeUndefined();
|
||||
expect(payload.DropAmountStatus).toBeUndefined();
|
||||
expect(payload.DamagedVehicleCurrentPrice).toBeUndefined();
|
||||
expect(payload.ClaimExpertId).toBe(29);
|
||||
expect(payload.PlaqueNo).toBe("695ط61");
|
||||
expect(payload.DmgSections).toEqual([
|
||||
{
|
||||
Count: 1,
|
||||
Desc: "bumper",
|
||||
WasteValue: 0,
|
||||
AccessoryKindId: 9,
|
||||
DmgKindId: null,
|
||||
VehicleHullAccessoryId: null,
|
||||
DmgSectionCosts: [
|
||||
{ Caption: "bumper", Amount: 3000, DmgCostKindId: null },
|
||||
],
|
||||
},
|
||||
]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user