Skip to content

Commit

Permalink
Merge pull request #215 from Yanol-Market/feature/chat-status-error
Browse files Browse the repository at this point in the history
fix: 채팅방 상세 조회 - 채팅상태: 양도대기중 - 바로 결제인 경우 추가
  • Loading branch information
dldmldlsy authored Jan 24, 2024
2 parents f36c7ca + 0066442 commit 8e27cb7
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
import site.goldenticket.domain.chat.dto.response.ChatRoomDetailResponse;
import site.goldenticket.domain.chat.dto.response.ChatRoomInfoResponse;
import site.goldenticket.domain.chat.dto.response.ChatRoomListResponse;
import site.goldenticket.domain.chat.dto.response.ChatRoomShortListResponse;
import site.goldenticket.domain.chat.dto.response.ChatRoomResponse;
import site.goldenticket.domain.chat.dto.response.ChatRoomShortListResponse;
import site.goldenticket.domain.chat.dto.response.ChatRoomShortResponse;
import site.goldenticket.domain.chat.entity.Chat;
import site.goldenticket.domain.chat.entity.ChatRoom;
Expand Down Expand Up @@ -216,7 +216,7 @@ public void createStartMessageOfNewChatRoom(Long chatRoomId) {
* @param nickname 회원 닉네임
* @return 메세지
*/
private String createEntranceMessage (String nickname) {
private String createEntranceMessage(String nickname) {
return nickname + "님이 입장하셨습니다.";
}

Expand Down Expand Up @@ -389,7 +389,13 @@ private String getStatusOfChatRoom(Long buyerId, Long productId) {
product.getId()).orElseThrow(() -> new CustomException(NEGO_NOT_FOUND));
if (nego.getStatus().equals(NegotiationStatus.PAYMENT_PENDING)) {
chatStatus = "PAYMENT_PENDING";
} else if (nego.getStatus().equals(NegotiationStatus.TRANSFER_PENDING)) {
}
} else if (product.getProductStatus().equals(ProductStatus.RESERVED)) {
Order order = orderRepository.findByProductIdAndStatus(product.getId(),
OrderStatus.WAITING_TRANSFER)
.orElseThrow(() -> new CustomException(ORDER_NOT_FOUND));
if (order.getUserId().equals(buyerId) && order.getStatus()
.equals(OrderStatus.WAITING_TRANSFER)) {
chatStatus = "TRANSFER_PENDING";
}
} else if (product.getProductStatus().equals(ProductStatus.SOLD_OUT)) {
Expand Down

0 comments on commit 8e27cb7

Please sign in to comment.