DSH-03 — Back-office CRM pages
Resellers list and map, reseller 360°, create/edit with duplicate check, validation queue, follow-ups, segments.
| Field | Details |
|---|---|
| Task code | DSH-03 |
| Phase | P1 — V1 build & integration |
| Product scope | V1 |
| Status | Planned |
| Start | Tue 10 Nov 2026 |
| Due | Wed 11 Nov 2026 |
| Responsible | Anis — Full-stack developer |
| Co-responsible | — |
| Effort | 1.5 person-day(s) planned · 7 from scratch · size S |
| Area · app | Back-office · dashboard |
| Depends on | DSH-01, SRV-14, DES-16 |
| Unblocks | — |
| Milestones | — |
Summary
Resellers list and map, reseller 360°, create/edit with duplicate check, validation queue, follow-ups, segments.
Description
The commercial team works its reseller base from these pages (cahier §4.1, §4.2; CRM-01, CRM-03…CRM-12, AUTH-11), on top of the CRM module (SRV-14) and Akram's CRM designs (DES-16). It delivers the resellers and prospects list (BO-09) and map (BO-10), the reseller 360° page (BO-11), create/edit with live duplicate check (BO-12), the account validation queue where the declared customer type is reviewed (BO-13), follow-ups and tasks (BO-14) and segments (BO-15). Changing a reseller's customer type is only possible here, behind crm.validate, with a reason and an audit entry (AUTH-11). Out of scope: delegate and tour pages (DSH-08), finance details beyond the 360° summary (DSH-07).
Subtasks
| # | Subtask | Owner |
|---|---|---|
| 1 | BO-09 list: columns REV number, store, owner, phone, wilaya/commune, ResellerStatus pill, customer type, delegate, segment, potential, last order, source; filters status, zone, wilaya, commune, delegate, segment, potential, customer type, activity; bulk assign and status; export | Anis |
| 2 | BO-10 map: clustered markers coloured by status, same filters as the list, side drawer with summary and link to 360° | Anis |
| 3 | BO-11 reseller 360°: header (statuses, customer type, delegate, credit summary if finance.view) and tabs Commandes, Factures et paiements, Visites et rapports, Tâches, Historique, Documents et photos, Retours et SAV | Anis |
| 4 | BO-12 create/edit form: phone with checkPhone on blur showing the existing record, wilaya/commune pickers, map pin, business type, potential, customer type, delegate | Anis |
| 5 | BO-13 validation queue: pending accounts with documents and photos viewer, declared customer type with « Modifier le type » (reason, audited), « Valider » / « Refuser » with reason | Anis |
| 6 | BO-14 follow-ups: task list grouped by due date (overdue, today, upcoming), assignee filter, create/complete, link to reseller | Anis |
| 7 | BO-15 segments: rule builder (potential, business type, brands sold, activity), live member count, members table | Anis |
| 8 | Notes and interaction entry from the 360° timeline (admin.resellers.notes.add) | Anis |
| 9 | Permission gating crm.view/create/update/validate/export on every action | Anis |
Deliverables
- apps/dashboard/src/app/[locale]/(app)/crm/resellers/{page.tsx,map/page.tsx,new/page.tsx,[resellerId]/page.tsx,[resellerId]/edit/page.tsx}
- apps/dashboard/src/app/[locale]/(app)/crm/{validation,tasks,segments}/page.tsx
- apps/dashboard/src/features/crm/ (queries, columns, forms, timeline)
Acceptance criteria
- Typing an existing phone in the create form shows the existing reseller and blocks creation (CRM-03)
- The list and the map return the same resellers for the same filters, and the export contains exactly the filtered rows (CRM-11)
- Approving or refusing an account from BO-13 updates the queue live and refusal requires a reason (CRM-09)
- Changing a customer type requires crm.validate and a reason, and appears in the activity log with old and new values (AUTH-11)
- The 360° page shows orders, invoices, payments, visits, reports, tasks and interactions of the reseller (CRM-12)
- Users without crm.update see the forms read-only
Requirements covered
| Requirement | Title | Release |
|---|---|---|
| CRM-01 | Reseller/prospect record with the minimum data set (store, owner, phone, WhatsApp, email, wilaya, commune, address, GPS, type, potential, delegate, photos, documents, status) | V1 |
| CRM-03 | Duplicate prevention: the main phone number is unique (normalised); duplicate check on every creation path | V1 |
| CRM-04 | Reseller lifecycle (10 statuses) with automatic and manual transitions and full history | V1 |
| CRM-05 | Assignment to a delegate and a zone; link to the creating delegate; reassignment history | V1 |
| CRM-06 | Segmentation by potential, business type, brands sold, level and activity | V1 |
| CRM-07 | Unified interaction history: calls, visits, notes, orders, payments, claims | V1 |
| CRM-08 | Follow-ups (relances), tasks and next actions with due dates and notifications | V1 |
| CRM-09 | Account validation by an authorised user (approve / reject with reason) | V1 |
| CRM-10 | Store photos and documents (façade, interior, RC, NIF, ID) with protected access | V1 |
| CRM-11 | CRM list and map views with filters (status, zone, wilaya, commune, delegate, segment, potential, activity) and export | V1 |
| CRM-12 | Reseller 360° page: orders, invoices, payments, visits, reports, tasks, interactions | V1 |
| AUTH-11 | Customer type declared at sign-up, reviewed at account validation; any later change is made by the back-office and audited | V1 |
Screens
| Screen | Name | App |
|---|---|---|
| BO-09 | Resellers & prospects list | BO |
| BO-10 | Resellers map | BO |
| BO-11 | Reseller 360° | BO |
| BO-12 | Reseller create / edit | BO |
| BO-13 | Account validation queue | BO |
| BO-14 | Follow-ups & tasks | BO |
| BO-15 | Segments | BO |
API surface
| Endpoint group | Operations |
|---|---|
| CRM | 21 |
Test measures
- Playwright e2e: create a prospect, hit the duplicate check, validate a pending account
- Component tests for the segment rule builder
- Design QA pass with Akram on BO-09 to BO-15
Risks
- Map performance with thousands of resellers — server-side clustering via admin.resellers.map bounding-box queries
KPI
- Delivered by Wed 11 Nov 2026 within 1.5 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-01 — Back-office foundation — shell, auth, navigation, data patterns
Next.js shell with role-based navigation, sign-in/reset, oRPC + TanStack Query client, HOCO tokens in the UI kit, DataTable/filters/forms/detail patterns, French messages.
DSH-04 — Back-office catalog & pricing pages
Products list, product editor (variants, images, specs, the three customer-type prices, attributes, visibility), brands, category tree, attribute definitions, import wizard.