Updated companyId as optional in next-prev API
This commit is contained in:
@@ -76,9 +76,19 @@ public class ApplicationServiceImpl implements ApplicationService {
|
||||
@Override
|
||||
public NextOrPreviousFormResponse getNextOrPreviousForm(HttpServletRequest request, Long applicationId, Long companyId, Long formId,
|
||||
FormActionEnum action) {
|
||||
if (companyId !=null) {
|
||||
validator.validateUserWithCompany(request, companyId);
|
||||
validateApplication(applicationId);
|
||||
ApplicationEntity applicationEntity = validateApplicationWithCompany(applicationId, companyId);
|
||||
}
|
||||
ApplicationEntity applicationEntity =null;
|
||||
if(validator.checkIsBeneficiary()){
|
||||
if(companyId==null){
|
||||
throw new CustomValidationException(Status.VALIDATION_ERROR,Translator.toLocale(GepafinConstant.COMPANY_ID_MANDATORY));
|
||||
}
|
||||
applicationEntity = validateApplicationWithCompany(applicationId, companyId);
|
||||
|
||||
}else {
|
||||
applicationEntity=validateApplication(applicationId);
|
||||
}
|
||||
return flowFormDao.getNextOrPreviousForm(applicationEntity, companyId, formId, action);
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ public interface ApplicationApi {
|
||||
@GetMapping(value = "/{applicationId}/form/next-previous", produces = "application/json")
|
||||
ResponseEntity<Response<NextOrPreviousFormResponse>> getNextOrPreviousForm(HttpServletRequest request,
|
||||
@Parameter(description = "The applicaltion id", required = true) @PathVariable("applicationId") Long applicationId,
|
||||
@Parameter(description = "The company id", required = true) @RequestParam("companyId") Long companyId,
|
||||
@Parameter(description = "The company id", required = false) @RequestParam(value = "companyId",required = false) Long companyId,
|
||||
@Parameter(description = "The form id", required = false) @RequestParam(value = "formId", required = false) Long formId,
|
||||
@RequestParam(value = "action", required = false) FormActionEnum action);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user