fix: deliver validated AI insight responses

This commit is contained in:
2026-08-22 15:47:38 +08:00
parent ca55c2fb3d
commit 3fba4261ee
68 changed files with 6870 additions and 493 deletions

View File

@@ -1,8 +1,8 @@
# Analytics Metric Catalogue
- Status: Approved specification — implementation authorized 2026-08-20
- Version: 0.4.0
- Last updated: 2026-08-20
- Version: 0.5.0
- Last updated: 2026-08-22
Every merchant-facing number identifies its grain, formula, source fields, filters, Tehran-local period, unit, missing-data behavior, trace path, and definition version.
@@ -55,6 +55,14 @@ Every merchant-facing number identifies its grain, formula, source fields, filte
- Formula: `verified_sessions / bank_paid_sessions`; undefined when no bank-paid sessions exist
- Unit: percentage
## Transaction status analytics
- `total_sessions`: count all merchant-scoped sessions in the selected half-open reporting period.
- `bank_success_rate`: sessions with status `Paid` or `Verified` divided by `total_sessions`; undefined when the total is zero.
- `failure_rate`: sessions with status `Failed` divided by `total_sessions`; undefined when the total is zero.
- Status distribution reports `Paid`, `Verified`, `Failed`, and `Reversed` separately as count and share of `total_sessions`.
- Trend grain is hourly for a day, daily for a week or Jalali month, and Saturday-aligned weekly for a Persian season. Empty buckets are returned as zeroes.
## Paid volume
- Canonical id: `bank_paid_amount_rial`