Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-04-19 16:51:00 +00:00
co-authored by renee-png
parent f06a1014ac
commit 173e5aa719
+4 -3
View File
@@ -365,14 +365,15 @@ const IMPORTERS: ImporterConfig[] = [
boolCols: ["billable"],
dateCols: ["work_date"],
transform: (r, ctx) => {
// Resolve case
// Resolve case (keep hints on row so the async pre-insert step can
// auto-create an archived case + client when no match is found).
r.case_id =
(r._caseext && ctx.caseByExt.get(String(r._caseext))) ||
(r._casenum && ctx.caseByNumber.get(String(r._casenum))) ||
(r._casename && ctx.caseByTitle.get(String(r._casename).toLowerCase().trim())) ||
null;
delete r._caseext; delete r._casenum; delete r._casename;
if (!r.case_id) return null;
// NOTE: do NOT delete _caseext/_casenum/_casename here — async step needs them.
// NOTE: do NOT bail on missing case — async step will create one.
// Resolve hours from "Time" (e.g. "1.5", "1:30", "01:30:00") if needed
if (r.hours == null && r._time != null) {