Skip to content

[BE-28] Implement depreciation engine — straight-line and declining-balance schedules #1087

Description

@yusuftomilola

Overview

Assets carry purchasePrice, purchaseDate, and currentValue, but nothing computes depreciation — the #1 feature finance teams expect from an asset register (Snipe-IT, Asset Panda, and every ITAM tool ship it). Charts are planned as [FE-23].

What to Build

A DepreciationModule in backend/src/depreciation/:

  1. Asset entity additions (coordinate with [BE-06]/[BE-14]): depreciationMethod (enum NONE | STRAIGHT_LINE | DECLINING_BALANCE), usefulLifeMonths, salvageValue
  2. DepreciationService:
    • getSchedule(assetId) → array of { period, openingValue, depreciation, closingValue } over the useful life
    • getCurrentBookValue(assetId) → value as of today
  3. Endpoints:
Method Path Description
GET /api/assets/:id/depreciation Full schedule + current book value
GET /api/reports/depreciation Org-wide: total book value, monthly depreciation expense, top depreciating categories
  1. Nightly cron updates currentValue from the schedule for assets with a method set

References

  • Blocked by [BE-06], [BE-14]; feeds [FE-23] and extends [BE-13]

Acceptance Criteria

  • Straight-line: (cost − salvage) / usefulLifeMonths per month, verified against a hand-computed example in the issue/PR description
  • Declining-balance implemented with a configurable rate
  • Book value never drops below salvage value
  • Schedule endpoint returns correct values for assets purchased mid-month and fully-depreciated assets
  • Org-wide report aggregates in SQL where possible

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions