Skip to content

[BE-30] Implement asset depreciation calculation endpoint #595

@yusuftomilola

Description

@yusuftomilola

Overview

Implement an asset depreciation calculation endpoint that computes the current book value using straight-line depreciation inside backend/contrib/.

Location

All work must be inside backend/contrib/src/assets/.

Acceptance Criteria

  • GET /assets/:id/depreciation endpoint implemented
  • Calculates straight-line depreciation: (purchasePrice - salvageValue) / usefulLifeYears
  • Default useful life: 5 years, default salvage value: 10% of purchase price
  • Returns: { purchasePrice, currentBookValue, totalDepreciation, depreciationPerYear, ageInYears, percentDepreciated }
  • Returns 400 if asset has no purchasePrice or purchaseDate
  • Endpoint protected by JwtAuthGuard

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions