Skip to content

Commit

Permalink
회비 정보 조회 시 회비 요청자 정보가 잘못 들어가는 문제 수정 완료 (#458)
Browse files Browse the repository at this point in the history
  • Loading branch information
limehee authored Aug 12, 2024
1 parent 3388e82 commit 6b573b2
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import page.clab.api.domain.memberManagement.member.application.dto.shared.MemberDetailedInfoDto;
import page.clab.api.domain.memberManagement.member.application.dto.shared.MemberBasicInfoDto;
import page.clab.api.domain.members.membershipFee.application.dto.response.MembershipFeeResponseDto;
import page.clab.api.domain.members.membershipFee.application.port.in.RetrieveMembershipFeesByConditionsUseCase;
import page.clab.api.domain.members.membershipFee.application.port.out.RetrieveMembershipFeePort;
Expand All @@ -24,9 +24,13 @@ public class MembershipFeesByConditionsRetrievalService implements RetrieveMembe
@Transactional(readOnly = true)
@Override
public PagedResponseDto<MembershipFeeResponseDto> retrieveMembershipFees(String memberId, String memberName, String category, MembershipFeeStatus status, Pageable pageable) {
MemberDetailedInfoDto memberInfo = externalRetrieveMemberUseCase.getCurrentMemberDetailedInfo();
Page<MembershipFee> membershipFeesPage = retrieveMembershipFeePort.findByConditions(memberId, memberName, category, status, pageable);
return new PagedResponseDto<>(membershipFeesPage.map(membershipFee ->
MembershipFeeResponseDto.toDto(membershipFee, memberInfo.getMemberName(), memberInfo.isAdminRole())));
Page<MembershipFee> membershipFees = retrieveMembershipFeePort.findByConditions(memberId, memberName, category, status, pageable);
boolean currentMemberIsAdmin = externalRetrieveMemberUseCase.getCurrentMemberDetailedInfo().isAdminRole();
return new PagedResponseDto<>(membershipFees.map(membership -> getMembershipFeeResponseDto(membership, currentMemberIsAdmin)));
}

private MembershipFeeResponseDto getMembershipFeeResponseDto(MembershipFee membershipFee, boolean isAdminRole) {
MemberBasicInfoDto memberInfo = externalRetrieveMemberUseCase.getMemberBasicInfoById(membershipFee.getMemberId());
return MembershipFeeResponseDto.toDto(membershipFee, memberInfo.getMemberName(), isAdminRole);
}
}

0 comments on commit 6b573b2

Please sign in to comment.