From c0d3c74c048922c4da286709988fd8a23f5a72f8 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sun, 19 Apr 2026 18:07:08 +0000 Subject: [PATCH] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/routes/settings.import.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/routes/settings.import.tsx b/src/routes/settings.import.tsx index 34f20ba..49a7bc3 100644 --- a/src/routes/settings.import.tsx +++ b/src/routes/settings.import.tsx @@ -284,6 +284,11 @@ const IMPORTERS: ImporterConfig[] = [ // in batched upserts where Postgrest sends the column union. r.status = "intake"; } + // Default opened_at to today when missing — avoids NULL violations + // in batched upserts where Postgrest sends the column union. + if (!r.opened_at) { + r.opened_at = new Date().toISOString().slice(0, 10); + } // Normalise billing method if (r.billing_method) { const bm = String(r.billing_method).toLowerCase();