Store detected regulation in consent records and expose it in SDK
Add a regulation column to cookie_consent_records so each consent captures which privacy law was in effect. Thread the value from the handler's geoloc resolution through the service into the DB insert. On the SDK side, add a Regulation union type to BannerConfig and expose it via a getter on CookieBannerClient and in the probo-ready event detail so themed-banner consumers can adapt their UI per regulation. Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -40,6 +40,7 @@ type (
|
||||
ConsentData json.RawMessage `db:"consent_data"`
|
||||
Action CookieConsentAction `db:"action"`
|
||||
SdkVersion string `db:"sdk_version"`
|
||||
Regulation string `db:"regulation"`
|
||||
CreatedAt time.Time `db:"created_at"`
|
||||
}
|
||||
|
||||
@@ -90,6 +91,7 @@ SELECT
|
||||
consent_data,
|
||||
action,
|
||||
sdk_version,
|
||||
regulation,
|
||||
created_at
|
||||
FROM
|
||||
cookie_consent_records
|
||||
@@ -174,6 +176,7 @@ INSERT INTO cookie_consent_records (
|
||||
consent_data,
|
||||
action,
|
||||
sdk_version,
|
||||
regulation,
|
||||
created_at
|
||||
) VALUES (
|
||||
@id,
|
||||
@@ -187,6 +190,7 @@ INSERT INTO cookie_consent_records (
|
||||
@consent_data,
|
||||
@action,
|
||||
@sdk_version,
|
||||
@regulation,
|
||||
@created_at
|
||||
)
|
||||
`
|
||||
@@ -203,6 +207,7 @@ INSERT INTO cookie_consent_records (
|
||||
"consent_data": r.ConsentData,
|
||||
"action": r.Action,
|
||||
"sdk_version": r.SdkVersion,
|
||||
"regulation": r.Regulation,
|
||||
"created_at": r.CreatedAt,
|
||||
}
|
||||
|
||||
@@ -232,6 +237,7 @@ SELECT
|
||||
consent_data,
|
||||
action,
|
||||
sdk_version,
|
||||
regulation,
|
||||
created_at
|
||||
FROM
|
||||
cookie_consent_records
|
||||
@@ -283,6 +289,7 @@ SELECT
|
||||
consent_data,
|
||||
action,
|
||||
sdk_version,
|
||||
regulation,
|
||||
created_at
|
||||
FROM
|
||||
cookie_consent_records
|
||||
|
||||
Reference in New Issue
Block a user