Reject invalid `completed` query values instead of reading them as `false`
What is wrong
src/api/todos/dtos/queries/todos-query.dto.ts (line 12) transforms the filter with value === 'true' || value === true. Any other value (completed=yes, completed=1, completed=) becomes false, @IsBoolean() passes, and GET /api/v1/todos silently returns only unfinished todos. The request body already rejects completed: 'yes' with 422 (test/todos.e2e-spec.ts), and docs/architecture/api.md documents only true/false for the query.
Why it matters
A typo in a filter returns wrong data instead of a validation error.
Definition of done
'true'maps totrue,'false'tofalse; any other value is passed through unchanged so@IsBoolean()rejects it with 422DTO_VALIDATION_ERROR.- A new
todos-query.dto.spec.tscovers invalid values first, thentrue/false/absent (seesrc/api/client-logs/dtos/web-log.dto.spec.tsfor the pattern);npx jest src/api/todos/dtospasses. - Optional: a
GET ?completed=yes→ 422 case intest/todos.e2e-spec.ts.
Pointers
Hi! I'd like to work on this one if it's still free.
My plan, following the definition of done: map only 'true' and 'false' in the transform and pass any other value through unchanged, so @IsBoolean() rejects it with a 422, and add e2e cases for completed=yes, completed=1 and an empty value.
@devmaiter , Thanks, the plan looks right, it's yours! One addition: the unit spec src/api/todos/dtos/queries/todos-query.dto.spec.ts is required by the definition of done. Follow the pattern in src/api/client-logs/dtos/web-log.dto.spec.ts: invalid values first (yes, 1, empty), then true/false/absent, and npx jest src/api/todos/dtos should pass. The e2e cases are welcome but optional, since they need Postgres and Redis running locally. If that's a hassle, the unit spec alone is enough.