Skip to content

Commit

Permalink
fix: memberId 가져오기로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
ymkim97 committed Nov 27, 2023
1 parent 8dfd20b commit afbb2f8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package com.moabam.api.application.room;

import static com.moabam.global.common.util.GlobalConstant.NOT_COMPLETED_RANK;
import static com.moabam.global.common.util.GlobalConstant.ROOM_FIXED_SEARCH_SIZE;
import static com.moabam.global.common.util.GlobalConstant.*;
import static com.moabam.global.error.model.ErrorMessage.*;
import static org.apache.commons.lang3.StringUtils.isEmpty;
import static org.apache.commons.lang3.StringUtils.*;

import java.time.LocalDate;
import java.time.Period;
Expand Down Expand Up @@ -195,7 +194,7 @@ public UnJoinedRoomDetailsResponse getUnJoinedRoomDetails(Long roomId) {
List<DailyMemberCertification> sortedDailyMemberCertifications =
certificationsSearchRepository.findSortedDailyMemberCertifications(roomId, clockHolder.date());
List<Long> memberIds = sortedDailyMemberCertifications.stream()
.map(DailyMemberCertification::getId)
.map(DailyMemberCertification::getMemberId)
.toList();
List<Member> members = memberService.getRoomMembers(memberIds);
List<Inventory> inventories = inventorySearchRepository.findDefaultInventories(memberIds,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -993,22 +993,25 @@ void get_un_joined_room_details() throws Exception {
Room room = RoomFixture.room("테스트 방", NIGHT, 21);
Room savedRoom = roomRepository.save(room);

Member member1 = MemberFixture.member("901010", "testtest");
member1 = memberRepository.save(member1);

Item item = ItemFixture.nightMageSkin();

Inventory inventory = InventoryFixture.inventory(1L, item);
Inventory inventory = InventoryFixture.inventory(member1.getId(), item);
inventory.select();

itemRepository.save(item);
inventoryRepository.save(inventory);

Participant participant = RoomFixture.participant(savedRoom, member.getId());
Participant participant = RoomFixture.participant(savedRoom, member1.getId());
participantRepository.save(participant);

Routine routine1 = RoomFixture.routine(savedRoom, "물 마시기");
Routine routine2 = RoomFixture.routine(savedRoom, "커피 마시기");
routineRepository.saveAll(List.of(routine1, routine2));

DailyMemberCertification dailyMemberCertification = RoomFixture.dailyMemberCertification(member.getId(),
DailyMemberCertification dailyMemberCertification = RoomFixture.dailyMemberCertification(member1.getId(),
savedRoom.getId(), participant);
dailyMemberCertificationRepository.save(dailyMemberCertification);

Expand Down

0 comments on commit afbb2f8

Please sign in to comment.