-
Notifications
You must be signed in to change notification settings - Fork 71
Open
Labels
onlydust-waveContribute to awesome OSS repos during OnlyDust's open source weekContribute to awesome OSS repos during OnlyDust's open source week
Description
ποΈ Issue: User β Move DTOs into presentation layer and enforce validation
Description
The user module has DTOs outside of the presentation layer or mixed with domain code. To align with the architecture, DTOs (HTTP shapes + validation) should live under presentation/dto.
What is expected
- DTOs moved/created under
src/modules/user/presentation/dto/(e.g.,create-user.dto.ts,update-user.dto.ts). - Use
class-validator/class-transformerfor input validation. - Controllers import these DTOs and apply the validation middleware.
What should be modified
- Create/move DTO files to
presentation/dto. - Update controllers to use DTOs (no raw bodies).
- Remove duplicate/legacy DTO definitions elsewhere.
Tests
- Add/adjust tests to assert 400 on invalid payloads and success on valid ones.
Acceptance criteria
- DTOs live under
presentation/dto. - Controllers validate input using these DTOs.
- No duplicate DTOs elsewhere.
- Tests pass with proper 4xx on invalid data.
Rollback plan
- Keep pre-change branch/tag.
- If breakages occur, reintroduce DTOs gradually (endpoint by endpoint).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
onlydust-waveContribute to awesome OSS repos during OnlyDust's open source weekContribute to awesome OSS repos during OnlyDust's open source week