iachat/spec/builders
Pranav 5ec77aca64
feat: Add first response time distribution report endpoint (#13400)
The index is already added in production.

Adds a new reporting API that returns conversation counts grouped by
channel type and first response time buckets (0-1h, 1-4h, 4-8h, 8-24h,
24h+).

- GET /api/v2/accounts/:id/reports/first_response_time_distribution
- Uses SQL aggregation to handle large datasets efficiently
- Adds composite index on reporting_events for query performance

Tested on production workload.
Request: GET
`/api/v2/accounts/1/reports/first_response_time_distribution?since=<since>&until=<until>`
Response payload:
```
{
    "Channel::WebWidget": {
      "0-1h": 120,
      "1-4h": 85,
      "4-8h": 32,
      "8-24h": 12,
      "24h+": 3
    },
    "Channel::Email": {
      "0-1h": 12,
      "1-4h": 28,
      "4-8h": 45,
      "8-24h": 35,
      "24h+": 10
    },
    "Channel::FacebookPage": {
      "0-1h": 50,
      "1-4h": 30,
      "4-8h": 15,
      "8-24h": 8,
      "24h+": 2
    }
  }
```

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2026-01-30 22:22:27 +04:00
..
campaigns
csat_surveys
email feat: Clean up email configuration for from and reply to emails (#12453) 2025-09-24 11:36:53 -07:00
messages feat: Display story replies with attachment and context label (#13356) 2026-01-28 16:47:04 +04:00
v2 feat: Add first response time distribution report endpoint (#13400) 2026-01-30 22:22:27 +04:00
account_builder_spec.rb fix: account email validation during signup (#11307) 2025-05-20 20:45:39 -07:00
agent_builder_spec.rb
contact_inbox_builder_spec.rb
contact_inbox_with_contact_builder_spec.rb
conversation_builder_spec.rb
notification_builder_spec.rb
year_in_review_builder_spec.rb feat(ce): Add Year in review feature (#13078) 2025-12-15 17:24:45 -08:00