Skip to content

TransferUpdateRequestDto PositiveOrZero로 불변식 변경#232

Merged
chungjeongsu merged 2 commits into
developfrom
fix/update-transfer-dto
May 25, 2026
Merged

TransferUpdateRequestDto PositiveOrZero로 불변식 변경#232
chungjeongsu merged 2 commits into
developfrom
fix/update-transfer-dto

Conversation

@chungjeongsu

Copy link
Copy Markdown
Contributor

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the TransferUpdateRequestDto to allow a totalAmount of zero by changing the validation annotation to @PositiveOrZero. Feedback highlights a discrepancy between this DTO change and the domain entity's validation logic, which still prohibits zero values. Additionally, a typo in the validation error message was noted, incorrectly referring to 'member amount' instead of 'totalAmount'.

String bankName,
String accountHolder,
@Positive(message = "totalAmount must be greater than zero")
@PositiveOrZero(message = "member amount must be greater than or equal to zero")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

DTO에서 totalAmount에 대해 0을 허용하도록(@PositiveOrZero) 변경하셨으나, Transfer 도메인 엔티티의 validateTotalAmount 메서드(131라인)에서는 여전히 0 이하의 값을 허용하지 않고 있습니다. 불변식을 0을 포함하도록 변경하는 것이 의도라면, 도메인 엔티티의 유효성 검사 로직도 함께 수정해야 런타임 에러를 방지할 수 있습니다.

String bankName,
String accountHolder,
@Positive(message = "totalAmount must be greater than zero")
@PositiveOrZero(message = "member amount must be greater than or equal to zero")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

totalAmount 필드에 대한 검증 메시지가 member amount로 잘못 작성되어 있습니다. 필드명에 맞게 totalAmount로 수정하는 것이 적절합니다.

Suggested change
@PositiveOrZero(message = "member amount must be greater than or equal to zero")
@PositiveOrZero(message = "totalAmount must be greater than or equal to zero")

@chungjeongsu chungjeongsu merged commit 34f8db5 into develop May 25, 2026
1 check passed
@chungjeongsu chungjeongsu deleted the fix/update-transfer-dto branch May 25, 2026 07:23
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.

1 participant