DSH-02 — Back-office dashboards
General and sales dashboards: KPI cards, charts, filters, role-configurable layout.
| Field | Details |
|---|---|
| Task code | DSH-02 |
| Phase | P1 — V1 build & integration |
| Product scope | V1 |
| Status | Planned |
| Start | Tue 24 Nov 2026 |
| Due | Wed 25 Nov 2026 |
| Responsible | Anis — Full-stack developer |
| Co-responsible | — |
| Effort | 1 person-day(s) planned · 4 from scratch · size S |
| Area · app | Back-office · dashboard |
| Depends on | SRV-25, DSH-01 |
| Unblocks | — |
| Milestones | — |
Summary
General and sales dashboards: KPI cards, charts, filters, role-configurable layout.
Description
The cahier opens the back-office on a general dashboard (§4.1; ANA-01, ANA-02): revenue, orders by status, basket, reseller activity, field activity, stock alerts and finance indicators, filterable and adapted to each role. On top of SRV-25, this task delivers the general dashboard (BO-04) and the sales dashboard (BO-05) with KPI cards, charts, the shared filter bar (date presets, wilaya, commune, delegate, brand, category), a role-configurable layout and live refresh after events from the back-office stream. Because every order needs manual confirmation, a Commandes à confirmer card with queue age links to BO-41. Out of scope: field, stock and finance dashboards (BO-06, BO-07, BO-08 in DSH-08, DSH-05, DSH-07) and the reports library (DSH-11).
Subtasks
| # | Subtask | Owner |
|---|---|---|
| 1 | Filter bar with date presets (aujourd'hui, 7 jours, mois en cours, personnalisé), wilaya, commune, delegate, brand, category, synced to the URL | Anis |
| 2 | BO-04 KPI cards: revenue, orders by status, average basket, active/new/inactive resellers, delegates on tour, visits, conversion, stock alerts, expected payments, credit used, unpaid (finance cards gated) | Anis |
| 3 | « Commandes à confirmer » card with count and oldest age, linking to BO-41 | Anis |
| 4 | BO-05 sales charts: revenue trend, revenue by brand and category, by wilaya, channel split (app, web, assisted, back-office), top resellers and top products | Anis |
| 5 | Chart components (Recharts) with HOCO palette, empty and loading states, number formatting in DA | Anis |
| 6 | Role layout editor: drag and drop cards, show/hide, saved per role through admin.dashboard.layout.update (SUPER_ADMIN) | Anis |
| 7 | Live refresh: invalidate KPI queries on relevant admin SSE events (debounced) | Anis |
| 8 | Design QA of BO-04 and BO-05 | Akram |
Deliverables
- apps/dashboard/src/app/[locale]/(app)/{page.tsx,dashboards/sales/page.tsx}
- apps/dashboard/src/features/dashboards/ (filter bar, KPI card, charts, layout editor)
Acceptance criteria
- KPI values equal the SRV-25 API values for the same filters (ANA-01)
- Changing a filter updates every card and chart and survives a page reload (ANA-02)
- A role without finance.view sees no finance cards (ANA-02, ACL-04)
- A new order increments the « Commandes à confirmer » card without reload
- A layout saved for the DIRECTION role is the one their users see on next load
Requirements covered
| Requirement | Title | Release |
|---|---|---|
| ANA-01 | General dashboard: revenue, orders by status, average basket, active/new/inactive resellers, delegates on tour, visits, conversion, best sellers, stock alerts, expected payments, credit used, unpaid | V1 |
| ANA-02 | Dashboard filters (date, wilaya, commune, delegate, brand, category), role-configurable cards, permission-aware, refreshed after events | V1 |
Screens
API surface
| Endpoint group | Operations |
|---|---|
| Dashboards & KPIs | 4 |
Test measures
- Playwright e2e: dashboard with filters on seeded data, compare to fixtures
- Component tests for KPI card formatting (DA, percentages)
KPI
- Delivered by Wed 25 Nov 2026 within 1 person-day(s).
- Every acceptance criterion above demonstrated before hand-off; linked requirements' acceptance criteria pass.
- Zero open critical defects, permission gaps or data-integrity regressions at sign-off.
Generated from content/plan/tasks.json by scripts/generate-team-tasks.mjs. Dates are computed by the scheduler (Sunday–Thursday weeks, holidays excluded) — change the plan, not this page.
DSH-14 — Back-office — commercial push, new catalogue, flash-sale fields, complementary products & smart-notification settings
Back-office screens for document 03: commercial push and new catalogue kinds in BO-57 with the push / inbox-only split, the Vente flash toggle in BO-50, complementary products and the new-arrival flag in BO-28, smart rules, action labels and settings in BO-58.
DSH-11 — Back-office reports & export centre
Reports library with filters and totals, export requests and download centre.