Files
accounted/supabase/migrations/20260709090000_invoice_payment_link.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

17 lines
1.0 KiB
SQL

-- Optional online payment link on customer invoices (manual MVP).
--
-- The user creates a payment link in their PSP dashboard (e.g. a Stripe
-- Payment Link), pastes it onto the invoice, and it renders as a
-- "Betala online" button in the invoice email and as a QR code + link on
-- the PDF. There is no PSP integration server-side: the column is a plain
-- URL. Validation (https-only, length cap) lives in the API schema
-- (lib/api/schemas.ts). Derived documents (credit notes, proforma
-- conversions, recurring-schedule invoices) intentionally do NOT copy this
-- column: a pasted link encodes one specific amount for one specific
-- invoice, and carrying it over would silently point at the wrong amount.
alter table public.invoices
add column if not exists payment_link_url text;
comment on column public.invoices.payment_link_url is
'Optional https link where the customer can pay this invoice online (pasted by the user, e.g. a Stripe Payment Link). Rendered in the invoice email and on the PDF. Never copied to derived documents.';