Skip to content

Comments

Chore: Refactor ExecuteSweepDto to Domain Command #58

Open
dimka90 wants to merge 1 commit intobridgelet-org:mainfrom
dimka90:chore/issue-1-refactor-sweep-dto
Open

Chore: Refactor ExecuteSweepDto to Domain Command #58
dimka90 wants to merge 1 commit intobridgelet-org:mainfrom
dimka90:chore/issue-1-refactor-sweep-dto

Conversation

@dimka90
Copy link

@dimka90 dimka90 commented Feb 23, 2026

PR Description

Summary

Refactored the internal sweep execution model to accurately reflect its role as a Domain Command rather than a transport-layer DTO. This change ensures internal orchestration contracts are clearly distinguished from API payload models, aligning with NestJS architectural patterns.

Changes

  • Renamed ExecuteSweepDto interface to SweepExecutionRequest.
  • Renamed file from execute-sweep.dto.ts to execute-sweep.command.ts.
  • Updated all internal usages in SweepsService and ValidationProvider.
  • Refined variable naming across the sweeps module, replacing generic dto with descriptive command or sweepCommand.
  • Added TSDoc documentation to the interface to explicitly state its purpose and prevent future misuse at controller boundaries.

Why this matters

  • Architectural Clarity: Prevents confusion for new contributors by aligning terminology with NestJS expectations.
  • Risk Reduction: Reduces the risk of accidentally exposing internal models as API contracts, which could bypass validation.
  • Improved Readability: Descriptive naming clarifies intent in the service and validation logic.

Verification Results

All checks required by CONTRIBUTING.md have been performed and passed:

  • Linting: npm run lint passed.
  • Build: npm run build passed.
  • Unit Tests: npm test -- sweeps.service.spec.ts passed.

Non-Goals achieved

  • Zero functional regressions.
  • No changes to validation logic or business rules.
  • No conversion to class-based models (kept as a lightweight interface).

Closes #51

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clarify Intent of ExecuteSweepDto and Rename to Reflect Domain Command (Not a Transport DTO)

1 participant