forked from Yara724/api
Fixed vin inquiry
This commit is contained in:
@@ -1842,8 +1842,14 @@ export class RequestManagementService {
|
||||
|
||||
if (!party.vehicle) party.vehicle = {} as any;
|
||||
party.vehicle.isNew = body.isNewCar;
|
||||
// Store VIN in vehicle.vin; leave plateId empty for VIN-based inquiries
|
||||
party.vehicle.vin = body.vin;
|
||||
// Derive plateId from the plate parts returned by the VIN inquiry (plk → Plk1/Plk2/Plk3/PlkSrl).
|
||||
// Falls back to the submitted VIN so plateId is never empty.
|
||||
party.vehicle.plateId = this.plateToPlateIdString({
|
||||
ir: inquiryMapped?.PlkSrl,
|
||||
leftDigits: inquiryMapped?.Plk1,
|
||||
centerAlphabet: inquiryMapped?.Plk2 ?? inquiryMapped?.plateLetterid,
|
||||
centerDigits: inquiryMapped?.Plk3,
|
||||
}) || body.vin;
|
||||
party.vehicle.name = inquiryMapped?.MapTypNam;
|
||||
party.vehicle.type = `${inquiryMapped?.UsageField} / ${inquiryMapped?.MapUsageName || "-"}`;
|
||||
party.vehicle.inquiry = {
|
||||
@@ -9508,8 +9514,14 @@ export class RequestManagementService {
|
||||
(party.person as any).licenseType = (partyData as any).licenseType;
|
||||
|
||||
if (!party.vehicle) party.vehicle = {} as any;
|
||||
// Store VIN in vehicle.vin; leave plateId empty for VIN-based inquiries
|
||||
party.vehicle.vin = partyData.vin;
|
||||
// Derive plateId from the plate parts returned by the VIN inquiry (plk → Plk1/Plk2/Plk3/PlkSrl).
|
||||
// Falls back to the submitted VIN so plateId is never empty.
|
||||
party.vehicle.plateId = this.plateToPlateIdString({
|
||||
ir: inquiryMapped?.PlkSrl,
|
||||
leftDigits: inquiryMapped?.Plk1,
|
||||
centerAlphabet: inquiryMapped?.Plk2 ?? inquiryMapped?.plateLetterid,
|
||||
centerDigits: inquiryMapped?.Plk3,
|
||||
}) || partyData.vin;
|
||||
party.vehicle.name = inquiryMapped?.MapTypNam;
|
||||
party.vehicle.type = `${inquiryMapped?.UsageField ?? ""} / ${inquiryMapped?.UsageName ?? inquiryMapped?.MapUsageName ?? "-"}`;
|
||||
party.vehicle.inquiry = {
|
||||
|
||||
Reference in New Issue
Block a user