diff --git a/app/builders/v2/reports/concerns/rollup_conditions.rb b/app/builders/v2/reports/concerns/rollup_conditions.rb index 0cda631e4..8fa364322 100644 --- a/app/builders/v2/reports/concerns/rollup_conditions.rb +++ b/app/builders/v2/reports/concerns/rollup_conditions.rb @@ -8,7 +8,7 @@ module V2::Reports::Concerns::RollupConditions bot_handoffs_count: :bot_handoffs_count }.freeze - SUPPORTED_DIMENSIONS = %w[account agent inbox team].freeze + SUPPORTED_DIMENSIONS = %w[account agent inbox].freeze def use_rollup? # Condition 0: reporting_timezone must be configured on account @@ -70,6 +70,6 @@ module V2::Reports::Concerns::RollupConditions end def dimension_type_to_rollup - { 'account' => :account, 'agent' => :agent, 'inbox' => :inbox, 'team' => :team }[params[:type].to_s] + { 'account' => :account, 'agent' => :agent, 'inbox' => :inbox }[params[:type].to_s] end end diff --git a/app/services/reporting_events/backfill_service.rb b/app/services/reporting_events/backfill_service.rb index a52d82534..428549cad 100644 --- a/app/services/reporting_events/backfill_service.rb +++ b/app/services/reporting_events/backfill_service.rb @@ -96,6 +96,8 @@ class ReportingEvents::BackfillService 'account' => @account.id, 'agent' => event.user_id, 'inbox' => event.inbox_id, + # Team rollups are still collected for validation/future use, but team reports + # currently stay on the raw path because reassignment breaks rollup parity. 'team' => event.conversation&.team_id } end diff --git a/app/services/reporting_events/rollup_service.rb b/app/services/reporting_events/rollup_service.rb index e1fe8be1f..7cc0c3857 100644 --- a/app/services/reporting_events/rollup_service.rb +++ b/app/services/reporting_events/rollup_service.rb @@ -45,6 +45,8 @@ module ReportingEvents::RollupService account: @account.id, agent: @reporting_event.user_id, inbox: @reporting_event.inbox_id, + # Team rollups are still collected for validation/future use, but team reports + # currently stay on the raw path because reassignment breaks rollup parity. team: team_id } end diff --git a/spec/builders/v2/reports/concerns/rollup_conditions_spec.rb b/spec/builders/v2/reports/concerns/rollup_conditions_spec.rb index b13ea2e5f..dc817a27f 100644 --- a/spec/builders/v2/reports/concerns/rollup_conditions_spec.rb +++ b/spec/builders/v2/reports/concerns/rollup_conditions_spec.rb @@ -164,10 +164,10 @@ describe V2::Reports::Concerns::RollupConditions do expect(builder.use_rollup?).to be true end - it 'returns true for team dimension' do + it 'returns false for team dimension' do builder.params = valid_params.merge(type: 'team') - expect(builder.use_rollup?).to be true + expect(builder.use_rollup?).to be false end end @@ -267,9 +267,9 @@ describe V2::Reports::Concerns::RollupConditions do expect(builder.dimension_type_to_rollup).to eq(:inbox) end - it 'maps team type to team' do + it 'returns nil for team type' do builder.params = { type: 'team' } - expect(builder.dimension_type_to_rollup).to eq(:team) + expect(builder.dimension_type_to_rollup).to be_nil end it 'returns nil for unsupported type' do