-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 벌레 내역 조회 API 구현 * refactor: 결제 테이블 coupon_id 컬럼을 discount_amount로 변경 * test: 벌레 내역 조회 컨트롤러 통합 테스트 * fix: 테스트 오류 수정 * chore: 사용하지 않는 메서드 제거 * refactor: Response 분리 * style: 줄바꿈 제거
- Loading branch information
Showing
16 changed files
with
267 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
src/main/java/com/moabam/api/domain/coupon/repository/CouponWalletRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
package com.moabam.api.domain.coupon.repository; | ||
|
||
import java.util.Optional; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import com.moabam.api.domain.coupon.CouponWallet; | ||
|
||
public interface CouponWalletRepository extends JpaRepository<CouponWallet, Long> { | ||
|
||
Optional<CouponWallet> findByIdAndMemberId(Long id, Long memberId); | ||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/com/moabam/api/dto/bug/BugHistoryItemResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.moabam.api.dto.bug; | ||
|
||
import static com.fasterxml.jackson.annotation.JsonInclude.Include.*; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.moabam.api.domain.bug.BugActionType; | ||
import com.moabam.api.domain.bug.BugType; | ||
import com.moabam.api.dto.payment.PaymentResponse; | ||
|
||
import lombok.Builder; | ||
|
||
@Builder | ||
public record BugHistoryItemResponse( | ||
Long id, | ||
BugType bugType, | ||
BugActionType actionType, | ||
int quantity, | ||
String date, | ||
@JsonInclude(NON_NULL) PaymentResponse payment | ||
) { | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/com/moabam/api/dto/bug/BugHistoryResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.moabam.api.dto.bug; | ||
|
||
import java.util.List; | ||
|
||
import lombok.Builder; | ||
|
||
@Builder | ||
public record BugHistoryResponse( | ||
List<BugHistoryItemResponse> history | ||
) { | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/com/moabam/api/dto/bug/BugHistoryWithPayment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.moabam.api.dto.bug; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
import com.moabam.api.domain.bug.BugActionType; | ||
import com.moabam.api.domain.bug.BugType; | ||
import com.moabam.api.domain.payment.Payment; | ||
|
||
import lombok.Builder; | ||
|
||
@Builder | ||
public record BugHistoryWithPayment( | ||
Long id, | ||
BugType bugType, | ||
BugActionType actionType, | ||
int quantity, | ||
LocalDateTime createdAt, | ||
Payment payment | ||
) { | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/moabam/api/dto/payment/PaymentResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.moabam.api.dto.payment; | ||
|
||
import lombok.Builder; | ||
|
||
@Builder | ||
public record PaymentResponse( | ||
Long id, | ||
String orderName, | ||
int discountAmount, | ||
int totalAmount | ||
) { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/main/java/com/moabam/global/common/util/DateUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.moabam.global.common.util; | ||
|
||
import java.time.LocalDateTime; | ||
import java.time.format.DateTimeFormatter; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.NoArgsConstructor; | ||
|
||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
public final class DateUtils { | ||
|
||
private static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); | ||
|
||
public static String format(LocalDateTime dateTime) { | ||
return dateTime.format(formatter); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.