Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 벌레 0마리인 경우 내역 저장되지 않도록 수정 #199

Merged
merged 1 commit into from
Nov 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/main/java/com/moabam/api/application/bug/BugService.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ public PurchaseProductResponse purchaseBugProduct(Long memberId, Long productId,

@Transactional
public void use(Member member, BugType bugType, int count) {
if (count == 0) {
return;
}

Bug bug = member.getBug();

bug.use(bugType, count);
Expand All @@ -88,6 +92,10 @@ public void use(Member member, BugType bugType, int count) {

@Transactional
public void reward(Member member, BugType bugType, int count) {
if (count == 0) {
return;
}

Bug bug = member.getBug();

bug.increase(bugType, count);
Expand All @@ -104,6 +112,10 @@ public void charge(Long memberId, Product bugProduct) {

@Transactional
public void applyCoupon(Long memberId, BugType bugType, int count) {
if (count == 0) {
return;
}

Bug bug = getByMemberId(memberId);

bug.increase(bugType, count);
Expand Down