Updated response of communication API

This commit is contained in:
rajesh
2025-10-14 19:41:00 +05:30
parent 43a940f569
commit c469b08e18
6 changed files with 42 additions and 28 deletions

View File

@@ -120,11 +120,17 @@ public class CommunicationDao {
public ApplicationAmendmentResponse getAmendmentComments(Long amendmentId) {
ApplicationAmendmentRequestEntity amendmentData = applicationAmendmentRequestService.validateApplicationAmendmentRequest(amendmentId);
List<CommunicationResponseBean> commentsList = communicationRepository.findCommentListDetailsByAmendmentId(amendmentId);
List<CommunicationEntity> commentsList = communicationRepository.findByApplicationAmendmentRequestIdAndIsDeletedFalse(amendmentId);
if (commentsList == null) {
throw new CustomValidationException(Status.NOT_FOUND, Translator.toLocale(GepafinConstant.COMMENT_NOT_FOUND));
}
return new ApplicationAmendmentResponse(amendmentData, commentsList);
List<CommunicationResponseBean> communicationResponseBeans=new ArrayList<>();
for(CommunicationEntity communicationEntity:commentsList){
List<DocumentResponseBean> communicationDocumentBeans=getDocumentResponseBean(communicationEntity);
CommunicationResponseBean communicationResponseBean=convertToCommunicationResponseBean(communicationEntity,communicationDocumentBeans);
communicationResponseBeans.add(communicationResponseBean);
}
return new ApplicationAmendmentResponse(amendmentData, communicationResponseBeans);
}
public CommunicationResponseBean updateAmendmentComment(CommunicationRequestBean communicationRequestBean, Long amendmentId, Long commentId) {