diff --git a/app/services/db/doc_auth_log/drop_off_rates_helper.rb b/app/services/db/doc_auth_log/drop_off_rates_helper.rb index 28df7f116ee..e5ca274c68f 100644 --- a/app/services/db/doc_auth_log/drop_off_rates_helper.rb +++ b/app/services/db/doc_auth_log/drop_off_rates_helper.rb @@ -1,8 +1,8 @@ module Db module DocAuthLog module DropOffRatesHelper - STEPS = %w[welcome agreement capture_document ssn verify_info phone - encrypt personal_key verified].freeze + STEPS = %w[welcome agreement capture_document cap_doc_submit ssn verify_info + verify_submit phone encrypt personal_key verified].freeze private @@ -27,9 +27,14 @@ def select_count_from_profiles_where_verified_and_active def select_counts_from_doc_auth_logs <<~SQL select count(welcome_view_at) as welcome, count(agreement_view_at) as agreement, count(upload_view_at) as upload_option, - count(COALESCE(back_image_view_at,mobile_back_image_view_at,capture_mobile_back_image_view_at,present_cac_view_at)) as capture_document, + count(COALESCE(back_image_view_at,mobile_back_image_view_at,capture_mobile_back_image_view_at,present_cac_view_at,document_capture_view_at)) as capture_document, + count(COALESCE(case when document_capture_submit_count>0 then 1 else null end, + case when back_image_submit_count>0 then 1 else null end, + case when capture_mobile_back_image_submit_count>0 then 1 else null end, + case when mobile_back_image_submit_count>0 then 1 else null end)) as cap_doc_submit, count(COALESCE(ssn_view_at,enter_info_view_at)) as ssn, count(verify_view_at) as verify_info, + count(COALESCE(case when verify_submit_count>0 then 1 else null end)) as verify_submit, count(verify_phone_view_at) as phone, count(encrypt_view_at) as encrypt, count(verified_view_at) as personal_key diff --git a/spec/features/reports/doc_auth_drop_off_rates_report_spec.rb b/spec/features/reports/doc_auth_drop_off_rates_report_spec.rb index c25073935a5..a1fae8b3cb1 100644 --- a/spec/features/reports/doc_auth_drop_off_rates_report_spec.rb +++ b/spec/features/reports/doc_auth_drop_off_rates_report_spec.rb @@ -4,4 +4,11 @@ it 'does not throw an error' do expect(Reports::DocAuthDropOffRatesReport.new.call).to be_present end + + it 'has all the steps in the funnel report in the left most column and justified' do + report = Reports::DocAuthDropOffRatesReport.new.call + Db::DocAuthLog::DropOffRatesHelper::STEPS.each do |step| + expect(report.include?(format("\n%20s", step))).to be true + end + end end