-
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.
Merge pull request #35 from 9oormthon-univ/feat/store
Feat/store
- Loading branch information
Showing
9 changed files
with
222 additions
and
48 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
25 changes: 25 additions & 0 deletions
25
src/main/java/com/jangburich/domain/store/domain/StoreTeamResponseDTO.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,25 @@ | ||
package com.jangburich.domain.store.domain; | ||
|
||
import com.jangburich.domain.team.domain.Team; | ||
import com.querydsl.core.annotations.QueryProjection; | ||
|
||
import lombok.Builder; | ||
|
||
@Builder | ||
public record StoreTeamResponseDTO( | ||
Long id, | ||
Integer point, | ||
Long teamId, | ||
String teamName, | ||
Long storeId | ||
|
||
) { | ||
@QueryProjection | ||
public StoreTeamResponseDTO(Long id, Integer point, Long teamId, String teamName, Long storeId) { | ||
this.id = id; | ||
this.point = point; | ||
this.teamId = teamId; | ||
this.teamName = teamName; | ||
this.storeId = storeId; | ||
} | ||
} |
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
Oops, something went wrong.