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:
Émile Ré
2026-05-06 20:44:16 +04:00
parent d5394317bb
commit f695b90b19
6 changed files with 51 additions and 1 deletions

View File

@@ -191,6 +191,7 @@ func (h *Handler) handlePostConsent(w http.ResponseWriter, r *http.Request) {
ConsentData: body.ConsentData,
Action: body.Action,
SdkVersion: sdkVersion,
Regulation: h.resolveRegulation(r),
}
record, err := h.cookieBannerSvc.RecordConsent(r.Context(), bannerID, req)