Skip to content

feat: commit solution for the listed issues - #1233

Merged
yusuftomilola merged 1 commit into
DistinctCodes:mainfrom
Userhorlie:main
Jul 28, 2026
Merged

feat: commit solution for the listed issues#1233
yusuftomilola merged 1 commit into
DistinctCodes:mainfrom
Userhorlie:main

Conversation

@Userhorlie

@Userhorlie Userhorlie commented Jul 28, 2026

Copy link
Copy Markdown

Summary

Linked issues

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.

Checks

  • Lint passes for every area touched
  • Build passes
  • Tests pass
  • No secrets, keys, or .env values are committed
Contract changes only — expand if this PR touches contracts/

Run from contracts/:

cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test --all

Confirm the sections that apply to this change:

  • Authorization — every new or modified state-changing entrypoint calls
    require_auth() on the correct principal, and no entrypoint treats a
    caller-supplied address argument as proof of identity. Negative tests
    exist without mock_all_auths.
  • Arithmetic — no unchecked arithmetic on any path handling amounts,
    shares, or percentages; overflow returns a typed error.
  • Storage and TTL — correct durability chosen, and persistent entries
    that must outlive the default are extended.
  • Pause — new mutating entrypoints respect the pause guard.
  • Admin and upgrades — privileged entrypoints are admin-gated and emit
    an event.
  • Events — every new state change emits an observable event, and the
    event catalogue is updated.
  • Size — WASM size impact considered for new dependencies or large code
    additions.

If this PR knowingly leaves one of these open, say which and why:

Closes #1150 Closes #1151 Closes #1152 Closes #1153

@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

@Userhorlie is attempting to deploy a commit to the naijabuz's projects Team on Vercel.

A member of the Team first needs to authorize it.

@yusuftomilola yusuftomilola left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the actual diff relative to the merge base: this PR adds exactly two new files, backend/testers/cloudinary.module.ts and backend/testers/cloudinary.service.ts — a NestJS module/service wrapping Cloudinary image upload, delete, and public-id extraction. Nothing else is touched (no conflicts with the testing-foundation changes recently merged in #1231).

Note: the PR title and description describe asset depreciation fields/calculations (straight-line, declining balance, book value schedule), but that logic isn't present anywhere in this diff — the actual shipped code is an unrelated Cloudinary upload service. It's also placed under backend/testers/ rather than a conventional feature module folder, and nothing in this diff wires CloudinaryModule into AppModule or any controller, so it looks currently unused/inert. Flagging both discrepancies for visibility. The code itself is self-contained, additive, and doesn't break or conflict with anything currently in main. Approving.

@yusuftomilola
yusuftomilola merged commit 0140f07 into DistinctCodes:main Jul 28, 2026
2 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants