Skip to content

Commit

Permalink
No int test/dap ipv identity issued (#384)
Browse files Browse the repository at this point in the history
* ipv_identity_issue changes

* update to ref table

* update to temp view and proc

* update to set up file

* update to proc
  • Loading branch information
psodhi-gds authored Oct 23, 2023
1 parent 3f2dc20 commit 02b494d
Show file tree
Hide file tree
Showing 9 changed files with 516 additions and 9 deletions.
34 changes: 26 additions & 8 deletions athena-scripts/redshift_scripts/sp_ipv_journey.sql
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,22 @@ P Sodhi 15/09/2023 Removed update to the RP table as its not needed.
WHERE sub_domain NOT IN (SELECT VERIFICATION_ROUTE_NAME FROM conformed.DIM_VERIFICATION_ROUTE);


UPDATE "dap_txma_reporting_db"."conformed"."fact_user_journey_event"
UPDATE "conformed"."fact_user_journey_event"
SET
REJECTION_REASON=trim(st.REJECTION_REASON,'"')
,REASON=trim(st.REASON,'"')
,USER_USER_ID=st.user_user_id
,USER_GOVUK_SIGNIN_JOURNEY_ID=st.user_govuk_signin_journey_id
,COMPONENT_ID=st.COMPONENT_ID
,COMPONENT_ID=st.COMPONENT_ID
,CI_FAIL= DECODE(lower(st.CI_FAIL),
'false', '0',
'true', '1'
)::integer::boolean
,HAS_MITIGATIONS=DECODE(lower(st.HAS_MITIGATIONS),
'false', '0',
'true', '1'
)::integer::boolean
,LEVEL_OF_CONFIDENCE=trim(st.LEVEL_OF_CONFIDENCE,'"')
,NOTIFICATION_TYPE=trim(st.NOTIFICATION_TYPE,'"')
,MFA_TYPE=trim(st.MFA_TYPE,'"')
,ACCOUNT_RECOVERY=trim(st.ACCOUNT_RECOVERY,'"')
Expand Down Expand Up @@ -267,13 +276,13 @@ P Sodhi 15/09/2023 Removed update to the RP table as its not needed.
FROM conformed.v_stg_ipv_journey
WHERE EVENT_ID IN (
SELECT EVENT_ID
FROM "dap_txma_reporting_db"."conformed"."fact_user_journey_event"
FROM "conformed"."fact_user_journey_event"
) )AS st
WHERE fact_user_journey_event.EVENT_ID = st.EVENT_ID;


INSERT INTO conformed.FACT_USER_JOURNEY_EVENT (EVENT_KEY,DATE_KEY,verification_route_key,journey_channel_key,relying_party_key,USER_USER_ID,
EVENT_ID,EVENT_TIME,USER_GOVUK_SIGNIN_JOURNEY_ID,COMPONENT_ID,EVENT_COUNT,
EVENT_ID,EVENT_TIME,USER_GOVUK_SIGNIN_JOURNEY_ID,COMPONENT_ID,EVENT_COUNT,CI_FAIL,HAS_MITIGATIONS,LEVEL_OF_CONFIDENCE,
REJECTION_REASON,REASON,NOTIFICATION_TYPE,MFA_TYPE,ACCOUNT_RECOVERY,FAILED_CHECK_DETAILS_BIOMETRIC_VERIFICATION_PROCESS_LEVEL,
CHECK_DETAILS_BIOMETRIC_VERIFICATION_PROCESS_LEVEL,ADDRESSES_ENTERED,ACTIVITY_HISTORY_SCORE,IDENTITY_FRAUD_SCORE,DECISION_SCORE,
FAILED_CHECK_DETAILS_KBV_RESPONSE_MODE,FAILED_CHECK_DETAILS_CHECK_METHOD,CHECK_DETAILS_KBV_RESPONSE_MODE,CHECK_DETAILS_KBV_QUALITY,
Expand All @@ -292,6 +301,15 @@ P Sodhi 15/09/2023 Removed update to the RP table as its not needed.
,cnf.user_govuk_signin_journey_id AS USER_GOVUK_SIGNIN_JOURNEY_ID
,cnf.component_id AS COMPONENT_ID
,EVENT_COUNT
, DECODE(lower(CI_FAIL),
'false', '0',
'true', '1'
)::integer::boolean
,DECODE(lower(HAS_MITIGATIONS),
'false', '0',
'true', '1'
)::integer::boolean
,trim(LEVEL_OF_CONFIDENCE,'"')
,trim(REJECTION_REASON,'"')
,trim(REASON,'"')
,trim(NOTIFICATION_TYPE,'"')
Expand Down Expand Up @@ -392,7 +410,7 @@ P Sodhi 15/09/2023 Removed update to the RP table as its not needed.
ON cnf.sub_domain = dvr.verification_route_name;


INSERT into audit.err_duplicate_event_id_ipv_journey_10 (total_duplicate_event_count_minus_one
INSERT into audit.err_duplicate_event_id_ipv_identity_issued_15 (total_duplicate_event_count_minus_one
,product_family,event_name,event_id,timestamp_formatted,created_by,created_datetime)
SELECT event_count,Product_family,event_name,event_id,timestamp_formatted,current_user,GETDATE() as Current_date
FROM
Expand All @@ -405,14 +423,14 @@ P Sodhi 15/09/2023 Removed update to the RP table as its not needed.
ROW_NUMBER() OVER (PARTITION BY event_id, timestamp_formatted ORDER BY timestamp_formatted) AS row_num,
*
FROM
"dap_txma_reporting_db"."dap_txma_stage"."ipv_journey"
"dap_txma_stage"."ipv_journey"
--where event_id='5c94f844-f05d-4c32-87fe-e3b6b265223f'
) auth
JOIN "dap_txma_reporting_db"."conformed"."batchcontrol" batc ON auth.Product_family = batc.product_family
JOIN "conformed"."batchcontrol" batc ON auth.Product_family = batc.product_family
AND auth.processed_date > batc.maxrundate
WHERE row_num <> 1
AND (auth.product_family,event_name, event_id) NOT IN (SELECT product_family ,event_name, event_id
FROM audit.err_duplicate_event_id_ipv_journey_10)
FROM audit.err_duplicate_event_id_ipv_identity_issued_15)
GROUP BY
auth.Product_family,
event_name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ BEGIN
('IPR_USER_REDIRECTED','IPV_CRI_F2F','IPV','F2F CRI',' '),
('IPV_F2F_CRI_VC_CONSUMED','IPV_CRI_F2F','IPV','F2F CRI',' '),
('IPV_F2F_CRI_VC_RECEIVED','IPV_CRI_F2F','IPV','F2F CRI',' '),
('F2F_YOTI_RESPONSE_RECEIVED','IPV_CRI_F2F','IPV','F2F CRI',' ');
('F2F_YOTI_RESPONSE_RECEIVED','IPV_CRI_F2F','IPV','F2F CRI',' '),
('IPV_IDENTITY_ISSUED','IPV_JOURNEY','IPV','IPV Journey',' ');


--
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ALTER TABLE "conformed"."fact_user_journey_event"
ADD COLUMN CI_FAIL BOOLEAN default NULL;

ALTER TABLE "conformed"."fact_user_journey_event"
ADD COLUMN HAS_MITIGATIONS BOOLEAN default NULL;


ALTER TABLE "conformed"."fact_user_journey_event"
ADD COLUMN LEVEL_OF_CONFIDENCE VARCHAR(100) default NULL;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CREATE TABLE audit.err_duplicate_event_id_ipv_identity_issued_15 (
product_family character varying(100) ENCODE lzo,
total_duplicate_event_count_minus_one integer ENCODE az64,
event_name character varying(1000) ENCODE lzo,
event_id character varying(1000) ENCODE lzo,
timestamp_formatted character varying(100) ENCODE lzo,
created_by character varying(100) ENCODE lzo,
created_datetime date ENCODE az64
) DISTSTYLE AUTO;
16 changes: 16 additions & 0 deletions redshift-scripts/setup_process/redshift_setup_process_scripts.sql
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,22 @@ copy the contents of the files:

for each click [Run] button to create the stored procedure:

/****IPV_IDENTITY_ISSUED
1.alter_fact_user_journey_event_iii.sql
2.ref_events_insert_iii.sql(check this is added to main file)
3.create_err_duplicate_event_id_ipv_identity_issued_15.sql
4.v_stg_ipv_journey_ipv_identity_issued_temp.sql
5.sp_ipv_journey_ipv_identity_issued_temp.sql
--Update the daily file
6.v_stg_ipv_journey_update.sql -- Update the daily view
7.sp_ipv_journey_ipv_identity_issued_update.sql - update the daily proc
**/



/*
Database object privileges to group
Expand Down
4 changes: 4 additions & 0 deletions redshift-scripts/setup_process/ref_events.sql
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ INSERT INTO conformed.REF_EVENTS VALUES('IPV_F2F_CRI_VC_CONSUMED','IPV_CRI_F2F',
INSERT INTO conformed.REF_EVENTS VALUES('IPV_F2F_CRI_VC_RECEIVED','IPV_CRI_F2F','IPV','F2F CRI',' ');
INSERT INTO conformed.REF_EVENTS VALUES('F2F_YOTI_RESPONSE_RECEIVED','IPV_CRI_F2F','IPV','F2F CRI',' ');

--SOLO_IPV_IDENTITY_ISSUED
INSERT INTO conformed.REF_EVENTS VALUES('IPV_IDENTITY_ISSUED','IPV_JOURNEY','IPV','IPV Journey',' ');


Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,9 @@ P Sodhi 15/09/2023 Update to ipv_cri_kbv view.
1 EVENT_COUNT,
extensions_rejectionreason REJECTION_REASON,
extensions_reason REASON,
extensions_hasmitigations HAS_mitigations,
extensions_levelofconfidence LEVEL_OF_CONFIDENCE,
extensions_cifail CI_FAIL,
null NOTIFICATION_TYPE,
null MFA_TYPE,
null ACCOUNT_RECOVERY,
Expand Down
Loading

0 comments on commit 02b494d

Please sign in to comment.