# Reports page(s) plan

> One file: `docs/project/cruds/reports.md` (or `reports-<area>.md` per page). Admin **analytical pages** showing
> **project performance** — beyond the dashboard-home overview. Built with the dashboard sprint. Drives
> `build-dashboard-crud` (reports section). Everything **scientific & meaningful**, translated ar+en.

## 1) What to report (choose per project)
- **Financial** (if money flows): revenue in · costs/fees · **profit %** · net · per-period; overdue / collection rate.
- **Operational**: orders/requests over time · completion vs cancellation · avg delivery time · per-status funnel.
- **Growth / engagement**: new vs active users · retention · top entities.
> Pick only KPIs that reflect real performance; correct aggregation (proper time buckets, no double counting).

## 2) How many pages
- **Split when an area deserves its own page** — e.g. `reports/financial`, `reports/operations` — each with its own
  sidebar entry. If only one area is report-worthy, a single reports page. (Home stays the light overview.)

## 3) Per report page
- **Filters:** date range (+ direction/type where relevant).
- **KPI cards + charts** — right chart per data (line=trend, bar=compare, donut=share, stacked=composition).
- **Data table** where a breakdown helps.
- **Export:** PDF / Excel (base has Maatwebsite Excel + PHPOffice PHPWord).
- Figures come from **services** (no queries in Blade); numbers via `number_format`.

## 4) Build checklist
- [ ] thin controller → service (aggregations) → Blade view (cards + charts + table + export)
- [ ] route + **sidebar entry** · all titles/labels/legends translated **ar+en**
- [ ] correct math verified · appropriate chart per dataset
