https://t.me/+DOylgFv1jyJlNzM0
Why this matters
scoreDecayService.ts (with cron/scoreDecayJob.ts) decays credit scores for inactive borrowers (#535). The job wrapper has a test (cron/__tests__/scoreDecayJob.test.ts) but the service that computes WHICH users decay and by HOW MUCH is untested. Credit-score mutation is financially sensitive — an off-by-one in the inactivity window or decay amount silently penalizes active users or never decays inactive ones.
Acceptance criteria
Files to touch
backend/src/services/__tests__/scoreDecayService.test.ts (new)
Out of scope
- Changing decay parameters or schedule
- Contract-side score logic
https://t.me/+DOylgFv1jyJlNzM0
Why this matters
scoreDecayService.ts(withcron/scoreDecayJob.ts) decays credit scores for inactive borrowers (#535). The job wrapper has a test (cron/__tests__/scoreDecayJob.test.ts) but the service that computes WHICH users decay and by HOW MUCH is untested. Credit-score mutation is financially sensitive — an off-by-one in the inactivity window or decay amount silently penalizes active users or never decays inactive ones.Acceptance criteria
scoreDecayServicetests covering: user inactive past the threshold decays by the configured amount, active user does not decay, decay floored at the minimum score, and batch processing across multiple usersFiles to touch
backend/src/services/__tests__/scoreDecayService.test.ts(new)Out of scope