Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Standardize DTO naming and folder placement across 61 DTO files

Open
#210 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
node.js, typescript
Domain
api

Research direction

Start with src/infrastructure/file-upload/dto/file-upload.dto.ts and CONTRIBUTING.md to understand the current DTOs and the proposed convention. Audit the 61 *.dto.ts files under src/, and review docs/openapi.json before any class rename. Done means the convention and audit are documented, the file-upload DTOs are split without breaking published schema names or validation responses, and npx tsc --noEmit and npm test pass.

Written by the indexing model from the issue text.

Description

help wanted intermediate refactor

Problem

61 files match *.dto.ts across src/. They do not follow a consistent convention. Observed inconsistencies:

  • src/investment/portfolio/dto/portfolio-management.dto.ts — multiple DTOs in one file
  • src/infrastructure/file-upload/dto/file-upload.dto.ts — six DTOs in one file (UploadFileDto, UpdateFileMetadataDto, GenerateThumbnailDto, GetDownloadUrlDto, FileSearchDto, FileCleanupDto)
  • Some directories use dto/, others may not.

Class-validator coverage is uneven too: 151 @Max/@Min validators exist across the DTO set, but pagination limit fields frequently lack an upper bound — see the separate pagination-bounds issue.

Why it matters

Naming and placement drift is invisible until someone searches for a DTO and finds it in an unexpected file, or tries to import it and hits a circular reference caused by a barrel. It also makes DTO review harder — a 200-line multi-DTO file gets a per-file review, whereas small per-DTO files get focused attention.

For the generated OpenAPI spec it matters more: DTO file layout does not affect the output, but the naming does, and operationId/schema names derive from class names. Inconsistent naming produces inconsistent SDK method names across TypeScript and Python, which are published artifacts.

Suggested Direction

  1. Write down the convention first in CONTRIBUTING.md (see the CONTRIBUTING issue):
    • one primary DTO per file, named <Domain><Action>Dto (e.g. CreatePortfolioDto, UpdateFileMetadataDto)
    • colocate in a dto/ directory under the owning module
    • request DTOs and response DTOs in separate files where the shapes differ substantially
  2. Audit the 61 files against it and produce a summary of deviations.
  3. Migrate incrementally, one module at a time — src/infrastructure/file-upload/ first since its six-DTO single file is the worst offender.
  4. Do not rename a DTO class without checking docs/openapi.json: the class name becomes the published schema name, so a rename is a breaking SDK change.

Constraints

  • Class renames are breaking for generated SDKs. If a rename is needed, coordinate a major SDK version or keep the old name and add a deprecated alias.
  • src/common/pipes/validation.pipe.ts formats errors into { field, constraints, messages, children }. Any DTO restructuring must keep that response shape, since clients depend on it and there are tests on it.
  • Keep class-validator decorators consistent — @IsOptional() plus explicit validators rather than relying on inference.

Acceptance Criteria

  • The convention is documented in CONTRIBUTING.md.
  • A deviation audit exists covering all 61 DTO files.
  • src/infrastructure/file-upload/dto/ is split into per-DTO files.
  • No DTO class name changes without a corresponding docs/openapi.json review.
  • npx tsc --noEmit and npm test pass.
Dominant language
TypeScript
Stars
7
Forks
55
Avg merge
1d 17h
Merged PRs (30d)
5

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SourceXXL/alian_structure-api

All issues in SourceXXL/alian_structure-api

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.