docs: adopt lazy analytics caching

This commit is contained in:
2026-08-20 16:17:27 +03:30
parent 7c8afeaa4b
commit 680596fe73
10 changed files with 80 additions and 45 deletions

View File

@@ -0,0 +1,18 @@
# ADR 0012: Use Saturday-through-Friday reporting weeks
- Status: Accepted
- Date: 2026-08-20
## Context
Weekly analytics require one boundary shared by PostgreSQL grouping, API filters, cache keys, comparisons, and Persian UI labels.
## Decision
Use the Iranian week in `Asia/Tehran`: Saturday is the first day and Friday is the last day. Store the Tehran-local Saturday date as the stable week key. API and query ranges use a half-open interval from Saturday `00:00` inclusive to the following Saturday `00:00` exclusive.
## Consequences
- Week boundaries remain correct and unambiguous across daylight/timezone handling.
- A week crossing a Jalali month or year remains identified by its starting Saturday date.
- Previous-period comparison uses the immediately preceding Saturday-through-Friday interval.