Resolved Conflicts
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user