Controller
HTTP 입력
요청을 해석하고 DTO를 만든다.
Nest 모듈 안에서 Controller, Application Service, Domain, Repository, Infrastructure 책임을 분리해 연결한다.
Controller
요청을 해석하고 DTO를 만든다.
Application Service
흐름을 만들지만 규칙은 갖지 않는다.
Domain Model
불변식과 상태 변경을 책임진다.
Repository Port
도메인이 필요한 저장 기능만 약속한다.
Infrastructure
TypeORM, Prisma, 외부 API를 감싼다.
NestJS 모듈 안의 DDD 계층 매핑 기술 모듈 안에서도 도메인 모델을 안쪽에 두면 변경 이유가 더 명확해진다.