Expanded location aliases
X-Lovable-Edit-ID: edt-8603906b-6d05-4c5e-8640-0a7f3106b5f4 Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
@@ -191,14 +191,18 @@ const IMPORTERS: ImporterConfig[] = [
|
||||
conflict: "external_id",
|
||||
required: ["client_id", "first_name"],
|
||||
aliases: {
|
||||
id: "external_id", locationid: "external_id", externalid: "external_id",
|
||||
companyid: "_clientext", clientid: "_clientext", company: "_clientname",
|
||||
address: "address", street: "address", addressline1: "address",
|
||||
unit: "unit_number", unitnumber: "unit_number",
|
||||
ownername: "_ownername", owner: "_ownername",
|
||||
firstname: "first_name", lastname: "last_name",
|
||||
email: "email", phone: "phone",
|
||||
notes: "notes",
|
||||
id: "external_id", locationid: "external_id", externalid: "external_id", propertyid: "external_id", unitid: "external_id",
|
||||
// Client (HOA) reference — accept many common header variants
|
||||
companyid: "_clientext", clientid: "_clientext", hoaid: "_clientext", associationid: "_clientext", propertycompanyid: "_clientext",
|
||||
company: "_clientname", companyname: "_clientname", client: "_clientname", clientname: "_clientname",
|
||||
hoa: "_clientname", hoaname: "_clientname", association: "_clientname", associationname: "_clientname",
|
||||
property: "_clientname", propertyname: "_clientname", community: "_clientname", communityname: "_clientname",
|
||||
address: "address", street: "address", addressline1: "address", propertyaddress: "address", streetaddress: "address",
|
||||
unit: "unit_number", unitnumber: "unit_number", unitno: "unit_number", suite: "unit_number", apt: "unit_number", apartment: "unit_number",
|
||||
ownername: "_ownername", owner: "_ownername", homeowner: "_ownername", homeownername: "_ownername", residentname: "_ownername", resident: "_ownername", contactname: "_ownername",
|
||||
firstname: "first_name", givenname: "first_name", lastname: "last_name", surname: "last_name", familyname: "last_name",
|
||||
email: "email", emailaddress: "email", phone: "phone", phonenumber: "phone", mobile: "phone",
|
||||
notes: "notes", note: "notes", comments: "notes",
|
||||
archived: "_archived", isarchived: "_archived",
|
||||
},
|
||||
transform: (r, ctx) => {
|
||||
@@ -604,10 +608,6 @@ function ImportPage() {
|
||||
unknownHeaders.push(h);
|
||||
}
|
||||
}
|
||||
if (unknownHeaders.length > 0) {
|
||||
console.info(`[import:${cfg.key}] skipped unknown columns:`, unknownHeaders);
|
||||
}
|
||||
|
||||
const mapped: Row[] = [];
|
||||
let skipped = 0;
|
||||
const errors: string[] = [];
|
||||
@@ -616,6 +616,10 @@ function ImportPage() {
|
||||
skipped++;
|
||||
skipReasons[reason] = (skipReasons[reason] ?? 0) + 1;
|
||||
};
|
||||
if (unknownHeaders.length > 0) {
|
||||
console.info(`[import:${cfg.key}] skipped unknown columns:`, unknownHeaders);
|
||||
errors.push(`Unrecognized columns ignored: ${unknownHeaders.join(", ")}`);
|
||||
}
|
||||
|
||||
for (const raw of rawRows) {
|
||||
const row: Row = {};
|
||||
|
||||
Reference in New Issue
Block a user