Generate tracker policy document from banner snapshot

Add a markdown "Cookie and Tracking Technologies Policy" template in
the policy-writer tone that covers cookies and other tracking
technologies, with GDPR, UK GDPR, FADP, and CCPA/CPRA privacy-rights
framing. Convert it to ProseMirror JSON and add PublishTrackerPolicy,
which builds the document from a banner's latest published version
snapshot and its tracker third parties. The document is GENERATED and
private in the trust center, linked to the banner via
policy_document_id.

Add CookieItem.HumanizedDuration so server-rendered lifetimes match the
banner's humanizeDuration helper, and reword the publish trigger and
backfill comment to reflect the broader tracker scope.

Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
Émile Ré
2026-06-01 18:20:13 +02:00
parent f6eeeb675f
commit d68df53a6d
6 changed files with 451 additions and 2 deletions

View File

@@ -16,7 +16,7 @@ ALTER TABLE cookie_banners
ADD COLUMN policy_document_id TEXT,
ADD COLUMN policy_generation_requested_at TIMESTAMP WITH TIME ZONE;
-- Backfill: any banner that already has a published version gets its cookie
-- Backfill: any banner that already has a published version gets its tracker
-- policy generated on the worker's first pass.
UPDATE cookie_banners
SET policy_generation_requested_at = NOW()