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:
@@ -19,8 +19,9 @@ import "errors"
|
||||
var (
|
||||
ErrBannerNotFound = errors.New("cookie banner not found")
|
||||
ErrCategoryNotFound = errors.New("cookie category not found")
|
||||
ErrBannerNotDraft = errors.New("cookie banner is not in draft state")
|
||||
ErrBannerAlreadyPublished = errors.New("cookie banner is already published")
|
||||
ErrBannerAlreadyDisabled = errors.New("cookie banner is already disabled")
|
||||
ErrVersionNotFound = errors.New("cookie banner version not found")
|
||||
ErrBannerAlreadyActive = errors.New("cookie banner is already active")
|
||||
ErrBannerAlreadyInactive = errors.New("cookie banner is already inactive")
|
||||
ErrVersionNotPublished = errors.New("cookie banner version is not published")
|
||||
ErrCannotDeleteRequiredCategory = errors.New("cannot delete required cookie category")
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user