Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix customerCount metrics not updating on consent revoke #38

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ define stream CountableConsentAuthStream(CONSENT_ID string, CLIENT_ID string, US

define stream ExpiredConsentStream(CONSENT_ID string, CLIENT_ID string, USER_ID string);

define stream RevokedConsentStream(CONSENT_ID string, CLIENT_ID string, USER_ID string);
define stream RevokedConsentStream(CONSENT_ID string, CLIENT_ID string, USER_ID string, CURRENT_STATUS string);

define stream ActiveAuthCountStream(CLIENT_ID string, USER_ID string, ACTIVE_AUTH_COUNT long, LAST_UPDATED long);

Expand Down Expand Up @@ -93,10 +93,10 @@ select CDR_ARRANGEMENT_ID as CONSENT_ID, CLIENT_ID, USER_ID
insert into CountableConsentAuthStream;

-- Filter revoked authorizations that should be counted
from ConsentInputStream[STATUS == "revoked"]#window.unique:first(CDR_ARRANGEMENT_ID) as I join CONSENT_RAW_DATA as T
from ConsentInputStream[STATUS == "Revoked"]#window.unique:first(CDR_ARRANGEMENT_ID) as I join CONSENT_RAW_DATA as T
on I.CDR_ARRANGEMENT_ID == T.CONSENT_ID
select I.CDR_ARRANGEMENT_ID as CONSENT_ID, T.CLIENT_ID as CLIENT_ID, T.USER_ID as USER_ID
having T.STATUS == "authorized"
select I.CDR_ARRANGEMENT_ID as CONSENT_ID, T.CLIENT_ID as CLIENT_ID, T.USER_ID as USER_ID, T.STATUS as CURRENT_STATUS
having CURRENT_STATUS == "authorized"
insert into RevokedConsentStream;

-- Trigger expired authorizations
Expand Down
Loading