Overview
The depreciation engine ([BE-28]) needs its visualization: finance users think in curves and schedules, not JSON.
What to Build
- Asset detail — Financials section: book-value-over-time line chart (Recharts), current book value stat, method + parameters display, and the full schedule as an expandable table (period, opening, depreciation, closing)
- Reports page — Financials tab: org-wide totals (purchase value, current book value, monthly depreciation expense), value-by-category bar chart, top-10 depreciating assets table — from
GET /api/reports/depreciation
- Asset create/edit: depreciation fields (method, useful life, salvage value) added to the form, hidden behind an "enable depreciation" toggle
Conventions to Follow
- API calls: add a typed client in
frontend/lib/api/ (see frontend/lib/api/assets.ts for the pattern) — never call axios directly from components
- Data fetching: TanStack Query hooks in
frontend/lib/query/hooks/ with keys registered in frontend/lib/query/keys.ts
- UI: reuse
frontend/components/ui/ (button, input, confirm-dialog, toast) and the badge/modal patterns in frontend/components/assets/
- Route goes under
frontend/app/(dashboard)/ and gets a sidebar entry in frontend/components/layout/sidebar.tsx
- Forms: React Hook Form + Zod resolver, matching the existing create-asset modal
References
- Blocked by [BE-28], [FE-21] (edit form)
Acceptance Criteria
Overview
The depreciation engine ([BE-28]) needs its visualization: finance users think in curves and schedules, not JSON.
What to Build
GET /api/reports/depreciationConventions to Follow
frontend/lib/api/(seefrontend/lib/api/assets.tsfor the pattern) — never call axios directly from componentsfrontend/lib/query/hooks/with keys registered infrontend/lib/query/keys.tsfrontend/components/ui/(button, input, confirm-dialog, toast) and the badge/modal patterns infrontend/components/assets/frontend/app/(dashboard)/and gets a sidebar entry infrontend/components/layout/sidebar.tsxReferences
Acceptance Criteria