## Overview `DocumentsService` is the most-used service in the app (called by queue, risk assessment, and controllers) but has no unit tests. ## Test Cases to Cover - [ ] `create()` — persists and returns document with correct initial status (`PENDING`) - [ ] `findByOwner()` — returns only documents belonging to the specified user - [ ] `findByFileHash()` — returns document when hash matches, returns `null` when not found - [ ] `updateStatus()` — correctly transitions status field - [ ] `updateRisk()` — sets `riskScore` and `riskFlags` correctly - [ ] `delete()` — removes the document record ## File `src/documents/documents.service.spec.ts`
Overview
DocumentsServiceis the most-used service in the app (called by queue, risk assessment, and controllers) but has no unit tests.Test Cases to Cover
create()— persists and returns document with correct initial status (PENDING)findByOwner()— returns only documents belonging to the specified userfindByFileHash()— returns document when hash matches, returnsnullwhen not foundupdateStatus()— correctly transitions status fieldupdateRisk()— setsriskScoreandriskFlagscorrectlydelete()— removes the document recordFile
src/documents/documents.service.spec.ts