Resolved Conflicts
This commit is contained in:
@@ -278,6 +278,7 @@ public class GepafinConstant {
|
||||
public static final String APPLICATION_AMENDMENT_UPDATE_SUCCESSFULLY_MSG = "application.amendment.update.successfully";
|
||||
public static final String APPLICATION_AMENDMENT_CLOSED_SUCCESFULLY = "application.amendment.closed.successfully";
|
||||
|
||||
public static final String RESPONSE_DAYS_EXTENDED_SUCCESS_MSG = "response.days.extended.success";
|
||||
public static final String COMMUNICATION_ADDED_TO_AMENDMENT_REQUEST_SUCCESS = "added.comment.to.amendment.request.success";
|
||||
public static final String COMMENT_NOT_FOUND = "comment.not.found";
|
||||
public static final String COMMENT_UPDATED_SUCCESS_MSG = "comment.updated.successfully";
|
||||
|
||||
@@ -67,10 +67,10 @@ public class ApplicationAmendmentRequestDao {
|
||||
|
||||
@Autowired
|
||||
private ApplicationEvaluationService applicationEvaluationService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private ProtocolDao protocolDao;
|
||||
|
||||
|
||||
|
||||
@Autowired
|
||||
private AssignedApplicationsService assignedApplicationsService;
|
||||
@@ -208,11 +208,11 @@ public class ApplicationAmendmentRequestDao {
|
||||
.collect(Collectors.joining(","));
|
||||
applicationAmendmentRequestEntity.setFormFields(fieldIdsString);
|
||||
}
|
||||
UserEntity userEntity = userService.validateUser(applicationEvaluationId);
|
||||
UserEntity userEntity = userService.validateUser(applicationEvaluationEntity.getUserId());
|
||||
Long protocolNumber = protocolDao.getProtocolNumber(userEntity.getHub());
|
||||
ProtocolEntity protocolEntity = protocolDao.createProtocolEntity(
|
||||
applicationEvaluationEntity.getAssignedApplicationsEntity().getApplication(), protocolNumber,
|
||||
userEntity.getHub().getId());
|
||||
ProtocolEntity protocolEntity = protocolDao.createProtocolEntity(
|
||||
applicationEvaluationEntity.getAssignedApplicationsEntity().getApplication(), protocolNumber,
|
||||
userEntity.getHub().getId());
|
||||
applicationAmendmentRequestEntity.setProtocol(protocolEntity);
|
||||
applicationAmendmentRequestEntity.setIsEmail(false);
|
||||
applicationAmendmentRequestEntity.setIsNotification(false);
|
||||
@@ -303,11 +303,11 @@ public class ApplicationAmendmentRequestDao {
|
||||
return applicationAmendmentRequestResponse;
|
||||
}
|
||||
|
||||
public ApplicationAmendmentRequestEntity validateApplicationAmendmentRequest(Long id) {
|
||||
return applicationAmendmentRequestRepository.findByIdAndIsDeletedFalse(id)
|
||||
.orElseThrow(() -> new ResourceNotFoundException(Status.NOT_FOUND,
|
||||
Translator.toLocale(GepafinConstant.APPLICATION_AMENDMENT_NOT_FOUND_MSG)));
|
||||
}
|
||||
public ApplicationAmendmentRequestEntity validateApplicationAmendmentRequest(Long id) {
|
||||
return applicationAmendmentRequestRepository.findByIdAndIsDeletedFalse(id)
|
||||
.orElseThrow(() -> new ResourceNotFoundException(Status.NOT_FOUND,
|
||||
Translator.toLocale(GepafinConstant.APPLICATION_AMENDMENT_NOT_FOUND_MSG)));
|
||||
}
|
||||
|
||||
public void deleteById(Long id) {
|
||||
log.info("Deleting assigned application with ID: {}", id);
|
||||
@@ -444,4 +444,16 @@ public class ApplicationAmendmentRequestDao {
|
||||
return response;
|
||||
}
|
||||
|
||||
public ApplicationAmendmentRequestResponse extendResponseDays(Long id, Long newResponseDays) {
|
||||
ApplicationAmendmentRequestEntity request = applicationAmendmentRequestRepository.findByIdAndIsDeletedFalse(id)
|
||||
.orElseThrow(() -> new ResourceNotFoundException(Status.NOT_FOUND,
|
||||
Translator.toLocale(GepafinConstant.APPLICATION_AMENDMENT_NOT_FOUND_MSG)));
|
||||
|
||||
if (newResponseDays != null && newResponseDays > 0) {
|
||||
Long currentResponseDays = request.getResponseDays() != null ? request.getResponseDays() : 0L;
|
||||
request.setResponseDays(currentResponseDays + newResponseDays);
|
||||
applicationAmendmentRequestRepository.save(request);
|
||||
}
|
||||
return convertEntityToResponse(request);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,8 +115,8 @@ public class ApplicationDao {
|
||||
@Autowired
|
||||
private ApplicationSignedDocumentRepository applicationSignedDocumentRepository;
|
||||
|
||||
@Value("${aws.s3.url.folder.signed.document}")
|
||||
private String signedDocumentS3Folder;
|
||||
// @Value("${aws.s3.url.folder.signed.document}")
|
||||
// private String signedDocumentS3Folder;
|
||||
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
@@ -611,8 +611,11 @@ public class ApplicationDao {
|
||||
sendMailToUserAndCompany(userEntity, applicationEntity);
|
||||
sendMailTodefaultSystemAndGepafin(userEntity, applicationEntity);
|
||||
applicationEntity.setStatus(status.getValue());
|
||||
applicationEntity = saveApplicationEntity(applicationEntity);
|
||||
}
|
||||
if (status.equals(ApplicationStatusTypeEnum.DRAFT) && Boolean.TRUE.equals(applicationEntity.getStatus().equals(ApplicationStatusTypeEnum.AWAITING.getValue()))) {
|
||||
applicationEntity.setStatus(status.getValue());
|
||||
}
|
||||
applicationEntity = saveApplicationEntity(applicationEntity);
|
||||
|
||||
|
||||
return getApplicationResponse(applicationEntity);
|
||||
|
||||
@@ -342,11 +342,18 @@ public class ApplicationEvaluationDao {
|
||||
response.setCallEndDate(callEndDate);
|
||||
}
|
||||
|
||||
public ApplicationEvaluationResponse createOrUpdateApplicationEvaluation(UserEntity user, ApplicationEvaluationRequest req, Long assignedApplciationId) {
|
||||
|
||||
Optional<ApplicationEvaluationEntity> existingEntityOptional = applicationEvaluationRepository.findByAssignedApplicationsEntity_IdAndIsDeletedFalse(assignedApplciationId);
|
||||
public ApplicationEvaluationResponse createOrUpdateApplicationEvaluation(
|
||||
UserEntity user,
|
||||
ApplicationEvaluationRequest req,
|
||||
Long assignedApplicationId) {
|
||||
|
||||
Optional<ApplicationEvaluationEntity> existingEntityOptional =
|
||||
applicationEvaluationRepository.findByAssignedApplicationsEntity_IdAndIsDeletedFalse(assignedApplicationId);
|
||||
ApplicationEvaluationEntity entity;
|
||||
Optional<AssignedApplicationsEntity> assignedApplications=assignedApplicationsRepository.findByIdAndIsDeletedFalse(assignedApplciationId);
|
||||
Optional<AssignedApplicationsEntity> assignedApplications =
|
||||
assignedApplicationsRepository.findByIdAndIsDeletedFalse(assignedApplicationId);
|
||||
|
||||
if (existingEntityOptional.isPresent()) {
|
||||
entity = existingEntityOptional.get();
|
||||
entity.setCriteria(Utils.convertObjectToJson(filterNonNullCriteria(processCriteria(entity, req))));
|
||||
@@ -355,13 +362,21 @@ public class ApplicationEvaluationDao {
|
||||
entity.setIsDeleted(false);
|
||||
setIfUpdated(entity::getNote, entity::setNote, req.getNote());
|
||||
} else {
|
||||
entity = convertToEntity(user, req, assignedApplciationId);
|
||||
entity = convertToEntity(user, req, assignedApplicationId);
|
||||
}
|
||||
ApplicationStatusForEvaluation status = req.getApplicationStatus();
|
||||
|
||||
ApplicationEvaluationEntity savedEntity = applicationEvaluationRepository.save(entity);
|
||||
return convertToResponse(savedEntity);
|
||||
if (status != null) {
|
||||
ApplicationEntity application = applicationService.validateApplication(assignedApplications.get().getApplication().getId());
|
||||
AssignedApplicationsEntity assignedApplicationsEntity = assignedApplications.get();
|
||||
return updateApplicationEvaluationStatus(application, assignedApplicationsEntity, status);
|
||||
} else {
|
||||
return convertToResponse(savedEntity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private List<ChecklistRequest> filterNonNullChecklist(List<ChecklistRequest> checklistRequests) {
|
||||
|
||||
return checklistRequests.stream().filter(request -> request.getValid() != null).collect(Collectors.toList());
|
||||
@@ -862,17 +877,18 @@ public class ApplicationEvaluationDao {
|
||||
}
|
||||
|
||||
public ApplicationEvaluationResponse updateApplicationEvaluationStatus(ApplicationEntity application, AssignedApplicationsEntity assignedApplicationsEntity,
|
||||
AssignedEvaluationStatus newStatus) {
|
||||
ApplicationStatusForEvaluation newStatus) {
|
||||
|
||||
Optional<ApplicationEvaluationEntity> existingEntityOptional = applicationEvaluationRepository.findByAssignedApplicationsEntity_IdAndIsDeletedFalse(
|
||||
assignedApplicationsEntity.getId());
|
||||
ApplicationEvaluationEntity entity;
|
||||
|
||||
String statusType = application.getStatus();
|
||||
|
||||
if (existingEntityOptional.isPresent()) {
|
||||
ApplicationEvaluationEntity existingEntity = existingEntityOptional.get();
|
||||
application.setStatus(newStatus.getValue());
|
||||
application = applicationRepository.save(application);
|
||||
String statusType = application.getStatus();
|
||||
if (application.getStatus().equals(ApplicationStatusTypeEnum.APPROVED.getValue()) || application.getStatus().equals(ApplicationStatusTypeEnum.REJECTED.getValue())) {
|
||||
existingEntity.setStatus(ApplicationEvaluationStatusTypeEnum.CLOSE.getValue());
|
||||
assignedApplicationsEntity.setStatus(AssignedApplicationEnum.CLOSE.getValue());
|
||||
|
||||
@@ -21,7 +21,6 @@ import net.gepafin.tendermanagement.util.DateTimeUtil;
|
||||
import net.gepafin.tendermanagement.util.Utils;
|
||||
import org.h2.util.IOUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@@ -94,14 +93,17 @@ public class CallDao {
|
||||
@Autowired
|
||||
private FormDao formDao;
|
||||
|
||||
@Value("${aws.s3.url.folder}")
|
||||
private String s3Folder;
|
||||
// @Value("${aws.s3.url.folder}")
|
||||
// private String s3Folder;
|
||||
|
||||
@Autowired
|
||||
private AmazonS3Service amazonS3Service;
|
||||
|
||||
@Autowired
|
||||
private CriteriaFormFieldRepository criteriaFormFieldRepository;
|
||||
|
||||
@Autowired
|
||||
private S3PathConfig s3PathConfig;
|
||||
|
||||
public CallResponse createCallStep1(CreateCallRequestStep1 createCallRequest, UserEntity userEntity) {
|
||||
createCallRequest.setRegionId(userEntity.getRoleEntity().getRegion().getId());
|
||||
@@ -127,6 +129,7 @@ public class CallDao {
|
||||
ZipOutputStream zos = new ZipOutputStream(zipOutputStream)) {
|
||||
|
||||
for (DocumentEntity document : documents) {
|
||||
String s3Folder = s3PathConfig.generateDocumentPath(DocumentSourceTypeEnum.CALL, callId, 0L);
|
||||
try (InputStream fileInputStream = amazonS3Service.getFile(s3Folder, document.getFilePath())) {
|
||||
String fileName = Utils.extractFileName(document.getFilePath());
|
||||
ZipEntry zipEntry = new ZipEntry(fileName);
|
||||
|
||||
@@ -8,10 +8,10 @@ import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
|
||||
import net.gepafin.tendermanagement.enums.DocOtherSourceTypeEnum;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@@ -58,8 +58,8 @@ public class DelegationDao {
|
||||
@Autowired
|
||||
private S3PathConfig s3ConfigBean;
|
||||
|
||||
@Value("${aws.s3.url.folder.delegation}")
|
||||
private String s3Folder;
|
||||
// @Value("${aws.s3.url.folder.delegation}")
|
||||
// private String s3Folder;
|
||||
|
||||
@Autowired
|
||||
private UserCompanyDelegationRepository userCompanyDelegationRepository;
|
||||
@@ -67,9 +67,9 @@ public class DelegationDao {
|
||||
@Autowired
|
||||
private Validator validator;
|
||||
|
||||
|
||||
public ByteArrayOutputStream generateDocument(Map<String, String> placeholders, String templateName) {
|
||||
try {
|
||||
String s3Folder = s3ConfigBean.generateDocumentPathForOther(DocOtherSourceTypeEnum.TEMPLATE, 0L, 0L);
|
||||
InputStream templateStream = amazonS3Service.getFile(s3Folder ,templateName);
|
||||
XWPFDocument doc = loadTemplate(templateStream);
|
||||
replacePlaceholders(doc, placeholders);
|
||||
|
||||
@@ -7,7 +7,6 @@ import net.gepafin.tendermanagement.enums.DocumentSourceTypeEnum;
|
||||
import net.gepafin.tendermanagement.repositories.ApplicationRepository;
|
||||
import net.gepafin.tendermanagement.web.rest.api.errors.CustomValidationException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@@ -49,8 +48,8 @@ public class DocumentDao {
|
||||
@Autowired
|
||||
private ApplicationRepository applicationFormRepository;
|
||||
|
||||
@Value("${aws.s3.url.folder}")
|
||||
private String s3Folder;
|
||||
// @Value("${aws.s3.url.folder}")
|
||||
// private String s3Folder;
|
||||
|
||||
public List<DocumentResponseBean> uploadFiles(List<MultipartFile> files, Long sourceId, DocumentSourceTypeEnum sourceType, DocumentTypeEnum fileType) {
|
||||
List<DocumentEntity> documentEntities = new ArrayList<>();
|
||||
@@ -141,7 +140,7 @@ public class DocumentDao {
|
||||
try {
|
||||
Long callId;
|
||||
Long applicationId;
|
||||
if(type.equals("APPLICATION")){
|
||||
if(type.equals(DocumentSourceTypeEnum.APPLICATION)){
|
||||
callId = applicationFormRepository.findCallIdById(id);
|
||||
applicationId = id;
|
||||
}else{
|
||||
|
||||
@@ -2,13 +2,13 @@ package net.gepafin.tendermanagement.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
public enum AssignedEvaluationStatus {
|
||||
public enum ApplicationStatusForEvaluation {
|
||||
APPROVED("APPROVED"),
|
||||
REJECTED("REJECTED");
|
||||
|
||||
private String value;
|
||||
|
||||
AssignedEvaluationStatus(String value) {
|
||||
ApplicationStatusForEvaluation(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.gepafin.tendermanagement.model.request;
|
||||
|
||||
import lombok.Data;
|
||||
import net.gepafin.tendermanagement.enums.ApplicationStatusForEvaluation;
|
||||
|
||||
import java.util.List;
|
||||
@Data
|
||||
@@ -10,4 +11,5 @@ public class ApplicationEvaluationRequest {
|
||||
private List<ChecklistRequest> checklist;
|
||||
private List<FieldRequest> files;
|
||||
private String note;
|
||||
private ApplicationStatusForEvaluation applicationStatus;
|
||||
}
|
||||
|
||||
@@ -19,4 +19,5 @@ public interface ApplicationAmendmentRequestService {
|
||||
ApplicationAmendmentRequestEntity validateApplicationAmendmentRequest(Long applicationAmendmentId);
|
||||
List<ApplicationAmendmentRequestResponse> getAllAmendmentRequestByBeneficiaryId(HttpServletRequest request,Long beneficiaryId);
|
||||
ApplicationAmendmentRequestResponse closeAmendmentRequest(HttpServletRequest request, Long id, CloseAmendmentRequest closeAmendmentRequest);
|
||||
ApplicationAmendmentRequestResponse extendResponseDays(HttpServletRequest request, Long id, Long addedDays);
|
||||
}
|
||||
|
||||
@@ -2,21 +2,18 @@ package net.gepafin.tendermanagement.service;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import net.gepafin.tendermanagement.entities.ApplicationEvaluationEntity;
|
||||
import net.gepafin.tendermanagement.enums.ApplicationEvaluationStatusTypeEnum;
|
||||
import net.gepafin.tendermanagement.enums.AssignedEvaluationStatus;
|
||||
import net.gepafin.tendermanagement.enums.ApplicationStatusForEvaluation;
|
||||
import net.gepafin.tendermanagement.model.request.ApplicationEvaluationRequest;
|
||||
import net.gepafin.tendermanagement.model.response.ApplicationEvaluationResponse;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ApplicationEvaluationService {
|
||||
ApplicationEvaluationResponse createOrUpdateApplicationEvaluation(HttpServletRequest request, ApplicationEvaluationRequest applicationEvaluationRequest,Long assignedApplicationsId);
|
||||
ApplicationEvaluationResponse createOrUpdateApplicationEvaluation(
|
||||
HttpServletRequest request,
|
||||
ApplicationEvaluationRequest applicationEvaluationRequest,
|
||||
Long assignedApplicationsId);
|
||||
|
||||
void deleteApplicationEvaluation(HttpServletRequest request,Long id);
|
||||
|
||||
ApplicationEvaluationResponse getApplicationEvaluationByApplicationId(HttpServletRequest request,Long applicationId,Long assignedApplicationId);
|
||||
ApplicationEvaluationResponse updateApplicationEvaluationStatus(HttpServletRequest request, Long assignedApplicationId, AssignedEvaluationStatus status);
|
||||
|
||||
|
||||
ApplicationEvaluationEntity validateApplicationEvaluation(Long applicationEvaluationId);
|
||||
}
|
||||
|
||||
@@ -71,6 +71,12 @@ public class ApplicationAmendmentRequestServiceImpl implements ApplicationAmendm
|
||||
public ApplicationAmendmentRequestResponse closeAmendmentRequest(HttpServletRequest request, Long id, CloseAmendmentRequest closeAmendmentRequest) {
|
||||
return applicationAmendmentRequestDao.closeAmendmentRequest(id,closeAmendmentRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApplicationAmendmentRequestResponse extendResponseDays(HttpServletRequest request, Long id, Long addedDays) {
|
||||
return applicationAmendmentRequestDao.extendResponseDays(id, addedDays);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,8 +8,7 @@ import net.gepafin.tendermanagement.dao.ApplicationEvaluationDao;
|
||||
import net.gepafin.tendermanagement.entities.ApplicationEvaluationEntity;
|
||||
import net.gepafin.tendermanagement.entities.AssignedApplicationsEntity;
|
||||
import net.gepafin.tendermanagement.entities.UserEntity;
|
||||
import net.gepafin.tendermanagement.enums.ApplicationEvaluationStatusTypeEnum;
|
||||
import net.gepafin.tendermanagement.enums.AssignedEvaluationStatus;
|
||||
import net.gepafin.tendermanagement.enums.ApplicationStatusForEvaluation;
|
||||
import net.gepafin.tendermanagement.model.request.ApplicationEvaluationRequest;
|
||||
import net.gepafin.tendermanagement.model.response.ApplicationEvaluationResponse;
|
||||
|
||||
@@ -23,8 +22,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@Service
|
||||
@@ -39,11 +36,20 @@ public class ApplicationEvaluationServiceImpl implements ApplicationEvaluationSe
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ApplicationEvaluationResponse createOrUpdateApplicationEvaluation(HttpServletRequest request, ApplicationEvaluationRequest req,Long assignedApplicationsId) {
|
||||
AssignedApplicationsEntity assignedApplication = assignedApplicationsRepository.findByIdAndIsDeletedFalse(assignedApplicationsId).orElseThrow(()->
|
||||
new ResourceNotFoundException(Status.NOT_FOUND,Translator.toLocale(GepafinConstant.ASSIGNED_APPLICATION_NOT_FOUND_MSG)));
|
||||
UserEntity user=validator.validatePreInstructor(request,assignedApplication.getUserId());
|
||||
return applicationEvaluationDao.createOrUpdateApplicationEvaluation(user,req,assignedApplication.getId());
|
||||
public ApplicationEvaluationResponse createOrUpdateApplicationEvaluation(
|
||||
HttpServletRequest request,
|
||||
ApplicationEvaluationRequest req,
|
||||
Long assignedApplicationsId) {
|
||||
|
||||
AssignedApplicationsEntity assignedApplication = assignedApplicationsRepository
|
||||
.findByIdAndIsDeletedFalse(assignedApplicationsId)
|
||||
.orElseThrow(() -> new ResourceNotFoundException(
|
||||
Status.NOT_FOUND,
|
||||
Translator.toLocale(GepafinConstant.ASSIGNED_APPLICATION_NOT_FOUND_MSG)));
|
||||
|
||||
UserEntity user = validator.validatePreInstructor(request, assignedApplication.getUserId());
|
||||
|
||||
return applicationEvaluationDao.createOrUpdateApplicationEvaluation(user, req, assignedApplication.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -78,8 +84,6 @@ public class ApplicationEvaluationServiceImpl implements ApplicationEvaluationSe
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteApplicationEvaluation(HttpServletRequest request,Long id) {
|
||||
@@ -87,16 +91,6 @@ public class ApplicationEvaluationServiceImpl implements ApplicationEvaluationSe
|
||||
applicationEvaluationDao.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ApplicationEvaluationResponse updateApplicationEvaluationStatus(HttpServletRequest request, Long assignedApplicationId, AssignedEvaluationStatus status) {
|
||||
AssignedApplicationsEntity assignedApplication = assignedApplicationsRepository.findByIdAndIsDeletedFalse(assignedApplicationId).orElseThrow(()->
|
||||
new ResourceNotFoundException(Status.NOT_FOUND,Translator.toLocale(GepafinConstant.ASSIGNED_APPLICATION_NOT_FOUND_MSG)));
|
||||
validator.validatePreInstructor(request,assignedApplication.getUserId());
|
||||
return applicationEvaluationDao.updateApplicationEvaluationStatus(assignedApplication.getApplication(),assignedApplication,status);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApplicationEvaluationEntity validateApplicationEvaluation(Long applicationEvaluationId) {
|
||||
return applicationEvaluationDao.validateApplicationEvaluation(applicationEvaluationId);
|
||||
|
||||
@@ -113,6 +113,21 @@ public interface ApplicationAmendmentRequestApi {
|
||||
@GetMapping(value = "/beneficiary/user/{id}", produces = "application/json")
|
||||
ResponseEntity<Response<List<ApplicationAmendmentRequestResponse>>> getAllAmendmentRequestByBeneficiaryId(HttpServletRequest request,
|
||||
@Parameter(description = "Id", required = false) @PathVariable(value = "id",required = false) Long beneficiaryId);
|
||||
@Operation(summary = "Api to extend response days for an amendment request",
|
||||
responses = {
|
||||
@ApiResponse(responseCode = "200", description = "OK"),
|
||||
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.NOTFOUND_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.UNAUTHORIZED_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) }))
|
||||
})
|
||||
@PutMapping(value = "/{id}/extendExpiration", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
ResponseEntity<Response<ApplicationAmendmentRequestResponse>> extendResponseDays(
|
||||
HttpServletRequest request,
|
||||
@Parameter( required = true) @PathVariable("id") Long id,
|
||||
@Parameter( required = true) @RequestParam("extendedDays") Long extendedDays);
|
||||
|
||||
@Operation(summary = "Api to close the application amendment request",
|
||||
responses = {
|
||||
|
||||
@@ -7,22 +7,15 @@ import io.swagger.v3.oas.annotations.media.ExampleObject;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.validation.Valid;
|
||||
import net.gepafin.tendermanagement.enums.ApplicationEvaluationStatusTypeEnum;
|
||||
import net.gepafin.tendermanagement.enums.ApplicationStatusTypeEnum;
|
||||
import net.gepafin.tendermanagement.enums.AssignedEvaluationStatus;
|
||||
import net.gepafin.tendermanagement.enums.ApplicationStatusForEvaluation;
|
||||
import net.gepafin.tendermanagement.model.request.ApplicationEvaluationRequest;
|
||||
import net.gepafin.tendermanagement.model.request.UpdateApplicationEvaluationRequest;
|
||||
import net.gepafin.tendermanagement.model.response.ApplicationEvaluationResponse;
|
||||
import net.gepafin.tendermanagement.model.response.ApplicationResponse;
|
||||
import net.gepafin.tendermanagement.model.util.Response;
|
||||
import net.gepafin.tendermanagement.web.rest.api.errors.ErrorConstants;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ApplicationEvaluationApi {
|
||||
|
||||
@Operation(summary = "API to create or update ApplicationEvaluation",
|
||||
@@ -36,8 +29,8 @@ public interface ApplicationEvaluationApi {
|
||||
@PutMapping(value = "/{assignedApplicationsId}", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
ResponseEntity<Response<ApplicationEvaluationResponse>> createOrUpdateApplicationEvaluation(
|
||||
HttpServletRequest request,
|
||||
@Parameter(required = true) @PathVariable("assignedApplicationsId") Long assignedApplicationsId,
|
||||
@Parameter( required = true) @Valid @RequestBody ApplicationEvaluationRequest evaluationRequest);
|
||||
@Parameter(description = "Assigned Application ID", required = true) @PathVariable("assignedApplicationsId") Long assignedApplicationsId,
|
||||
@Parameter(description = "Application Evaluation Request Body", required = true) @Valid @RequestBody ApplicationEvaluationRequest evaluationRequest);
|
||||
|
||||
@Operation(summary = "API to get ApplicationEvaluation data for evaluation process",
|
||||
responses = {
|
||||
@@ -60,18 +53,5 @@ public interface ApplicationEvaluationApi {
|
||||
ResponseEntity<Response<Void>> deleteApplicationEvaluation(HttpServletRequest request,
|
||||
@Parameter( required = true) @PathVariable("id") Long id);
|
||||
|
||||
@Operation(summary = "Api to update application evaluation status",
|
||||
responses = {
|
||||
@ApiResponse(responseCode = "200", description = "OK"),
|
||||
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.NOTFOUND_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.UNAUTHORIZED_ERROR_EXAMPLE) })),
|
||||
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
|
||||
@PutMapping(value = "/{assignedApplicationId}/status", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
ResponseEntity<Response<ApplicationEvaluationResponse>> updateApplicationEvaluationStatus(HttpServletRequest request,
|
||||
@Parameter( required = true) @PathVariable("assignedApplicationId") Long assignedApplicationId,
|
||||
@Parameter(description = "status", required = true)@RequestParam(value = "status", required = true) AssignedEvaluationStatus status);
|
||||
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public interface CommunicationApi {
|
||||
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
|
||||
@PostMapping(value = "/{amendmentId}", produces = { "application/json" })
|
||||
ResponseEntity<Response<CommunicationResponseBean>> addCommentToAmendmentRequest(HttpServletRequest request,
|
||||
@RequestBody @Parameter CommunicationRequestBean communicationResponseBean, @Param(value = "amendmentId") Long amendmentId);
|
||||
@RequestBody @Parameter CommunicationRequestBean communicationResponseBean, @PathVariable(value = "amendmentId") Long amendmentId);
|
||||
|
||||
@Operation(summary = "API to Get Amendment Request Comment", responses = { @ApiResponse(responseCode = "200", description = "OK"),
|
||||
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = @ExampleObject(value =
|
||||
@@ -43,7 +43,7 @@ public interface CommunicationApi {
|
||||
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = @ExampleObject(value =
|
||||
ErrorConstants.BADREQUEST_ERROR_EXAMPLE))) })
|
||||
@GetMapping(value = "/{amendmentId}", produces = "application/json")
|
||||
public ResponseEntity<Response<ApplicationAmendmentResponse>> getAmendmentComments(@PathVariable Long amendmentId);
|
||||
public ResponseEntity<Response<ApplicationAmendmentResponse>> getAmendmentComments(@PathVariable(value = "amendmentId") Long amendmentId);
|
||||
|
||||
@Operation(summary = "Api to update communication comments", responses = { @ApiResponse(responseCode = "200", description = "OK"),
|
||||
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@@ -54,7 +54,7 @@ public interface CommunicationApi {
|
||||
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
|
||||
@PutMapping(value = "/{amendmentId}/{commentId}", produces = { "application/json" })
|
||||
ResponseEntity<Response<CommunicationResponseBean>> updateCommunicationAmendment(HttpServletRequest request,
|
||||
@RequestBody @Parameter CommunicationRequestBean communicationResponseBean, @PathVariable Long amendmentId, @PathVariable Long commentId);
|
||||
@RequestBody @Parameter CommunicationRequestBean communicationResponseBean, @PathVariable(value = "amendmentId") Long amendmentId, @PathVariable(value = "commentId") Long commentId);
|
||||
|
||||
@Operation(summary = "Api to delete communication comments", responses = { @ApiResponse(responseCode = "200", description = "OK"),
|
||||
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@@ -64,6 +64,6 @@ public interface CommunicationApi {
|
||||
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
|
||||
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE) })) })
|
||||
@DeleteMapping(value = "/{amendmentId}/{commentId}", produces = { "application/json" })
|
||||
ResponseEntity<Response<String>> deleteApplicationAmendmentComment(HttpServletRequest request, @Param(value = "amendmentId") Long amendmentId,
|
||||
ResponseEntity<Response<String>> deleteApplicationAmendmentComment(HttpServletRequest request, @PathVariable(value = "amendmentId") Long amendmentId,
|
||||
@Param(value = "commentId") Long commentId);
|
||||
}
|
||||
|
||||
@@ -88,4 +88,18 @@ public class ApplicationAmendmentRequestController implements ApplicationAmendme
|
||||
return ResponseEntity.status(HttpStatus.CREATED)
|
||||
.body(new Response<>(amendmentRequestResponse, Status.SUCCESS, Translator.toLocale(GepafinConstant.APPLICATION_AMENDMENT_CLOSED_SUCCESFULLY)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<Response<ApplicationAmendmentRequestResponse>> extendResponseDays(
|
||||
HttpServletRequest request,
|
||||
Long id,
|
||||
Long addedDays) {
|
||||
|
||||
log.info("Extending response days for Amendment Request ID: {}", id);
|
||||
|
||||
ApplicationAmendmentRequestResponse response = applicationAmendmentRequestService.extendResponseDays(request, id, addedDays);
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK)
|
||||
.body(new Response<>(response, Status.SUCCESS, Translator.toLocale(GepafinConstant.RESPONSE_DAYS_EXTENDED_SUCCESS_MSG)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,13 +3,9 @@ package net.gepafin.tendermanagement.web.rest.api.impl;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import net.gepafin.tendermanagement.config.Translator;
|
||||
import net.gepafin.tendermanagement.constants.GepafinConstant;
|
||||
import net.gepafin.tendermanagement.enums.ApplicationEvaluationStatusTypeEnum;
|
||||
import net.gepafin.tendermanagement.enums.ApplicationStatusTypeEnum;
|
||||
import net.gepafin.tendermanagement.enums.AssignedEvaluationStatus;
|
||||
import net.gepafin.tendermanagement.enums.ApplicationStatusForEvaluation;
|
||||
import net.gepafin.tendermanagement.model.request.ApplicationEvaluationRequest;
|
||||
import net.gepafin.tendermanagement.model.request.UpdateApplicationEvaluationRequest;
|
||||
import net.gepafin.tendermanagement.model.response.ApplicationEvaluationResponse;
|
||||
import net.gepafin.tendermanagement.model.response.ApplicationResponse;
|
||||
import net.gepafin.tendermanagement.model.util.Response;
|
||||
import net.gepafin.tendermanagement.service.ApplicationEvaluationService;
|
||||
import net.gepafin.tendermanagement.web.rest.api.ApplicationEvaluationApi;
|
||||
@@ -20,8 +16,6 @@ import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("${openapi.gepafin.base-path:/v1/applicationEvaluation}")
|
||||
public class ApplicationEvaluationApiController implements ApplicationEvaluationApi {
|
||||
@@ -30,13 +24,19 @@ public class ApplicationEvaluationApiController implements ApplicationEvaluation
|
||||
private ApplicationEvaluationService applicationEvaluationService;
|
||||
|
||||
@Override
|
||||
public ResponseEntity<Response<ApplicationEvaluationResponse>> createOrUpdateApplicationEvaluation(HttpServletRequest request,
|
||||
Long assignedApplicationsId,ApplicationEvaluationRequest evaluationRequest) {
|
||||
ApplicationEvaluationResponse response = applicationEvaluationService.createOrUpdateApplicationEvaluation(request,evaluationRequest,assignedApplicationsId);
|
||||
public ResponseEntity<Response<ApplicationEvaluationResponse>> createOrUpdateApplicationEvaluation(
|
||||
HttpServletRequest request,
|
||||
Long assignedApplicationsId,
|
||||
ApplicationEvaluationRequest evaluationRequest) {
|
||||
|
||||
ApplicationEvaluationResponse response = applicationEvaluationService.createOrUpdateApplicationEvaluation(
|
||||
request, evaluationRequest, assignedApplicationsId);
|
||||
|
||||
return ResponseEntity.status(HttpStatus.CREATED)
|
||||
.body(new Response<>(response, Status.SUCCESS, Translator.toLocale(GepafinConstant.EVALUATION_CREATED_SUCCESSFULLY)));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResponseEntity<Response<ApplicationEvaluationResponse>> getApplicationEvaluationByApplicationId(
|
||||
HttpServletRequest request, Long applicationId, Long assignedApplicationId) {
|
||||
@@ -56,10 +56,4 @@ public class ApplicationEvaluationApiController implements ApplicationEvaluation
|
||||
.body(new Response<>(null, Status.SUCCESS, Translator.toLocale(GepafinConstant.EVALUATION_DELETED_SUCCESSFULLY)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<Response<ApplicationEvaluationResponse>> updateApplicationEvaluationStatus(HttpServletRequest request, Long assignedApplicationId, AssignedEvaluationStatus status) {
|
||||
ApplicationEvaluationResponse applicationEvaluationResponse = applicationEvaluationService.updateApplicationEvaluationStatus(request, assignedApplicationId,status);
|
||||
return ResponseEntity.status(HttpStatus.OK)
|
||||
.body(new Response<>(applicationEvaluationResponse, Status.SUCCESS, Translator.toLocale(GepafinConstant.APPLICATION_EVALUATION_STATUS_UPDATED_SUCCESSFULLY)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user