With a second, package-private constructor for a test clock, Spring found no default constructor and mobile-api failed to start. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
4.2 KiB
4.2 KiB
Tasks
Design: design.md (technical contract) and docs/superpowers/specs/2026-12-01-lead-dashboard-design.md (product).
Waves:
- Wave 0 (serial, controller): 1.1 and 1.2 touch hotspots (SQL, seed,
package.json). - Wave 1 (parallel, 3 implementers): 2.1, 3.1 and 4.1 build against the fixed contracts in design decisions 4 and 5. Scopes do not overlap: each touches one module.
- Wave 2 (serial, controller): 5.1.
1. Data, module and chart dependency
- 1.1 SQL
sql/01..03and99-rollback.sql; mirror 01 and 03 inlocal/seed/03-colite.sql(02 has nothing to backfill on an empty volume); apply 01, 02 and 03 to the local database.- Depends on: none
- Scope:
local/seed/**,openspec/changes/add-lead-dashboard/sql/** - Verify:
SELECTshows the table, the index, the backfilled rows and the module row.
- 1.2 Portal: add
recharts(same major as babyboo's portal) withnpm install, and copy babyboo'sapp/components/ui/chart.tsx.- Depends on: none
- Scope:
solvway-admin-portal/package.json,solvway-admin-portal/package-lock.json,solvway-admin-portal/app/components/ui/chart.tsx - Verify:
cd solvway-admin-portal && npm run lint && npx tsc --noEmit && npx vitest run
2. services-counter
- 2.1 Status history writes (decision 1) and the dashboard endpoint (decisions 2 to 4).
- Tests first:
- capture saves one history row null → initial status at the capture time, by doneBy;
- update saves one row when the status changes and none when it stays;
- the calculator, from in-memory rows: captures, new leads, funnel, won in period (latest WON only), median days (odd, even, none), overdue per salesperson, Unassigned, salesperson with overdue only, interest double-count, event ordering, zero-filled day and month trend, Malaysia day boundary from JVM-zone times;
- the endpoint rejects from after to with 400
INVALID_PERIODand passes a null company as all companies.
- Scope:
solvway-services-counter/src/** - Verify:
mvn -T 1C -q -pl solvway-services-counter verify
- Tests first:
3. mobile-api
- 3.1
GET /api/admin/dashboard/leads(decision 5).- Tests first:
- default period is this Malaysian month to today; DAY bucket up to 62 days, MONTH above;
- bad date and from after to → 400
INVALID_PERIOD; - staff are scoped to their company, a super admin's
companyIdis passed through, null for all; - salesperson names resolved, null for Unassigned and for a missing user;
- the endpoint is gated by
BO_DASHBOARD(aspect test with the annotation).
- Scope:
solvway-mobile-api/src/** - Verify:
mvn -T 1C -q -pl solvway-mobile-api verify
- Tests first:
4. Portal
- 4.1 Home page dashboard (decision 7).
- Tests first:
- without
BO_DASHBOARDthe welcome shows and the dashboard API is not called; - with it: tiles, funnel, chart container, the three tables with Unassigned, whole-percent rates and "–" for null median and zero captures;
- period presets send the right
from/to; a reversed custom range shows the error message; - a super admin's picker sends
companyIdand shows the Company column only for all companies; - an event row links to
/event-leads/{eventUuid}; - the hard-coded copy sweep stays green (labels as message keys).
- without
- Includes the Next proxy route
app/api/dashboard/leads/route.ts(added after review: the first plan left it out). - Scope:
solvway-admin-portal/app/api/dashboard/**,solvway-admin-portal/app/page.tsx,solvway-admin-portal/app/page*.test.tsx,solvway-admin-portal/app/components/dashboard/**,solvway-admin-portal/app/lib/services/adminDashboard*.ts,solvway-admin-portal/app/lib/i18n/defaultMessages.ts - Verify:
cd solvway-admin-portal && npm run lint && npx tsc --noEmit && npx vitest run
- Tests first:
5. Release
- 5.1
docs/deployment.mdlists the SQL; live check against the local stack (seeded INS and CV event leads with status changes), and Playwright at 1280 and 360 px for a granted user, a user without the module, and a super admin switching company.- Depends on: 1.1 to 4.1
- Scope:
docs/deployment.md,openspec/changes/add-lead-dashboard/tasks.md - Verify: full
mvn -T 1C -q verifyof the three touched Maven modules and the portal verify.