From c768ba34772e0f15b44acda8c87c276ccbd04cdc Mon Sep 17 00:00:00 2001 From: imesh94 Date: Thu, 7 Nov 2024 17:08:39 +0530 Subject: [PATCH] Fix customer count not updating on revoke --- .../siddhi-files/CDSCustomerRecipientMetricsApp.siddhi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/toolkits/ob-bi/carbon-home/deployment/siddhi-files/CDSCustomerRecipientMetricsApp.siddhi b/toolkits/ob-bi/carbon-home/deployment/siddhi-files/CDSCustomerRecipientMetricsApp.siddhi index 7d99f8db..2e8209ac 100644 --- a/toolkits/ob-bi/carbon-home/deployment/siddhi-files/CDSCustomerRecipientMetricsApp.siddhi +++ b/toolkits/ob-bi/carbon-home/deployment/siddhi-files/CDSCustomerRecipientMetricsApp.siddhi @@ -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); @@ -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