From 4bf23adcf5d38e4958b6b37fd6b4e1a48c620153 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Thu, 18 Jan 2024 16:06:13 +0530 Subject: [PATCH] feat: use `short_summary` for downloading reports [CW-2962] (#8733) --- app/builders/v2/report_builder.rb | 8 ++++++++ app/helpers/api/v2/accounts/reports_helper.rb | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/builders/v2/report_builder.rb b/app/builders/v2/report_builder.rb index 1442c5799..2725c55a3 100644 --- a/app/builders/v2/report_builder.rb +++ b/app/builders/v2/report_builder.rb @@ -46,6 +46,14 @@ class V2::ReportBuilder } end + def short_summary + { + conversations_count: conversations.count, + avg_first_response_time: avg_first_response_time_summary, + avg_resolution_time: avg_resolution_time_summary + } + end + def conversation_metrics if params[:type].equal?(:account) live_conversations diff --git a/app/helpers/api/v2/accounts/reports_helper.rb b/app/helpers/api/v2/accounts/reports_helper.rb index 0604eba2f..3d87154fd 100644 --- a/app/helpers/api/v2/accounts/reports_helper.rb +++ b/app/helpers/api/v2/accounts/reports_helper.rb @@ -37,7 +37,7 @@ module Api::V2::Accounts::ReportsHelper business_hours: ActiveModel::Type::Boolean.new.cast(params[:business_hours]) } ) - ).summary + ).short_summary end private