Done ticket GEPAFINBE-214

This commit is contained in:
nisha
2025-04-30 17:44:00 +05:30
parent 2625b287ff
commit 11e09b8eb9
6 changed files with 12 additions and 14 deletions

View File

@@ -986,7 +986,7 @@ public class CallDao {
return callEntity;
}
public PageableResponseBean<List<CallDetailsResponseBean>> getAllCallsByPagination(HttpServletRequest request,UserEntity user,Long companyId , Boolean onlyPreferredCall, CallPageableRequestBean callPageableRequestBean) {
public PageableResponseBean<List<CallDetailsResponseBean>> getAllCallsByPagination(HttpServletRequest request,UserEntity user,Long companyId , Boolean onlyPreferredCall, Boolean onlyConfidiCall, CallPageableRequestBean callPageableRequestBean) {
Integer pageNo = null;
Integer pageLimit = null;
if (callPageableRequestBean.getGlobalFilters() != null) {
@@ -1006,7 +1006,7 @@ public class CallDao {
);
}
expirePublishedCalls(request);
Specification<CallEntity> spec = search(request,user, callPageableRequestBean);
Specification<CallEntity> spec = search(request,user, callPageableRequestBean,onlyConfidiCall);
Page<CallEntity> entityPage;
if (Boolean.TRUE.equals(onlyPreferredCall)) {
validator.validateUserWithCompany(request, companyId);
@@ -1056,10 +1056,10 @@ public class CallDao {
return pageableResponseBean;
}
public Specification<CallEntity> search(HttpServletRequest request,UserEntity userEntity, CallPageableRequestBean callPageableRequestBean) {
public Specification<CallEntity> search(HttpServletRequest request,UserEntity userEntity, CallPageableRequestBean callPageableRequestBean,Boolean onlyConfidiCall) {
return (root, query, criteriaBuilder) -> {
List<Predicate> predicates = getPredicates(request,callPageableRequestBean, criteriaBuilder, root, userEntity);
List<Predicate> predicates = getPredicates(request,callPageableRequestBean, criteriaBuilder, root, userEntity,onlyConfidiCall);
SortBy sortBy = new SortBy(GepafinConstant.CREATED_DATE, true);
if (callPageableRequestBean.getGlobalFilters() != null
@@ -1083,7 +1083,7 @@ public class CallDao {
private List<Predicate> getPredicates(HttpServletRequest request,CallPageableRequestBean callPageableRequestBean,
CriteriaBuilder criteriaBuilder, Root<CallEntity> root, UserEntity userEntity) {
CriteriaBuilder criteriaBuilder, Root<CallEntity> root, UserEntity userEntity,Boolean onlyConfidiCall) {
Integer year = null;
String search = null;
Map<String, FilterCriteria> filters = new HashMap<>();
@@ -1137,7 +1137,7 @@ public class CallDao {
predicates.add(root.get(GepafinConstant.STATUS).in(statusValues));
}
applyFilters(root, criteriaBuilder, predicates, filters);
Boolean isConfidi = callPageableRequestBean.getConfidi();
Boolean isConfidi =onlyConfidiCall;
if (validator.checkIsConfidi()) {

View File

@@ -14,6 +14,4 @@ public class CallPageableRequestBean {
private List<CallStatusEnum> status;
private Map<String, FilterCriteria> filters;
private Boolean confidi;
}

View File

@@ -33,7 +33,7 @@ public interface CallService {
byte[] downloadCallDocumentsAsZip(HttpServletRequest request, Long callId);
PageableResponseBean<List<CallDetailsResponseBean>> getAllCallsByPagination(HttpServletRequest request, Long companyId , Boolean onlyPreferredCall,CallPageableRequestBean callPageableRequestBean);
PageableResponseBean<List<CallDetailsResponseBean>> getAllCallsByPagination(HttpServletRequest request, Long companyId , Boolean onlyPreferredCall,Boolean onlyConfidiCall,CallPageableRequestBean callPageableRequestBean);
CallResponse createCallStep2EvaluationV2(HttpServletRequest request, Long callId, CreateCallRequestStep2EvaluationV2 createCallRequest);

View File

@@ -105,9 +105,9 @@ public class CallServiceImpl implements CallService {
@Override
@Transactional(rollbackFor = Exception.class)
public PageableResponseBean<List<CallDetailsResponseBean>> getAllCallsByPagination(HttpServletRequest request,Long companyId , Boolean onlyPreferredCall, CallPageableRequestBean callPageableRequestBean) {
public PageableResponseBean<List<CallDetailsResponseBean>> getAllCallsByPagination(HttpServletRequest request,Long companyId , Boolean onlyPreferredCall,Boolean onlyConfidiCall, CallPageableRequestBean callPageableRequestBean) {
UserEntity user = validator.validateUser(request);
return callDao.getAllCallsByPagination(request,user,companyId,onlyPreferredCall,callPageableRequestBean);
return callDao.getAllCallsByPagination(request,user,companyId,onlyPreferredCall,onlyConfidiCall,callPageableRequestBean);
}
@Override
@Transactional(rollbackFor = Exception.class)

View File

@@ -159,7 +159,7 @@ public interface CallApi {
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = @ExampleObject(value =
ErrorConstants.BADREQUEST_ERROR_EXAMPLE))) })
@PostMapping(value = "/pagination", consumes = "application/json", produces = "application/json")
ResponseEntity<Response<PageableResponseBean<List<CallDetailsResponseBean>>>> getAllCallsByPagination(HttpServletRequest request,@RequestParam(value = "companyId", required = false) Long companyId , @RequestParam(value = "onlyPreferredCall", required = false, defaultValue = "false") Boolean onlyPreferredCall, @RequestBody CallPageableRequestBean callPageableRequestBean);
ResponseEntity<Response<PageableResponseBean<List<CallDetailsResponseBean>>>> getAllCallsByPagination(HttpServletRequest request,@RequestParam(value = "companyId", required = false) Long companyId , @RequestParam(value = "onlyPreferredCall", required = false, defaultValue = "false") Boolean onlyPreferredCall, @RequestParam(value = "onlyConfidiCall", required = false) Boolean onlyConfidiCall, @RequestBody CallPageableRequestBean callPageableRequestBean);
@Operation(summary = "Api to update call step 2 (Evaluation V2)",

View File

@@ -152,12 +152,12 @@ public class CallApiController implements CallApi {
}
@Override
public ResponseEntity<Response<PageableResponseBean<List<CallDetailsResponseBean>>>> getAllCallsByPagination(HttpServletRequest request, Long companyId , Boolean onlyPreferredCall, CallPageableRequestBean callPageableRequestBean) {
public ResponseEntity<Response<PageableResponseBean<List<CallDetailsResponseBean>>>> getAllCallsByPagination(HttpServletRequest request, Long companyId , Boolean onlyPreferredCall,Boolean onlyConfidiCall, CallPageableRequestBean callPageableRequestBean) {
/** This code is responsible for creating user action logs for the "get all call by pagination" operation. **/
loggingUtil.logUserAction(UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.VIEW).actionContext(UserActionContextEnum.GET_ALL_CALL_BY_PAGINATION).build());
PageableResponseBean<List<CallDetailsResponseBean>> callsByPagination=callService.getAllCallsByPagination(request,companyId,onlyPreferredCall,callPageableRequestBean);
PageableResponseBean<List<CallDetailsResponseBean>> callsByPagination=callService.getAllCallsByPagination(request,companyId,onlyPreferredCall,onlyConfidiCall,callPageableRequestBean);
return ResponseEntity.status(HttpStatus.OK)
.body(new Response<>(callsByPagination, Status.SUCCESS, Translator.toLocale(GepafinConstant.CALL_FETCH_SUCCESS_MSG)));
}