Skip to content

[FE-23] Add depreciation charts and financial views to asset detail and reports #1111

Description

@yusuftomilola

Overview

The depreciation engine ([BE-28]) needs its visualization: finance users think in curves and schedules, not JSON.

What to Build

  1. 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)
  2. 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
  3. 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

  • Chart matches the schedule table values exactly
  • Fully-depreciated assets render correctly (flat line at salvage value)
  • Org-wide financial tab renders from the reports endpoint
  • Depreciation fields validate (useful life > 0, salvage < cost)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions