Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.doubleo.passservice.domain.pass.dto.response;

import com.doubleo.passservice.domain.pass.dto.AreaInfo;
import com.doubleo.passservice.domain.pass.dto.GuardianInfo;
import com.doubleo.passservice.domain.pass.enums.IssuanceStatus;
import com.doubleo.passservice.domain.pass.enums.VisitCategory;
Expand All @@ -12,7 +13,7 @@ public record MemberPassInfoResponse(
Long passId,
Long memberId,
Long hospitalId,
List<String> accessAreaNames,
List<AreaInfo> accessAreas,
VisitCategory visitCategory,
Long patientId,
String patientName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.doubleo.passservice.domain.notification.service.FcmService;
import com.doubleo.passservice.domain.pass.domain.Pass;
import com.doubleo.passservice.domain.pass.domain.PassArea;
import com.doubleo.passservice.domain.pass.dto.AreaInfo;
import com.doubleo.passservice.domain.pass.dto.GuardianInfo;
import com.doubleo.passservice.domain.pass.dto.response.MemberPassInfoResponse;
import com.doubleo.passservice.domain.pass.dto.response.PassCreateResponse;
Expand Down Expand Up @@ -58,16 +59,17 @@ public class PassServiceImpl implements PassService {
public List<MemberPassInfoResponse> getAllMemberPassInfo(Long memberId) {
List<Pass> passes = passRepository.findAllByMemberId(memberId);
List<MemberPassInfoResponse> responses = new ArrayList<>();

for (Pass pass : passes) {
List<PassArea> passAreas = passAreaRepository.findAllByPass(pass);
List<String> areaNames = new ArrayList<>();
List<AreaInfo> accessAreas = new ArrayList<>();
for (PassArea passArea : passAreas) {
String areaName =
areaClient
.getAreaFullNameByCode(
passArea.getTenantId(), passArea.getAreaCode())
.getAreaFullName();
areaNames.add(areaName);
accessAreas.add(new AreaInfo(passArea.getAreaCode(), areaName));
}
Long patientId = pass.getPatientId();
PatientResponse patient = patientClient.getPatientById(patientId);
Expand All @@ -89,7 +91,7 @@ public List<MemberPassInfoResponse> getAllMemberPassInfo(Long memberId) {
pass.getId(),
pass.getMemberId(),
pass.getHospitalId(),
areaNames,
accessAreas,
pass.getVisitCategory(),
patientId,
patient.getName(),
Expand Down