-
Notifications
You must be signed in to change notification settings - Fork 166
update montlhy key metrics to have a shorter cw window #12411
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
Merged
Merged
Changes from all commits
Commits
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
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
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
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
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 |
|---|---|---|
|
|
@@ -28,60 +28,27 @@ | |
| idv_fraud_rejected: 0, | ||
| time_range: (end_date - 30.days).beginning_of_day..end_date, | ||
| ), | ||
| instance_double( | ||
| 'Reporting::IdentityVerificationReport', | ||
| blanket_proofing_rate: 0.4, | ||
| intent_proofing_rate: 0.5, | ||
| actual_proofing_rate: 0.6666666666666666, | ||
| industry_proofing_rate: 0.6666666666666666, | ||
| idv_started: 5, | ||
| idv_doc_auth_welcome_submitted: 4, | ||
| idv_doc_auth_socure_verification_data_requested: 0, | ||
| idv_doc_auth_image_vendor_submitted: 3, | ||
| successfully_verified_users: 2, | ||
| idv_doc_auth_rejected: 1, | ||
| idv_fraud_rejected: 1, | ||
| time_range: (end_date - 60.days).beginning_of_day..end_date, | ||
| ), | ||
| instance_double( | ||
| 'Reporting::IdentityVerificationReport', | ||
| blanket_proofing_rate: 0.5, | ||
| intent_proofing_rate: 0.6, | ||
| actual_proofing_rate: 0.75, | ||
| industry_proofing_rate: 0.75, | ||
| idv_started: 6, | ||
| idv_doc_auth_welcome_submitted: 5, | ||
| idv_doc_auth_image_vendor_submitted: 4, | ||
| idv_doc_auth_socure_verification_data_requested: 0, | ||
| successfully_verified_users: 3, | ||
| idv_doc_auth_rejected: 1, | ||
| idv_fraud_rejected: 2, | ||
| time_range: (end_date - 90.days).beginning_of_day..end_date, | ||
| ), | ||
| ], | ||
| ) | ||
| end | ||
|
|
||
| it 'renders a report with 30, 60, 90 day numbers' do | ||
| # rubocop:disable Layout/LineLength | ||
| it 'renders a report with only 30 day numbers' do | ||
| expected_csv = [ | ||
| ['Metric', 'Trailing 30d', 'Trailing 60d', 'Trailing 90d'], | ||
| ['Start Date', Date.new(2021, 12, 2), Date.new(2021, 11, 2), Date.new(2021, 10, 3)], | ||
| ['End Date', Date.new(2022, 1, 1), Date.new(2022, 1, 1), Date.new(2022, 1, 1)], | ||
| ['IDV Started', 4, 5, 6], | ||
| ['Welcome Submitted', 3, 4, 5], | ||
| ['Image Submitted', 2, 3, 4], | ||
| ['Socure', 0, 0, 0], | ||
| ['Successfully Verified', 1, 2, 3], | ||
| ['IDV Rejected (Non-Fraud)', 1, 1, 1], | ||
| ['IDV Rejected (Fraud)', 0, 1, 2], | ||
| ['Blanket Proofing Rate (IDV Started to Successfully Verified)', 1.0 / 4, 2.0 / 5, 3.0 / 6], | ||
| ['Intent Proofing Rate (Welcome Submitted to Successfully Verified)', 1.0 / 3, 2.0 / 4, 3.0 / 5], | ||
| ['Actual Proofing Rate (Image Submitted to Successfully Verified)', 1.0 / 2, 2.0 / 3, 3.0 / 4], | ||
| ['Industry Proofing Rate (Verified minus IDV Rejected)', 1.0 / 2, 2.0 / 3, 3.0 / 4], | ||
| ['Metric', 'Trailing 30d'], | ||
| ['Start Date', Date.new(2021, 12, 2)], | ||
| ['End Date', Date.new(2022, 1, 1)], | ||
| ['IDV Started', 4], | ||
| ['Welcome Submitted', 3], | ||
| ['Image Submitted', 2], | ||
| ['Socure', 0], | ||
| ['Successfully Verified', 1], | ||
| ['IDV Rejected (Non-Fraud)', 1], | ||
| ['IDV Rejected (Fraud)', 0], | ||
| ['Blanket Proofing Rate (IDV Started to Successfully Verified)', 1.0 / 4], | ||
| ['Intent Proofing Rate (Welcome Submitted to Successfully Verified)', 1.0 / 3], | ||
| ['Actual Proofing Rate (Image Submitted to Successfully Verified)', 1.0 / 2], | ||
| ['Industry Proofing Rate (Verified minus IDV Rejected)', 1.0 / 2], | ||
| ] | ||
| # rubocop:enable Layout/LineLength | ||
|
|
||
| aggregate_failures do | ||
| report.as_csv.zip(expected_csv).each do |actual, expected| | ||
| expect(actual).to eq(expected) | ||
|
|
@@ -141,8 +108,6 @@ | |
| expect(report.reports.map(&:time_range)).to eq( | ||
| [ | ||
| (end_date - 30.days).beginning_of_day..end_date, | ||
| (end_date - 60.days).beginning_of_day..end_date, | ||
| (end_date - 90.days).beginning_of_day..end_date, | ||
| ], | ||
| ) | ||
|
|
||
|
|
@@ -152,17 +117,17 @@ | |
| cloudwatch_client: report.cloudwatch_client, | ||
| ).once | ||
|
|
||
| expect(Reporting::IdentityVerificationReport).to have_received(:new).with( | ||
| expect(Reporting::IdentityVerificationReport).not_to have_received(:new).with( | ||
| time_range: (end_date - 60.days).beginning_of_day..(end_date - 30.days).end_of_day, | ||
| issuers: nil, | ||
| cloudwatch_client: report.cloudwatch_client, | ||
| ).once | ||
| ) | ||
|
|
||
| expect(Reporting::IdentityVerificationReport).to have_received(:new).with( | ||
| expect(Reporting::IdentityVerificationReport).not_to have_received(:new).with( | ||
| time_range: (end_date - 90.days).beginning_of_day..(end_date - 60.days).end_of_day, | ||
| issuers: nil, | ||
| cloudwatch_client: report.cloudwatch_client, | ||
| ).once | ||
| ) | ||
|
||
| end | ||
| end | ||
| end | ||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the smallest reversible refactor I can think of.