diff --git a/src/routes/settings.import.tsx b/src/routes/settings.import.tsx index c658aad..f3e14c7 100644 --- a/src/routes/settings.import.tsx +++ b/src/routes/settings.import.tsx @@ -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 = {};