Skip to content

[BE-97] Asset depreciation calculation #1150

Description

@yusuftomilola

Overview

The frontend has depreciation charts planned ([FE-23] in the existing backlog) and categories carry depreciation defaults ([BE-85]). Book value drives audit and financial reporting.

Tasks

  • Add depreciation fields to assets: method (STRAIGHT_LINE/DECLINING_BALANCE/NONE), usefulLifeMonths, salvageValue, depreciationStartDate — inheriting category defaults.
  • Implement calculation for each method; expose current book value, accumulated depreciation, and a period-by-period schedule.
  • Add GET /assets/${id}/depreciation returning the schedule, and a portfolio-wide total book value for reports.
  • Use integer minor units throughout and define the rounding rule explicitly — document who absorbs the remainder.
  • Handle edge cases: disposal mid-life, zero useful life, salvage exceeding cost.
  • Write tests with worked examples verified by hand.

Acceptance Criteria

  • Straight-line and declining-balance figures match hand-calculated examples exactly.
  • Book value never falls below salvage value.
  • Rounding is deterministic and documented.

Dependencies

Blocked by [BE-85] and [BE-86].

Notes for Contributors

The backend is being rebuilt from a clean NestJS skeleton — backend/src/ currently contains only app.module.ts, app.controller.ts, app.service.ts, and main.ts. Follow standard NestJS module structure (module / controller / service / dto / entities) and register your module in app.module.ts. Comment below to be assigned.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions