Skip to content

Commit 5689cf3

Browse files
authored
Merge pull request #162 from 9oormthon-univ/develop
Develop
2 parents a7bdd55 + d52f7c2 commit 5689cf3

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

src/main/java/com/jangburich/domain/order/domain/OrderResponse.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@
1010
@Getter
1111
@RequiredArgsConstructor
1212
public class OrderResponse {
13+
private Long id;
1314
private String userName;
1415
private LocalDateTime date;
1516
private String price;
1617

17-
public OrderResponse(String userName, LocalDateTime date, String price) {
18+
public OrderResponse(Long id, String userName, LocalDateTime date, String price) {
19+
this.id = id;
1820
this.userName = userName;
1921
this.date = date;
2022
this.price = price;

src/main/java/com/jangburich/domain/store/dto/response/PaymentGroupDetailResponse.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.util.List;
44

55
import com.jangburich.domain.order.domain.OrderResponse;
6+
import com.jangburich.domain.team.domain.Team;
67
import com.jangburich.domain.user.domain.User;
78

89
import lombok.Getter;
@@ -14,20 +15,24 @@
1415
@RequiredArgsConstructor
1516
public class PaymentGroupDetailResponse {
1617
private String teamName;
18+
private String teamDescription;
1719
private Integer point;
1820
private Integer remainPoint;
1921
private String teamLeaderName;
2022
private String teamLeaderPhoneNum;
23+
private String teamLeaderProfileImageUrl;
2124
private List<OrderResponse> historyResponses;
2225

23-
public static PaymentGroupDetailResponse create(String teamName, Integer point, Integer remainPoint,
26+
public static PaymentGroupDetailResponse create(Team team, Integer point, Integer remainPoint,
2427
User teamLeader, List<OrderResponse> historyResponses) {
2528
PaymentGroupDetailResponse paymentGroupDetailResponse = new PaymentGroupDetailResponse();
26-
paymentGroupDetailResponse.setTeamName(teamName);
29+
paymentGroupDetailResponse.setTeamName(team.getName());
30+
paymentGroupDetailResponse.setTeamDescription(team.getDescription());
2731
paymentGroupDetailResponse.setPoint(point);
2832
paymentGroupDetailResponse.setRemainPoint(remainPoint);
2933
paymentGroupDetailResponse.setTeamLeaderName(teamLeader.getNickname());
3034
paymentGroupDetailResponse.setTeamLeaderPhoneNum(teamLeader.getPhoneNumber());
35+
paymentGroupDetailResponse.setTeamLeaderProfileImageUrl(teamLeader.getProfileImageUrl());
3136
paymentGroupDetailResponse.setHistoryResponses(historyResponses);
3237
return paymentGroupDetailResponse;
3338
}

src/main/java/com/jangburich/domain/store/service/StoreService.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package com.jangburich.domain.store.service;
22

3-
import com.jangburich.domain.store.dto.StoreTeamResponse;
4-
import com.jangburich.domain.store.dto.response.StoreSearchDetailsResponse;
53
import java.time.LocalDate;
64
import java.time.LocalDateTime;
75
import java.util.ArrayList;
@@ -35,8 +33,6 @@
3533
import com.jangburich.domain.store.domain.StoreTeam;
3634
import com.jangburich.domain.store.domain.StoreUpdateRequestDTO;
3735
import com.jangburich.domain.store.dto.StoreTeamResponse;
38-
import com.jangburich.domain.store.dto.condition.StoreSearchCondition;
39-
import com.jangburich.domain.store.dto.condition.StoreSearchConditionWithType;
4036
import com.jangburich.domain.store.dto.response.OrdersDetailResponse;
4137
import com.jangburich.domain.store.dto.response.OrdersGetResponse;
4238
import com.jangburich.domain.store.dto.response.OrdersTodayResponse;
@@ -215,13 +211,13 @@ public StoreGetResponseDTO getStoreInfo(String authentication) {
215211

216212
public List<com.jangburich.domain.store.dto.StoreTeamResponse> getPaymentGroup(String userId) {
217213
User user = userRepository.findByProviderId(userId)
218-
.orElseThrow(() -> new DefaultNullPointerException(ErrorCode.INVALID_AUTHENTICATION));
214+
.orElseThrow(() -> new DefaultNullPointerException(ErrorCode.INVALID_AUTHENTICATION));
219215

220216
Owner owner = ownerRepository.findByUser(user)
221-
.orElseThrow(() -> new DefaultNullPointerException(ErrorCode.INVALID_AUTHENTICATION));
217+
.orElseThrow(() -> new DefaultNullPointerException(ErrorCode.INVALID_AUTHENTICATION));
222218

223219
Store store = storeRepository.findByOwner(owner)
224-
.orElseThrow(() -> new DefaultNullPointerException(ErrorCode.INVALID_AUTHENTICATION));
220+
.orElseThrow(() -> new DefaultNullPointerException(ErrorCode.INVALID_AUTHENTICATION));
225221

226222
return storeTeamRepository.findAllByStore(store)
227223
.stream()
@@ -273,10 +269,11 @@ public PaymentGroupDetailResponse getPaymentGroupDetail(String userId, Long team
273269
for (Cart cart : cartRepository.findAllByOrders(order)) {
274270
price += cart.getMenu().getPrice();
275271
}
276-
return new OrderResponse(order.getUser().getName(), order.getUpdatedAt(), String.valueOf(price));
272+
return new OrderResponse(order.getId(), order.getUser().getName(), order.getUpdatedAt(),
273+
String.valueOf(price));
277274
}).toList();
278275

279-
return PaymentGroupDetailResponse.create(team.getName(), storeTeam.getPoint(), storeTeam.getRemainPoint(),
276+
return PaymentGroupDetailResponse.create(team, storeTeam.getPoint(), storeTeam.getRemainPoint(),
280277
teamLeader, orderResponse);
281278
}
282279

0 commit comments

Comments
 (0)