iachat/app/javascript/dashboard
Rodribm10 e9b8b6e587 feat(reports): filtro por inbox no Relatório do Bot
Hoje as métricas e séries do BotReports agregam toda a conta — não dá pra ver
"a Jasmine da PrimeAL está errando mais que a do Qnn01". Cada unidade tem
prompt próprio, então um sintoma localizado precisa de medição localizada.

Backend:
- Inbox#has_many :reporting_events (relação inversa que faltava)
- BotMetricsBuilder aceita inbox_id e filtra bot_conversations + base_reporting_events
- bot_metrics endpoint passa inbox_id pelos params permitidos
- count_report_builder já suporta scope=inbox; agora funciona pra
  bot_resolutions_count e bot_handoffs_count graças à relação acima

Frontend:
- BotReports.vue: ReportFilters com filter-type='inboxes' e dropdown ativo
- Quando uma inbox é escolhida, requestPayload inclui inboxId/type/id e os
  fetches (BotMetrics + ReportContainer) passam o filtro
- API client getBotMetrics aceita inboxId; getBotSummary aceita type+id
- Sem inbox selecionada: comportamento antigo (agregação da conta)

Bonus na rake task de retroativo:
- rebuild_bot_resolved.rake: Message.unscope(:order) pra evitar conflito
  PG::InvalidColumnReference (DISTINCT + ORDER BY default scope)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 11:47:46 -03:00
..
api feat(reports): filtro por inbox no Relatório do Bot 2026-04-26 11:47:46 -03:00
assets Merge branch 'main' into chore/merge-upstream-4.11.0 2026-02-17 23:05:26 -03:00
components feat(aggressive-alert): filtro por inbox configurável por admin 2026-04-24 11:51:00 -03:00
components-next feat: remove Notificações Automáticas + ajusta assinatura WhatsApp 2026-04-23 15:34:45 -03:00
composables feat(captain-memory): wire Contact Memories section into conversation sidebar 2026-04-19 07:30:30 -03:00
constants chore: Improve signup flow, reduce the number of inputs (#13350) 2026-01-22 18:47:42 -08:00
helper feat(aggressive-alert): filtro por inbox configurável por admin 2026-04-24 11:51:00 -03:00
i18n fix(reports): inbox_id reativo + nome da inbox visível na tab Novas × Retorno 2026-04-26 09:14:44 -03:00
mixins Chore/merge upstream 4.8.0 (#150) 2025-11-19 16:25:58 -03:00
modules feat: Adiciona a opção "Criar FAQ" no menu de contexto da mensagem, permitindo criar uma resposta com seleção de assistente. 2026-02-28 22:20:43 -03:00
routes feat(reports): filtro por inbox no Relatório do Bot 2026-04-26 11:47:46 -03:00
store feat(reports): filtro por inbox no Relatório do Bot 2026-04-26 11:47:46 -03:00
stores feat: Voice Channel (#11602) 2025-12-19 12:41:33 -08:00
App.vue feat(dashboard): aggressive alert on conversation reopening 2026-04-23 18:03:26 -03:00
featureFlags.js chore(style): fix rubocop offenses and update typing indicators 2026-02-25 15:06:58 -03:00