chore: disable team rollup read
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user