docs: align dashboard payment semantics
This commit is contained in:
@@ -26,7 +26,7 @@ Give a non-technical merchant a fast, trustworthy Persian RTL view of payment pe
|
||||
8. Responsive behavior and component contracts follow `DESIGN.md`.
|
||||
9. Merchant-facing dates use the Jalali calendar in `Asia/Tehran`; API instants remain explicit ISO-8601 UTC and filtering sends unambiguous boundaries.
|
||||
10. Approved reporting periods are daily, weekly, Jalali-month, and Persian-season views. Weekly periods run Saturday through Friday in `Asia/Tehran`. Every comparison states its exact period and baseline.
|
||||
11. Only source session status `Verified` counts as a confirmed successful payment. `Paid` appears as a separate operational state until an approved metric-catalogue revision defines it otherwise.
|
||||
11. `Paid` and `Verified` both count as successful bank payments. `Paid` means funds were deducted but merchant verification is incomplete; `Verified` is finalized. Success and paid-volume metrics include both, while verification-health metrics show them separately.
|
||||
12. The first relevant dashboard access sends an idempotent authenticated `POST` that creates or returns the current analytics run and starts four sections in bounded parallel: overview, payment performance, fees, and peer comparison.
|
||||
13. The app then opens the run's authenticated `GET` SSE stream and renders each section as soon as its `ready` event arrives. A failed section has its own retry/error state and does not hide successful siblings.
|
||||
14. Later equivalent requests reuse 30-day Redis entries. PostgreSQL merchant/cohort revision changes select new cache keys and cause only missing sections to be recalculated; cache age alone does not make static data stale.
|
||||
@@ -35,6 +35,8 @@ Give a non-technical merchant a fast, trustworthy Persian RTL view of payment pe
|
||||
17. SSE expects a heartbeat every 15 seconds and supports authorized replay for one hour. After replay expires, the app fetches the current run snapshot before reopening the stream.
|
||||
18. Manual retry targets only one exhausted failed section. It is disabled while active, never restarts ready siblings, and handles a typed `429` by honoring `Retry-After`.
|
||||
19. Analytics starts, manual retries, and concurrent SSE connections expose accessible rate-limited states without discarding already-ready content or retrying in a tight loop.
|
||||
20. Paid amount and fee totals count each eligible session once. Merchant fees are shown as real Rial amounts/rates; retry attempts cannot multiply a session fee.
|
||||
21. Retry recovery may finish in either `Paid` or `Verified`. Timing cards show p50, p95, sample size, and non-null coverage.
|
||||
|
||||
## Frontend architecture baseline
|
||||
|
||||
@@ -52,7 +54,9 @@ Give a non-technical merchant a fast, trustworthy Persian RTL view of payment pe
|
||||
- Critical flows work at 360 px, 768 px, 1024 px, and a wide desktop viewport in RTL.
|
||||
- Login, navigation drawer, filters, chart alternatives, and logout are keyboard complete and screen-reader understandable.
|
||||
- Values visibly specify period and unit; missing/suppressed/zero states are distinct.
|
||||
- Confirmed-success views include only `Verified`; `Paid` is separately labeled and testable.
|
||||
- Success views include `Paid` plus `Verified`, verification-completion views separate them, and unverified paid sessions are never styled or described as failures.
|
||||
- Paid volume and merchant fee values reconcile at session grain; fee totals remain unchanged when a session has additional attempts.
|
||||
- Retry recovery includes eventual `Paid` or `Verified`, and timing percentiles never treat missing values as zero.
|
||||
- All core sections begin on first access and become visible independently in completion order without blocking the whole dashboard.
|
||||
- The start request is idempotent and always maps equivalent concurrent starts to the same current run.
|
||||
- A second equivalent access reuses current Redis entries, and concurrent first accesses do not enqueue duplicate equivalent section jobs.
|
||||
|
||||
Reference in New Issue
Block a user