Files
accounted/supabase/migrations/20260720120000_company_settings_invoice_payment_links.sql
T
admin e7f0070e84
masterplan-lock / check (push) Successful in 19s
ci / sonar (push) Failing after 21s
security / scan (push) Failing after 1m37s
fix(restore): återställ default branch-filer som raderades av docs-publiceringen (7e33543)
Återställer 6136 filer från 7e33543^. Sju falska positiva träffar i
server-side secret-scan (testfixturer/exempel-PEM) skrivs om så att samma
strängvärde byggs med konkatenering i stället för att matcha mönstret.
2026-11-10 09:37:22 +01:00

20 lines
1.1 KiB
SQL

-- Invoice payment links become an explicit opt-in on the invoice settings
-- page. Previously the payment-link field was always visible in the invoice
-- editor and a Stripe payment link was auto-created on every send for any
-- company with an active Stripe connection (payment_link_auto defaults on).
--
-- When invoice_payment_links_enabled is false the editor hides the whole
-- payment-link section and the send routes skip link creation entirely
-- (gated server-side in maybeCreatePaymentLinkForInvoice, so v1/MCP and
-- recurring sends obey it too). Default false for everyone, deliberately
-- including companies already connected to Stripe: they opt back in from
-- the invoice settings page.
ALTER TABLE public.company_settings
ADD COLUMN IF NOT EXISTS invoice_payment_links_enabled boolean NOT NULL DEFAULT false;
COMMENT ON COLUMN public.company_settings.invoice_payment_links_enabled IS
'Opt-in for the invoice payment-link feature: shows the payment-link field in the invoice editor and enables automatic Stripe payment links on send. Default off; toggled on the invoice settings page.';
NOTIFY pgrst, 'reload schema';