-
Notifications
You must be signed in to change notification settings - Fork 165
312: Update API Transaction Count report #12733
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
Closed
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
f7ef7de
report updates
67f5049
Changelog: Internal, Internal Report, API Transaction count report up…
e5e3cba
update query and spec to add aamva
a815141
Query fix
d0956f4
added exception for aamva
df463c2
Query fixes
9c8b3ed
spec update
796d11d
updated spec
587ab2b
Updated query
bebb5ca
Updated query
94d1314
Updated spec
10b8ff4
Rever accidental change:
8e186a3
Updated spec
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -80,6 +80,9 @@ def api_transaction_count | |
| 'Threat Metrix (IDV)', | ||
| 'Threat Metrix (Auth Only)', | ||
| 'LN Emailage', | ||
| 'GPO', | ||
| 'AAMVA', | ||
| 'Socure PhoneRisk (Shadow)', | ||
| ], | ||
| [ | ||
| "#{ time_range.begin.to_date} - #{time_range.end.to_date}", | ||
|
|
@@ -94,6 +97,9 @@ def api_transaction_count | |
| threat_metrix_idv_table.first, | ||
| threat_metrix_auth_only_table.first, | ||
| ln_emailage_table.first, | ||
| gpo_table.first, | ||
| aamva_table.first, | ||
| socure_phonerisk_table.first, | ||
| ], | ||
| ] | ||
| end | ||
|
|
@@ -120,13 +126,6 @@ def true_id_selfie_table | |
| [true_id_selfie_table_count, result] | ||
| end | ||
|
|
||
| # def true_id_selfie_table | ||
| # result = fetch_results(query: true_id_selfie_query) | ||
| # # Sum all the individual counts | ||
| # true_id_selfie_table_count = result.sum { |r| r['total_count'].to_i } | ||
| # [true_id_selfie_table_count, result] | ||
| # end | ||
|
|
||
| def phone_finder_table | ||
| result = fetch_results(query: phone_finder_query) | ||
| phone_finder_table_count = result.count | ||
|
|
@@ -157,12 +156,6 @@ def ln_emailage_table | |
| [ln_emailage_table_count, result] | ||
| end | ||
|
|
||
| # def ln_emailage_table | ||
| # result = fetch_results(query: ln_emailage_count_query) | ||
| # ln_emailage_table_count = result.sum { |r| r['total_count'].to_i } | ||
| # [ln_emailage_table_count, result] | ||
| # end | ||
|
|
||
| def instant_verify_table | ||
| result = fetch_results(query: instant_verify_query) | ||
| instant_verify_table_count = result.count | ||
|
|
@@ -187,6 +180,24 @@ def fraud_score_and_attribute_table | |
| [fraud_score_and_attribute_table_count, result] | ||
| end | ||
|
|
||
| def gpo_table | ||
| result = fetch_results(query: gpo_query) | ||
| gpo_table_count = result.count | ||
| [gpo_table_count, result] | ||
| end | ||
|
|
||
| def aamva_table | ||
| result = fetch_results(query: aamva_query) | ||
| aamva_table_count = result.count | ||
| [aamva_table_count, result] | ||
| end | ||
|
|
||
| def socure_phonerisk_table | ||
| result = fetch_results(query: socure_phonerisk_query) | ||
| socure_phonerisk_table_count = result.count | ||
| [socure_phonerisk_table_count, result] | ||
| end | ||
|
|
||
| def fetch_results(query:) | ||
| Rails.logger.info("Executing query: #{query}") | ||
| Rails.logger.info("Time range: #{time_range.begin.to_time} to #{time_range.end.to_time}") | ||
|
|
@@ -384,6 +395,41 @@ def ln_emailage_query | |
| | limit 10000 | ||
| QUERY | ||
| end | ||
|
|
||
| def gpo_query | ||
| <<~QUERY | ||
| fields @timestamp, @message, @log, id | ||
| |filter name = 'gpo_confirmation_upload' #GPO confirmation records were uploaded for letter sends | ||
| | stats count(*) as gpo_transactions | ||
| | limit 10000 | ||
| QUERY | ||
| end | ||
|
|
||
| def aamva_query | ||
| <<~QUERY | ||
| fields @timestamp, @message, @log, id | ||
| | filter name IN ['IdV: doc auth verify proofing results', ‘idv_state_id_validation’] | ||
| | fields jsonParse(@message) as message | ||
| | unnest message.properties.event_properties.proofing_results.context.stages.state_id into state_id | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @koseni123 @shilenpatel1 for this, we should just need should_proof_state_id=true as the filter within this event property and something indicating that we got a response from AAMVA. success or failure at the event level doesnt matter. |
||
| | unnest message.properties.event_properties.proofing_results.context.should_proof_state_id into @should_proof_state_id | ||
| | fields state_id.vendor_name as @vendor_name, name, | ||
| coalesce(@vendor_name,properties.event_properties.vendor_name) as vendor_name , | ||
| coalesce(@should_proof_state_id,0) as should_proof_state_id | ||
| | filter (name = 'IdV: doc auth verify proofing results' and should_proof_state_id = 1) or (name = 'idv_state_id_validation') | ||
| | filter vendor_name = 'aamva:state_id' | ||
| | stats count(*) as aamva_transactions_ipp | ||
| | limit 10000 | ||
| QUERY | ||
| end | ||
|
|
||
| def socure_phonerisk_query | ||
koseni123 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <<~QUERY | ||
| fields @timestamp, @message, @log, id | ||
| | filter name IN ["idv_socure_shadow_mode_phonerisk_result"] | ||
| | stats count(*) as socure_phonerisk_transactions | ||
| | limit 10000 | ||
| QUERY | ||
| end | ||
| end | ||
| end | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.