Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0
Why this matters
src/services/scoresService.ts:43 clamps with LEAST(850, GREATEST(300, ...)) in application SQL, but the scores table (migrations/1771691269865_initial-schema.js:15 and the ensure-core-tables CREATE branch 1789000000000:10-15) defines the score column as plain integer with no CHECK, so any code path or manual write can persist out-of-range scores. The valid bounds are fixed (loanConfig.ts:13 LOAN_MIN_SCORE_RANGE = {min:300,max:850}).
Acceptance criteria
Files to touch
backend/migrations/1771691269865_initial-schema.js
backend/src/services/scoresService.ts
Out of scope
- Changing the score range itself
Why this matters
src/services/scoresService.ts:43 clamps with LEAST(850, GREATEST(300, ...)) in application SQL, but the scores table (migrations/1771691269865_initial-schema.js:15 and the ensure-core-tables CREATE branch 1789000000000:10-15) defines the score column as plain integer with no CHECK, so any code path or manual write can persist out-of-range scores. The valid bounds are fixed (loanConfig.ts:13 LOAN_MIN_SCORE_RANGE = {min:300,max:850}).
Acceptance criteria
Files to touch
backend/migrations/1771691269865_initial-schema.jsbackend/src/services/scoresService.tsOut of scope