-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a4b31a3
commit 40bf044
Showing
8 changed files
with
158 additions
and
38 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
22 changes: 22 additions & 0 deletions
22
src/main/java/com/jangburich/domain/payment/domain/TeamChargeHistoryResponse.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.jangburich.domain.payment.domain; | ||
|
||
import com.querydsl.core.annotations.QueryProjection; | ||
|
||
import lombok.Builder; | ||
|
||
@Builder | ||
public record TeamChargeHistoryResponse( | ||
Long id, | ||
String transactionId, | ||
Integer paymentAmount, | ||
PaymentChargeStatus paymentChargeStatus | ||
) { | ||
@QueryProjection | ||
public TeamChargeHistoryResponse(Long id, String transactionId, Integer paymentAmount, | ||
PaymentChargeStatus paymentChargeStatus) { | ||
this.id = id; | ||
this.transactionId = transactionId; | ||
this.paymentAmount = paymentAmount; | ||
this.paymentChargeStatus = paymentChargeStatus; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...ain/java/com/jangburich/domain/payment/domain/repository/TeamChargeHistoryRepository.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,11 +1,19 @@ | ||
package com.jangburich.domain.payment.domain.repository; | ||
|
||
import com.jangburich.domain.payment.domain.TeamChargeHistory; | ||
import com.jangburich.domain.payment.domain.TeamChargeHistoryResponse; | ||
import com.jangburich.domain.team.domain.Team; | ||
|
||
import java.util.Optional; | ||
|
||
import org.springframework.data.domain.Page; | ||
import org.springframework.data.domain.Pageable; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface TeamChargeHistoryRepository extends JpaRepository<TeamChargeHistory, Long> { | ||
Optional<TeamChargeHistory> findByTransactionId(String tid); | ||
|
||
Page<TeamChargeHistoryResponse> findAllByTeam(Team team, Pageable pageable); | ||
} |
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
34 changes: 34 additions & 0 deletions
34
...main/java/com/jangburich/domain/store/domain/dto/response/PaymentGroupDetailResponse.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,34 @@ | ||
package com.jangburich.domain.store.domain.dto.response; | ||
|
||
import org.springframework.data.domain.Page; | ||
|
||
import com.jangburich.domain.payment.domain.TeamChargeHistoryResponse; | ||
import com.jangburich.domain.user.domain.User; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
@RequiredArgsConstructor | ||
public class PaymentGroupDetailResponse { | ||
private String teamName; | ||
private Integer point; | ||
private Integer remainPoint; | ||
private String teamLeaderName; | ||
private String teamLeaderPhoneNum; | ||
private Page<TeamChargeHistoryResponse> historyResponses; | ||
|
||
public static PaymentGroupDetailResponse create(String teamName, Integer point, Integer remainPoint, | ||
User teamLeader, Page<TeamChargeHistoryResponse> historyResponses) { | ||
PaymentGroupDetailResponse paymentGroupDetailResponse = new PaymentGroupDetailResponse(); | ||
paymentGroupDetailResponse.setTeamName(teamName); | ||
paymentGroupDetailResponse.setPoint(point); | ||
paymentGroupDetailResponse.setRemainPoint(remainPoint); | ||
paymentGroupDetailResponse.setTeamLeaderName(teamLeader.getNickname()); | ||
paymentGroupDetailResponse.setTeamLeaderPhoneNum(teamLeader.getPhoneNumber()); | ||
paymentGroupDetailResponse.setHistoryResponses(historyResponses); | ||
return paymentGroupDetailResponse; | ||
} | ||
} |
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