docs(cache): remove static dataset invalidation

This commit is contained in:
2026-08-20 18:40:28 +03:30
parent f471eaf3a2
commit 27903ff67e
9 changed files with 62 additions and 102 deletions

View File

@@ -81,15 +81,15 @@ The default is the latest complete Jalali month containing source data. Weekly p
## Analytics-run contract
`POST /analytics/runs` accepts `periodId` and an `Idempotency-Key` representing one dashboard-start intent. The server binds the key to the authenticated user, merchant, canonical request, merchant/cohort revisions, and metric-definition version.
`POST /analytics/runs` accepts `periodId` and an `Idempotency-Key` representing one dashboard-start intent. The server binds the key to the authenticated user, merchant, canonical request, immutable dataset snapshot, and metric-definition version.
- The same key and same canonical request replays the original status/body without duplicate jobs.
- The same key with a different request returns `422 IDEMPOTENCY_KEY_REUSED`.
- Equivalent concurrent requests for the current revision resolve to the same run even when their valid intent keys differ.
- Equivalent concurrent requests for the current dataset snapshot resolve to the same run even when their valid intent keys differ.
- An in-flight duplicate returns the current `202` run snapshot rather than starting another effect.
- Intent records outlive the one-hour event replay window and the maximum job retry chain; the concrete retention value is an implementation parameter that must be documented before implementation.
A run snapshot identifies the selected period, revisions, metric-definition version, creation/update times, overall state, and all four sections. Section states are `QUEUED`, `CALCULATING`, `READY`, `FAILED`, or `SUPPRESSED`. A failure includes only a safe stable error code and retry eligibility. Ready section payloads use the typed schemas in OpenAPI. A suppressed peer section contains threshold evidence but no peer metric values.
A run snapshot identifies the selected period, immutable dataset snapshot, metric-definition version, creation/update times, overall state, and all four sections. Section states are `QUEUED`, `CALCULATING`, `READY`, `FAILED`, or `SUPPRESSED`. A failure includes only a safe stable error code and retry eligibility. Ready section payloads use the typed schemas in OpenAPI. A suppressed peer section contains threshold evidence but no peer metric values.
## Metric response rules