Add cookie banner versioning with JSONB snapshots
Introduce append-only cookie_banner_versions table with a JSONB snapshot of consent-relevant configuration (privacy policy URL, consent mode, expiry, categories and their cookies). Each version has its own state (DRAFT/PUBLISHED) separate from the banner lifecycle. Replace the banner state enum (DRAFT/PUBLISHED/DISABLED) with a simpler ACTIVE/INACTIVE toggle. Link consent records to the specific published version the visitor accepted. Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -118,7 +118,7 @@ LIMIT 1;
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *CookieBanner) LoadPublishedByID(
|
||||
func (b *CookieBanner) LoadActiveByID(
|
||||
ctx context.Context,
|
||||
conn pg.Querier,
|
||||
bannerID gid.GID,
|
||||
@@ -139,7 +139,7 @@ FROM
|
||||
cookie_banners
|
||||
WHERE
|
||||
id = @banner_id
|
||||
AND state = 'PUBLISHED'
|
||||
AND state = 'ACTIVE'
|
||||
LIMIT 1;
|
||||
`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user