From 30c30ed821ffd8b5acbc7b7bb5112666cdc819ce Mon Sep 17 00:00:00 2001 From: Dave Date: Mon, 26 Oct 2026 10:46:27 +0200 Subject: [PATCH] feat: invoice match on by default with the WFDASH address built in The match never ran on drivers' phones: it was off by default and the build had no WFDASH address, so photos were stored but nothing collected. Now it is on for every driver (switched on once for phones saved while it was off; a later "off" sticks) and falls back to wfdash.apphub.co.za. Co-Authored-By: Claude Opus 5.5 --- Dockerfile | 4 ++++ app/settings/page.tsx | 7 ++++--- lib/invoiceCheck.ts | 9 ++++++--- lib/pocketbase.ts | 12 +++++++++++- lib/types.ts | 14 +++++++++++--- 5 files changed, 36 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index e35fa07..1131bbf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,6 +15,10 @@ COPY . . ARG NEXT_PUBLIC_POCKETBASE_URL ENV NEXT_PUBLIC_POCKETBASE_URL=${NEXT_PUBLIC_POCKETBASE_URL} +# WFDASH address the invoice match calls (overridable per phone in Settings) +ARG NEXT_PUBLIC_WFDASH_URL=https://wfdash.apphub.co.za +ENV NEXT_PUBLIC_WFDASH_URL=${NEXT_PUBLIC_WFDASH_URL} + # Generate PWA icons RUN node scripts/generate-icons.js diff --git a/app/settings/page.tsx b/app/settings/page.tsx index d33a0f2..3fad176 100644 --- a/app/settings/page.tsx +++ b/app/settings/page.tsx @@ -6,6 +6,7 @@ import { useAuth } from '@/components/AuthProvider'; import BottomNav from '@/components/BottomNav'; import { getSettings, saveSettings, logout } from '@/lib/pocketbase'; import { AppSettings, DEFAULT_SETTINGS } from '@/lib/types'; +import { DEFAULT_WFDASH_URL } from '@/lib/invoiceCheck'; import { cn } from '@/lib/utils'; import { setDarkMode, applyDarkMode } from '@/lib/theme'; import { @@ -305,7 +306,7 @@ export default function SettingsPage() {
Invoice check - Adds a Check invoice button after you photograph an invoice. Only advises; nothing else changes. + After you photograph an invoice, items that match it exactly are marked collected (you can undo). Anything unsure is left for you.