From d2c97127370e50324c8dd76cae9c1e172ca3def2 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 02:23:54 +0000 Subject: [PATCH 1/5] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/routes/settings.import.tsx | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/routes/settings.import.tsx b/src/routes/settings.import.tsx index 30bee66..d8b3b97 100644 --- a/src/routes/settings.import.tsx +++ b/src/routes/settings.import.tsx @@ -582,6 +582,11 @@ function ImportPage() { const mapped: Row[] = []; let skipped = 0; const errors: string[] = []; + const skipReasons: Record = {}; + const bumpSkip = (reason: string) => { + skipped++; + skipReasons[reason] = (skipReasons[reason] ?? 0) + 1; + }; for (const raw of rawRows) { const row: Row = {}; @@ -598,7 +603,19 @@ function ImportPage() { // transform const transformed = cfg.transform ? cfg.transform(row, ctx) : row; - if (!transformed) { skipped++; continue; } + if (!transformed) { + // Diagnose common transform-rejection reasons for clearer feedback + if (cfg.table === "homeowners" && !row.client_id && !row._clientext && !row._clientname) { + bumpSkip("no client match (missing companyid/company)"); + } else if (cfg.table === "homeowners" && (row._clientext || row._clientname) && !row.client_id) { + bumpSkip("client not found in existing clients (import companies first)"); + } else if ((cfg.table === "cases" || cfg.table === "invoices") && !row.client_id) { + bumpSkip("client not found"); + } else { + bumpSkip("rejected by transform"); + } + continue; + } // archived → archived_at (only on tables that support it) if ("_archived" in transformed) { @@ -611,7 +628,7 @@ function ImportPage() { // required check const missing = cfg.required.find((k) => !transformed[k] && transformed[k] !== 0); - if (missing) { skipped++; continue; } + if (missing) { bumpSkip(`missing required: ${missing}`); continue; } // attach created_by where not present if (!transformed.created_by && !["time_entries", "expenses", "comments"].includes(cfg.table)) { From 1ad99af227db4ec5e9be24421ec84ae6c5116915 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 02:24:13 +0000 Subject: [PATCH 2/5] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/routes/settings.import.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/routes/settings.import.tsx b/src/routes/settings.import.tsx index d8b3b97..c466e3e 100644 --- a/src/routes/settings.import.tsx +++ b/src/routes/settings.import.tsx @@ -499,6 +499,7 @@ interface ImportResult { inserted: number; skipped: number; errors: string[]; + skipReasons?: Record; } function ImportPage() { From 2abb8f69ee798d5dd7992844a9f0fedd42cc2a2a Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 02:24:24 +0000 Subject: [PATCH 3/5] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/routes/settings.import.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/settings.import.tsx b/src/routes/settings.import.tsx index c466e3e..cea76c7 100644 --- a/src/routes/settings.import.tsx +++ b/src/routes/settings.import.tsx @@ -639,7 +639,7 @@ function ImportPage() { } if (mapped.length === 0) { - setResults((r) => ({ ...r, [cfg.key]: { total: rawRows.length, inserted: 0, skipped, errors: ["No valid rows after mapping. Check headers/required fields."] } })); + setResults((r) => ({ ...r, [cfg.key]: { total: rawRows.length, inserted: 0, skipped, errors: ["No valid rows after mapping. Check headers/required fields."], skipReasons } })); return; } From 7e855e46578b3354105edefe63585c2390c52913 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 02:24:32 +0000 Subject: [PATCH 4/5] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/routes/settings.import.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/settings.import.tsx b/src/routes/settings.import.tsx index cea76c7..45121b7 100644 --- a/src/routes/settings.import.tsx +++ b/src/routes/settings.import.tsx @@ -681,7 +681,7 @@ function ImportPage() { if (cfg.postInsert) cfg.postInsert(inserted_rows, ctx); - const summary = { total: rawRows.length, inserted, skipped, errors }; + const summary = { total: rawRows.length, inserted, skipped, errors, skipReasons }; setResults((r) => ({ ...r, [cfg.key]: summary })); if (errors.length === 0) toast.success(`${cfg.label}: ${inserted} imported`); else toast.error(`${cfg.label}: ${errors.length} batch error(s)`); From 39ae6ab4238fab1225fb178604d4551696aa2f86 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 02:24:46 +0000 Subject: [PATCH 5/5] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/routes/settings.import.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/routes/settings.import.tsx b/src/routes/settings.import.tsx index 45121b7..e48ff0a 100644 --- a/src/routes/settings.import.tsx +++ b/src/routes/settings.import.tsx @@ -751,9 +751,16 @@ function ImportPage() { )} {r.skipped > 0 && ( - {r.skipped} skipped (missing required fields) + {r.skipped} skipped )} + {r.skipReasons && Object.keys(r.skipReasons).length > 0 && ( +
+ {Object.entries(r.skipReasons).map(([reason, count]) => ( +
• {count} × {reason}
+ ))} +
+ )} {r.errors.length > 0 && (
{r.errors.slice(0, 3).map((e, i) =>
• {e}
)}