We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 60faa37 commit 22be7b6Copy full SHA for 22be7b6
1 file changed
apps/commerce-api/src/main/java/com/loopers/domain/product/Stock.java
@@ -45,6 +45,9 @@ public Stock decrease(Integer quantity) {
45
}
46
47
public boolean isAvailable(Integer quantity) {
48
+ if (quantity == null || quantity <= 0) {
49
+ throw new CoreException(ErrorType.BAD_REQUEST, "요청 수량은 0보다 커야 합니다.");
50
+ }
51
return this.value >= quantity;
52
53
0 commit comments