forked from Yara724/api
Fixed VIN placement for when the users use vin-based inquiry
This commit is contained in:
@@ -53,6 +53,8 @@ export const PersonSchema = SchemaFactory.createForClass(Person);
|
|||||||
@Schema({ _id: false })
|
@Schema({ _id: false })
|
||||||
export class Vehicle {
|
export class Vehicle {
|
||||||
@Prop() plateId?: string;
|
@Prop() plateId?: string;
|
||||||
|
/** VIN / chassis number — populated only when the inquiry was performed via VIN lookup. */
|
||||||
|
@Prop() vin?: string;
|
||||||
@Prop() name?: string;
|
@Prop() name?: string;
|
||||||
@Prop() model?: string;
|
@Prop() model?: string;
|
||||||
@Prop() type?: string;
|
@Prop() type?: string;
|
||||||
|
|||||||
@@ -501,6 +501,9 @@ export class InquiryRefreshService {
|
|||||||
if (memParty.vehicle?.plateId !== undefined) {
|
if (memParty.vehicle?.plateId !== undefined) {
|
||||||
party.vehicle.plateId = memParty.vehicle.plateId;
|
party.vehicle.plateId = memParty.vehicle.plateId;
|
||||||
}
|
}
|
||||||
|
if (memParty.vehicle?.vin !== undefined) {
|
||||||
|
party.vehicle.vin = memParty.vehicle.vin;
|
||||||
|
}
|
||||||
blameDoc.markModified(`parties.${docIdx}.vehicle`);
|
blameDoc.markModified(`parties.${docIdx}.vehicle`);
|
||||||
|
|
||||||
if (memParty.insurance) {
|
if (memParty.insurance) {
|
||||||
|
|||||||
@@ -1842,8 +1842,8 @@ export class RequestManagementService {
|
|||||||
|
|
||||||
if (!party.vehicle) party.vehicle = {} as any;
|
if (!party.vehicle) party.vehicle = {} as any;
|
||||||
party.vehicle.isNew = body.isNewCar;
|
party.vehicle.isNew = body.isNewCar;
|
||||||
// Store VIN as the vehicle identifier instead of plate
|
// Store VIN in vehicle.vin; leave plateId empty for VIN-based inquiries
|
||||||
party.vehicle.plateId = body.vin;
|
party.vehicle.vin = body.vin;
|
||||||
party.vehicle.name = inquiryMapped?.MapTypNam;
|
party.vehicle.name = inquiryMapped?.MapTypNam;
|
||||||
party.vehicle.type = `${inquiryMapped?.UsageField} / ${inquiryMapped?.MapUsageName || "-"}`;
|
party.vehicle.type = `${inquiryMapped?.UsageField} / ${inquiryMapped?.MapUsageName || "-"}`;
|
||||||
party.vehicle.inquiry = {
|
party.vehicle.inquiry = {
|
||||||
@@ -9508,7 +9508,8 @@ export class RequestManagementService {
|
|||||||
(party.person as any).licenseType = (partyData as any).licenseType;
|
(party.person as any).licenseType = (partyData as any).licenseType;
|
||||||
|
|
||||||
if (!party.vehicle) party.vehicle = {} as any;
|
if (!party.vehicle) party.vehicle = {} as any;
|
||||||
party.vehicle.plateId = partyData.vin; // store VIN as vehicle identifier
|
// Store VIN in vehicle.vin; leave plateId empty for VIN-based inquiries
|
||||||
|
party.vehicle.vin = partyData.vin;
|
||||||
party.vehicle.name = inquiryMapped?.MapTypNam;
|
party.vehicle.name = inquiryMapped?.MapTypNam;
|
||||||
party.vehicle.type = `${inquiryMapped?.UsageField ?? ""} / ${inquiryMapped?.UsageName ?? inquiryMapped?.MapUsageName ?? "-"}`;
|
party.vehicle.type = `${inquiryMapped?.UsageField ?? ""} / ${inquiryMapped?.UsageName ?? inquiryMapped?.MapUsageName ?? "-"}`;
|
||||||
party.vehicle.inquiry = {
|
party.vehicle.inquiry = {
|
||||||
|
|||||||
Reference in New Issue
Block a user