iachat/config/locales
Shivam Mishra 9967101b48
feat(rollup): add models and write path [1/3] (#13796)
## PR#1: Reporting events rollup — model and write path

Reporting queries currently hit the `reporting_events` table directly.
This works, but the table grows linearly with event volume, and
aggregation queries (counts, averages over date ranges) get
progressively slower as accounts age.

This PR introduces a pre-aggregated `reporting_events_rollups` table
that stores daily per-metric, per-dimension (account/agent/inbox)
totals. The write path is intentionally decoupled from the read path —
rollup rows are written inline from the event listener via upsert, and a
backfill service exists to rebuild historical data from raw events.
Nothing reads from this table yet.

The write path activates when an account has a `reporting_timezone` set
(new account setting). The `reporting_events_rollup` feature flag
controls only the future read path, not writes — so rollup data
accumulates silently once timezone is configured. A `MetricRegistry`
maps raw event names to rollup column semantics in one place, keeping
the write and (future) read paths aligned.

### What changed

- Migration for `reporting_events_rollups` with a unique composite index
for upsert
- `ReportingEventsRollup` model
- `reporting_timezone` account setting with IANA timezone validation
- `MetricRegistry` — single source of truth for event-to-metric mappings
- `RollupService` — real-time upsert from event listener
- `BackfillService` — rebuilds rollups for a given account + date from
raw events
- Rake tasks for interactive backfill and timezone setup
- `reporting_events_rollup` feature flag (disabled by default)

### How to test

1. Set a `reporting_timezone` on an account
(`Account.first.update!(reporting_timezone: 'Asia/Kolkata')`)
2. Resolve a conversation or trigger a first response
3. Check `ReportingEventsRollup.where(account_id: ...)` — rows should
appear
4. Run backfill: `bundle exec rake reporting_events_rollup:backfill` and
verify historical data populates

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2026-03-19 13:12:36 +05:30
..
am.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
ar.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
az.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
bg.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
bn.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
ca.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
cs.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
da.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
de.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
devise.am.yml chore: Update translations (#7728) 2023-08-15 13:47:38 -07:00
devise.ar.yml chore: Update translations (#9946) 2024-08-16 14:06:32 +05:30
devise.az.yml chore: Update translations (#10549) 2025-01-14 22:00:56 +05:30
devise.bg.yml chore: New Crowdin updates (#3616) 2021-12-19 11:38:02 +05:30
devise.bn.yml chore: Update translations (#12722) 2025-10-27 17:54:15 +05:30
devise.ca.yml chore: Update translations (#13832) 2026-03-17 16:02:40 -07:00
devise.cs.yml Chore: Add ro, fr, pt_BR translation files (#827) 2020-05-06 14:24:20 +05:30
devise.da.yml chore: Enable Danish language (#1443) 2020-11-24 23:07:51 +05:30
devise.de.yml chore: Update translations (#4099) 2022-03-17 20:02:32 +05:30
devise.el.yml Chore: New Crowdin translations (#747) 2020-04-23 23:52:16 +05:30
devise.en.yml Feature/update confirmation email information (#145) 2019-10-14 14:24:58 +05:30
devise.es.yml chore: New Crowdin Translation updates (#2063) 2021-04-19 15:10:16 +05:30
devise.et.yml chore: Update translations (#12722) 2025-10-27 17:54:15 +05:30
devise.fa.yml chore: Update translations, Add Norwegian(no) (#1675) 2021-01-28 14:03:52 +05:30
devise.fi.yml chore: Update translations (#1502) 2020-12-09 16:43:51 +05:30
devise.fr.yml Chore: New Crowdin translations (#747) 2020-04-23 23:52:16 +05:30
devise.he.yml chore: Update translations (#6895) 2023-04-17 14:45:49 +05:30
devise.hi.yml Chore: Include Tamil, Arabic, other language updates (#1018) 2020-07-08 00:59:30 +05:30
devise.hr.yml chore: Update translations (#9946) 2024-08-16 14:06:32 +05:30
devise.hu.yml chore: New translation updates 2021-03-16 00:00:53 +05:30
devise.hy.yml chore: Update translations 2023-03-08 14:00:00 +05:30
devise.id.yml chore: Update translations (#13832) 2026-03-17 16:02:40 -07:00
devise.is.yml chore: Update translations from Crowdin (#5810) 2022-11-08 09:36:24 -08:00
devise.it.yml chore: Update to the latest translations (#3923) 2022-02-07 17:19:34 +05:30
devise.ja.yml chore: Update translations (#13832) 2026-03-17 16:02:40 -07:00
devise.ka.yml chore: Enable Thai language (th), update translations (#5095) 2022-07-26 09:52:59 +05:30
devise.ko.yml feat(i18n): complete Korean (ko) translations to 100% coverage (#13583) 2026-03-16 16:54:26 -07:00
devise.lt.yml chore: Update translations (#7347) 2023-06-19 17:27:43 +05:30
devise.lv.yml chore: Update translations from Crowdin (#5523) 2022-09-28 21:59:41 -07:00
devise.ml.yml chore: Update to the latest translations (#3923) 2022-02-07 17:19:34 +05:30
devise.ms.yml chore: Update translations (#13832) 2026-03-17 16:02:40 -07:00
devise.ne.yml chore: Update translations, Add Norwegian(no) (#1675) 2021-01-28 14:03:52 +05:30
devise.nl.yml Add new translations (#862) 2020-05-16 18:07:19 +05:30
devise.no.yml chore: Update translations, Add Norwegian(no) (#1675) 2021-01-28 14:03:52 +05:30
devise.pl.yml Chore: Add ro, fr, pt_BR translation files (#827) 2020-05-06 14:24:20 +05:30
devise.pt_BR.yml chore: Update translations (#1502) 2020-12-09 16:43:51 +05:30
devise.pt.yml Chore: Add pt and pt_BR translations (#813) 2020-05-04 17:33:55 +05:30
devise.ro.yml chore: Update translations from Crowdin (#4652) 2022-05-09 18:57:05 +05:30
devise.ru.yml chore: Enable Russian, update translations (#1159) 2020-08-22 17:54:16 +05:30
devise.sh.yml chore: Update translations (#6751) 2023-03-27 14:45:50 +05:30
devise.sk.yml chore: New Crowdin updates (#3616) 2021-12-19 11:38:02 +05:30
devise.sl.yml chore: Update translations (#10549) 2025-01-14 22:00:56 +05:30
devise.sq.yml chore: Update translations (#8016) 2023-09-29 15:46:29 +05:30
devise.sr.yml chore: Update translations from Crowdin (#5202) 2022-08-08 21:14:50 +05:30
devise.sv.yml chore: New translation updates 2021-03-16 00:00:53 +05:30
devise.ta.yml Chore: Include Tamil, Arabic, other language updates (#1018) 2020-07-08 00:59:30 +05:30
devise.th.yml chore: Update translations (#13832) 2026-03-17 16:02:40 -07:00
devise.tl.yml chore: Update translations from Crowdin (#9835) 2024-07-25 11:58:22 -07:00
devise.tr.yml chore: Enable Czech(cs), Turkish(tr), update translations (#1466) 2020-12-01 13:15:17 +05:30
devise.uk.yml chore: Update translations from Crowdin (#4652) 2022-05-09 18:57:05 +05:30
devise.ur_IN.yml chore: Update translations from Crowdin (#4665) 2022-05-13 11:38:49 +05:30
devise.ur.yml chore: Update translations from Crowdin (#4652) 2022-05-09 18:57:05 +05:30
devise.vi.yml chore: Update translations (#13832) 2026-03-17 16:02:40 -07:00
devise.zh_CN.yml chore: Update translations (#13832) 2026-03-17 16:02:40 -07:00
devise.zh_TW.yml chore: Update translations (#13832) 2026-03-17 16:02:40 -07:00
devise.zh.yml chore: Update translations (#13832) 2026-03-17 16:02:40 -07:00
el.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
en.yml feat(rollup): add models and write path [1/3] (#13796) 2026-03-19 13:12:36 +05:30
es.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
et.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
fa.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
fi.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
fr.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
he.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
hi.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
hr.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
hu.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
hy.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
id.yml chore: Update translations (#13832) 2026-03-17 16:02:40 -07:00
is.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
it.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
ja.yml chore: Update translations (#13832) 2026-03-17 16:02:40 -07:00
ka.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
ko.yml chore: Update translations (#13832) 2026-03-17 16:02:40 -07:00
lt.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
lv.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
ml.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
ms.yml chore: Update translations (#13832) 2026-03-17 16:02:40 -07:00
ne.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
nl.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
no.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
pl.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
pt_BR.yml chore: Update translations (#13832) 2026-03-17 16:02:40 -07:00
pt.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
ro.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
ru.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
secure_password.en.yml feat: Improved password security policy (#2345) 2021-06-07 17:26:08 +05:30
secure_password.zh_TW.yml fix(i18n): complete zh_TW locale coverage (#13792) 2026-03-16 18:47:22 -07:00
sh.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
sk.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
sl.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
sq.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
sr.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
sv.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
ta.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
th.yml chore: Update translations (#13832) 2026-03-17 16:02:40 -07:00
tl.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
tr.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
uk.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
ur_IN.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
ur.yml chore: Update translations (#13227) 2026-03-16 15:44:32 -07:00
vi.yml chore: Update translations (#13832) 2026-03-17 16:02:40 -07:00
zh_CN.yml chore: Update translations (#13832) 2026-03-17 16:02:40 -07:00
zh_TW.yml fix(i18n): complete zh_TW locale coverage (#13792) 2026-03-16 18:47:22 -07:00
zh.yml chore: Update translations (#13832) 2026-03-17 16:02:40 -07:00