iachat/app/controllers/api/v1/accounts
Rodrigo Borba 87bff8126c feat(captain): add AI reports page with insights generation
Implementa a página Relatórios IA com geração de análises semanais
por IA baseadas nas conversas de cada unidade/caixa de entrada.

Funcionalidades:
- Página /settings/captain/reports com dois tabs (Insights IA / Operacional)
- Botão "Gerar Análise" que enfileira job Sidekiq
- Filtro por unidade ou caixa de entrada
- Exibe insights com status (pendente/processando/concluído/falhou)
- Mostra top_topics, ai_failures e period_summary
- Estado vazio com CTA para gerar primeiro relatório

Backend:
- InsightsController com endpoints index/show/generate
- GenerateInsightsJob que processa conversas com LLM
- ConversationInsightService com chunking e merge inteligente
- Migração para adicionar inbox_id à tabela captain_conversation_insights
- Link sidebar "Relatórios IA" em /settings/captain/reports

Frontend:
- Vuex store captainReports com actions/mutations/getters
- API client CaptainReportsAPI (getInsights, generateInsight)
- i18n en e pt_BR para CAPTAIN_REPORTS.*

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-27 07:05:58 -03:00
..
actions feat: Reverse the contact merge (#8057) 2023-10-10 08:20:48 +05:30
assignment_policies feat: Add assignment policies controllers with jbuilder views (#12199) 2025-08-18 19:15:21 -07:00
captain feat(captain): add AI reports page with insights generation 2026-02-27 07:05:58 -03:00
channels fix: Remove account_id from params since it is not used (#13116) 2025-12-19 17:07:53 -08:00
contacts feat: Add support for search_conversations in copilot (#11520) 2025-05-20 19:22:17 -07:00
conversations fix: clear source_id when retrying message to prevent skipping (#222) 2026-02-24 14:45:07 -03:00
google refactor: use state-based authentication (#11690) 2025-06-18 17:39:06 +05:30
inboxes Fix Wuzapi webhook handling 2026-02-26 10:49:00 -03:00
instagram refactor: use state-based authentication (#11690) 2025-06-18 17:39:06 +05:30
integrations Revert "chore: Upgrade Rails to 7.2.2 and update Gemfile dependencies (#11037)" 2026-02-03 21:09:42 -08:00
microsoft refactor: use state-based authentication (#11690) 2025-06-18 17:39:06 +05:30
notion feat: Whatsapp embedded signup (#11612) 2025-07-14 21:37:06 -07:00
tiktok feat: TikTok channel (#12741) 2025-12-17 07:54:50 -08:00
twitter fix: Twitter inbox creation error (#1783) 2021-02-16 19:35:10 +05:30
whatsapp chore: Enable flexible whatsapp onboarding (Manual + Embedded Signup) options (#12344) 2025-09-15 19:59:56 +05:30
agent_bots_controller.rb Chore/merge upstream 4.8.0 (#150) 2025-11-19 16:25:58 -03:00
agents_controller.rb fix: Removing repetitive name parameter in AgentsController (#11259) 2025-04-09 08:53:13 +05:30
articles_controller.rb Chore/merge upstream 4.8.0 (#150) 2025-11-19 16:25:58 -03:00
assignable_agents_controller.rb chore: Add Assignable Agents API (#4722) 2022-05-23 19:24:07 +05:30
assignment_policies_controller.rb feat: Add assignment policies controllers with jbuilder views (#12199) 2025-08-18 19:15:21 -07:00
automation_rules_controller.rb fix: Validate blob before attaching it to a record (#13115) 2025-12-19 19:02:21 -08:00
base_controller.rb Feat: authenticate direct upload (#4160) 2022-03-16 13:54:18 +05:30
bulk_actions_controller.rb Chore/merge upstream 4.8.0 (#150) 2025-11-19 16:25:58 -03:00
callbacks_controller.rb Merge branch 'main' into chore/merge-upstream-4.5.0 2025-08-20 11:20:31 -03:00
campaigns_controller.rb feat: WhatsApp campaigns (#11910) 2025-07-16 09:04:02 +05:30
canned_responses_controller.rb fix: order for canned response (#6400) 2023-02-06 12:53:48 -08:00
categories_controller.rb feat: Adds the ability to set an emoji for help center category (#8111) 2023-10-20 13:52:30 +05:30
contact_inboxes_controller.rb chore: Add an API to find the contacts using contact inbox sourceId (#8012) 2023-09-28 15:26:28 -07:00
contacts_controller.rb feat: Add infinite scroll to contacts search page (#13376) 2026-01-27 18:55:19 -08:00
conversations_controller.rb Merge branch 'main' into chore/merge-upstream-4.11.0 2026-02-17 23:05:26 -03:00
csat_survey_responses_controller.rb feat(ee): Review Notes for CSAT Reports (#13289) 2026-01-15 19:53:57 -08:00
custom_attribute_definitions_controller.rb feat: Support Regex validation for custom attributes (#7856) 2024-01-23 18:01:57 +04:00
custom_filters_controller.rb fix: Allow resource access without filter type in custom_filters API (#11445) 2025-05-08 20:12:05 -07:00
dashboard_apps_controller.rb feat: dashboard apps on sidebar (#146) 2025-11-19 14:44:18 -03:00
inbox_csat_templates_controller.rb feat: Implement existing template linking for CSAT surveys (#218) 2026-02-18 18:00:29 -03:00
inbox_members_controller.rb feat: invalidate cache after inbox members or team members update (#10869) 2025-02-20 21:28:38 -08:00
inboxes_controller.rb chore(style): fix rubocop offenses and update typing indicators 2026-02-25 15:06:58 -03:00
labels_controller.rb chore: Use "destroy!" instead of "destroy" when not checking the return value (#4259) 2022-03-24 13:28:25 +05:30
macros_controller.rb fix: Validate blob before attaching it to a record (#13115) 2025-12-19 19:02:21 -08:00
notification_settings_controller.rb Chore: Code Cleanup in API controllers (#932) 2020-06-07 13:58:05 +05:30
notifications_controller.rb chore: apply Rails/SaveBang cop (#15) 2025-04-03 23:29:24 -03:00
oauth_authorization_controller.rb refactor: use state-based authentication (#11690) 2025-06-18 17:39:06 +05:30
portals_controller.rb Merge branch main into chore/merge-upstream 2025-12-20 12:44:31 -03:00
search_controller.rb feat: Advanced Search Backend (#12917) 2026-01-07 15:30:49 +05:30
team_members_controller.rb feat: invalidate cache after inbox members or team members update (#10869) 2025-02-20 21:28:38 -08:00
teams_controller.rb chore: Use "destroy!" instead of "destroy" when not checking the return value (#4259) 2022-03-24 13:28:25 +05:30
upload_controller.rb fix: Validate blob before attaching it to a record (#13115) 2025-12-19 19:02:21 -08:00
webhooks_controller.rb feat(webhooks): add name to webhook (#12641) 2025-11-13 13:28:15 +05:30
working_hours_controller.rb feat: Business hours 2020-11-01 00:14:33 +05:30