iachat/app/javascript/dashboard/store
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
..
captain feat: remove Notificações Automáticas + ajusta assinatura WhatsApp 2026-04-23 15:34:45 -03:00
modules feat(reports): filtro por inbox no Relatório do Bot 2026-04-26 11:47:46 -03:00
utils feat: Prevent saving preferences and status when impersonating (#11164) 2025-05-20 17:34:30 -07:00
constants.js fix: stale report value shown if summary fetch breaks (#11270) 2025-04-15 20:18:06 +05:30
index.js feat: remove Notificações Automáticas + ajusta assinatura WhatsApp 2026-04-23 15:34:45 -03:00
mutation-types.js feat(reports): aba "Novas × Retorno" no Inbox Report 2026-04-25 20:22:43 -03:00
storeFactory.js feat: Add Pinia support and relocate store factory (#12854) 2025-11-28 16:31:59 +05:30
storeFactory.spec.js feat: Add Pinia support and relocate store factory (#12854) 2025-11-28 16:31:59 +05:30
storeFactoryHelper.js feat: Add Pinia support and relocate store factory (#12854) 2025-11-28 16:31:59 +05:30