45d7f1be4e
* feat(mileage): surface Körjournal in the nav behind a settings toggle The /mileage page shipped hidden: the route works but no nav row points at it. Add company_settings.mileage_enabled (mirroring dimensions_enabled) with a switch in Fönster -> Bokföring, and show the Arbeta nav row when the toggle is on OR the company already has mileage_trips rows, the same hybrid gate as webshop orders, so trips created via API/MCP can never become invisible underlag. UI visibility only, never load-bearing for correctness. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(migrations): move mileage_enabled migration after already-applied 20260812153208 origin/main merged in 20260812153208 which prod has already applied; a new file sorting before it risks an out-of-order db push abort. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
20 lines
1002 B
SQL
20 lines
1002 B
SQL
-- Körjournal (mileage log) sidebar visibility toggle.
|
|
--
|
|
-- Adds the per-company UI toggle that surfaces the Körjournal nav row and the
|
|
-- /mileage page entry point. UI-visibility only, NEVER load-bearing for
|
|
-- correctness: trips written via API/MCP are validated and bookable regardless
|
|
-- of this flag, and the nav row also shows whenever the company already has
|
|
-- mileage_trips rows (same hybrid gate as webshop orders), so agent-created
|
|
-- trips can never become invisible underlag. Mirrors dimensions_enabled
|
|
-- (20260702100000).
|
|
--
|
|
-- pg-test: skip (plain column addition, no trigger/RPC/RLS)
|
|
|
|
ALTER TABLE public.company_settings
|
|
ADD COLUMN mileage_enabled boolean NOT NULL DEFAULT false;
|
|
|
|
COMMENT ON COLUMN public.company_settings.mileage_enabled IS
|
|
'UI-visibility toggle for the Körjournal (mileage log) nav row. Never load-bearing for correctness: trips created via API/MCP work regardless, and the nav row also shows when mileage_trips rows exist.';
|
|
|
|
NOTIFY pgrst, 'reload schema';
|