Skip to content
Merged
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
Expand Up @@ -13,6 +13,7 @@
import java.util.TreeMap;
import java.util.stream.Collectors;

import io.mosip.kernel.core.idvalidator.exception.InvalidIDException;
import jakarta.annotation.PostConstruct;

import org.apache.commons.lang3.exception.ExceptionUtils;
Expand Down Expand Up @@ -535,6 +536,7 @@ public MainResponseDTO<BookingRegistrationDTO> getAppointmentDetails(String preR
responseDto.setVersion(versionUrl);
RegistrationBookingEntity entity = null;
try {
this.applicationIdValidation(preRegID);
// This call will check if the PRID belongs to the logged in user or not
serviceUtil.checkApplicationStatus(preRegID);
entity = bookingDAO.findByPreRegistrationId(preRegID);
Expand All @@ -558,6 +560,15 @@ public MainResponseDTO<BookingRegistrationDTO> getAppointmentDetails(String preR
return responseDto;
}

private void applicationIdValidation(String applicationId) {
if (applicationId == null || applicationId.trim().isEmpty()) {
throw new InvalidIDException(
ErrorCodes.PRG_BOOK_RCI_022.getCode(),
"preRegistrationId cannot be empty."
);
}
}

/*
* (non-Javadoc)
*
Expand Down
Loading