Skip to content

Commit

Permalink
MOSIP-36033 fix bug in discard entire application feature (#740)
Browse files Browse the repository at this point in the history
Signed-off-by: ymahtat-dev <[email protected]>
  • Loading branch information
ymahtat-dev authored Oct 15, 2024
1 parent 433fe1d commit ba0a7e6
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -668,14 +668,13 @@ public MainResponseDTO<DeletePreRegistartionDTO> deleteIndividual(String preregI
if ((demographicEntity.getStatusCode().equals(StatusCodes.BOOKED.getCode()))) {
getBookingServiceToDeleteAllByPreId(preregId);
}
int isDeletedDemo = demographicRepository.deleteByPreRegistrationId(preregId);
serviceUtil.deleteApplicationFromApplications(preregId);
if (isDeletedDemo > 0) {
try {
this.demographicRepository.delete(demographicEntity);
serviceUtil.deleteApplicationFromApplications(preregId);
deleteDto.setPreRegistrationId(preregId);
deleteDto.setDeletedBy(userId);
deleteDto.setDeletedDateTime(new Date(System.currentTimeMillis()));

} else {
} catch (Exception e) {
throw new RecordFailedToDeleteException(DemographicErrorCodes.PRG_PAM_APP_004.getCode(),
DemographicErrorMessages.FAILED_TO_DELETE_THE_PRE_REGISTRATION_RECORD
.getMessage());
Expand Down

0 comments on commit ba0a7e6

Please sign in to comment.