Skip to content

Commit

Permalink
Merge pull request #122 from Hanaro-trip-together-bank/feature/team
Browse files Browse the repository at this point in the history
fix: 모임서비스 상세 선호 여행 리턴
  • Loading branch information
mummhy0811 authored Jun 5, 2024
2 parents 50e5614 + 7e24df5 commit e38a8ed
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ public class DetailTeamResDto {
private String accNumber;
private BigDecimal accBalance;
private TeamMemberState teamMemberState;
private Long preferTripIdx;
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,14 @@ public DetailTeamResDto detailTeam(DetailTeamReqDto detailTeamReqDto) {
Team team = teamRepository.findById(detailTeamReqDto.getTeamIdx()).orElseThrow(() -> new ApiException(ExceptionEnum.TEAM_NOT_FOUND));
TeamMember teamMember = teamMemberRepository.findById(detailTeamReqDto.getTeamMemberIdx()).orElseThrow(() -> new ApiException(ExceptionEnum.TEAM_MEMBER_NOT_FOUND));

DetailTeamResDto detailTeamResDto = DetailTeamResDto.builder()
return DetailTeamResDto.builder()
.preferTripIdx(team.getPreferTrip().getTripIdx())
.teamNotice(team.getTeamNotice())
.teamName(team.getTeamName())
.accNumber(team.getAccount().getAccNumber())
.accBalance(team.getAccount().getAccBalance())
.teamMemberState(teamMember.getTeamMemberState())
.build();

return detailTeamResDto;
}

// 모임서비스 나가기 (전체 내보내기 후 모임 삭제)
Expand Down
7 changes: 7 additions & 0 deletions src/test/java/com/hanaro/triptogether/TeamServiceTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.hanaro.triptogether.team.service.impl.TeamServiceImpl;
import com.hanaro.triptogether.teamMember.domain.TeamMember;
import com.hanaro.triptogether.teamMember.domain.TeamMemberRepository;
import com.hanaro.triptogether.trip.domain.Trip;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -51,6 +52,7 @@ public class TeamServiceTests {
private Long memberIdx = 1L;
private TeamMember teamMember;
private Long teamMemberIdx = 1L;
private Trip trip;

@BeforeEach
void setUp() {
Expand All @@ -75,13 +77,18 @@ void setUp() {
.createdAt(LocalDateTime.now())
.build();

trip = Trip.builder()
.tripIdx(1L)
.build();

team = Team.builder()
.teamIdx(teamIdx)
.account(account)
.teamName("Team Name")
.preferenceType(PreferenceType.해외)
.teamNotice("Team Notice")
.createdAt(LocalDateTime.now())
.preferTrip(trip)
.build();

teamMember = TeamMember.builder()
Expand Down

0 comments on commit e38a8ed

Please sign in to comment.