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

@@ -469,6 +469,35 @@ type (
ValidFrom string
ValidUntil string
}
TrackerPolicyData struct {
OrganizationName string
WebsiteOrigin string
GeneratedAt time.Time
PrivacyPolicyURL string
ConsentExpiryDays int
Categories []TrackerPolicyCategory
ThirdParties []TrackerPolicyThirdParty
}
TrackerPolicyCategory struct {
Name string
Description string
Necessary bool
Trackers []TrackerPolicyTracker
}
TrackerPolicyTracker struct {
Name string
Purpose string
Duration string
}
TrackerPolicyThirdParty struct {
Name string
Description string
PrivacyPolicyURL string
}
)
func BoolLabel(v bool) string {