iachat/enterprise/app/controllers/api/v1/accounts
Rodribm10 cfffea9c16 feat(captain): semantic memory fixes + roleta + reclamações + analytics
Consolida o trabalho desta branch de abril/2026 em um bloco pronto pra
testar em staging antes do merge pra main.

## Correções de memória semântica
- ExtractionService: Princípio Zero + Regra de Ouro (ação consumada vs intenção).
- Cenário Daniela_Reservas: Passo 0 de classificação (consulta/intenção/fora).

## Roleta da Sorte (end-to-end)
- Schema Supabase + 7 RPCs atômicas (server-side, idempotentes).
- Services: Offer, Redeem, WeeklyReport.
- Jobs: OfferRouletteJob (hook em ConfirmationService após Pix pago),
  NotifyRevealed + Scheduler de fallback.
- Tool manual GenerateRoletaLinkTool + endpoint público /roleta/notify.
- Dashboard /captain/roleta com Resgate + Relatório + anomaly detection.

## Cenário Reclamacoes_Ouvidoria
- Triagem P1-P4, framework LAST, Three-level listening, Self-check.
- Sem compensação material, detecção de cliente frustrado eleva prioridade.

## Analytics
- Funil de conversão /captain/funnel: 5 etapas via regex, zero LLM.
- Detector de churn via ChurnOutreach* (cron dias úteis 10h-17h BRT).

## Trabalho pré-existente incluído
- Captain Executive Reports (ceo_digest, mattermost_delivery).
- get_reserva_preco_tool, Lifecycle ajustes, Reservations UI polimentos.

## Outros
- .gitignore: patterns pra credenciais.
- Migrations de scenarios idempotentes.
- i18n completa pt_BR+en pra roleta/funnel.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 15:36:25 -03:00
..
agent_capacity_policies fix: Assignment V2 controller fix (#12415) 2025-09-11 19:32:33 +07:00
captain feat(captain): semantic memory fixes + roleta + reclamações + analytics 2026-04-21 15:36:25 -03:00
contacts fix(captain-memory): always authorize index even when list is empty 2026-04-19 01:43:57 -03:00
agent_capacity_policies_controller.rb fix: Assignment V2 controller fix (#12415) 2025-09-11 19:32:33 +07:00
applied_slas_controller.rb feat: SLA reports view (#9189) 2024-04-09 10:14:36 +10:00
audit_logs_controller.rb chore: Improve logging for ip look up and audit logs [CW-2145] (#7512) 2023-07-27 16:48:30 +05:30
companies_controller.rb feat: Add sorting by contacts count to companies list (#13012) 2026-01-09 15:20:08 -08:00
conference_controller.rb feat(enterprise): add voice conference API (#13064) 2025-12-15 15:11:59 -08:00
custom_roles_controller.rb chore: upgrade ruby version to 3.4.4 (#11524) 2025-05-21 19:40:07 +05:30
enterprise_accounts_controller.rb feat: Conversation API to return applied_sla and sla_events (#9174) 2024-04-01 23:30:07 +05:30
reporting_events_controller.rb Chore/merge upstream 4.8.0 (#150) 2025-11-19 16:25:58 -03:00
saml_settings_controller.rb Chore/merge upstream 4.8.0 (#150) 2025-11-19 16:25:58 -03:00
sla_policies_controller.rb fix: Prevent SLA deletion timeouts by moving to async job (#12944) 2025-12-10 12:28:47 +05:30