Resolved conflicts

This commit is contained in:
rajesh
2024-08-28 17:43:21 +05:30
13 changed files with 134 additions and 38 deletions

View File

@@ -97,6 +97,10 @@ public class GepafinConstant {
public static final String UPDATE_USER_STATUS_SUCCESS_MSG = "update.user.status.success"; public static final String UPDATE_USER_STATUS_SUCCESS_MSG = "update.user.status.success";
public static final String FIELD_NOT_NULL = "field.not.null"; public static final String FIELD_NOT_NULL = "field.not.null";
public static final String FIELD_NOT_EMPTY = "field.not.empty"; public static final String FIELD_NOT_EMPTY = "field.not.empty";
public static final String UPDATE_CALL_STATUS_SUCCESS_MSG = "update_call_status_success_msg";
public static final String STATUS_SAME_ERROR = "status.same.error";
public static final String INVALID_STATUS_CHANGE_FROM_DRAFT = "invalid.status.change.from.draft";
public static final String STATUS_CANNOT_BE_CHANGED = "status.cannot.be.changed";
public static final String INVALID_STATUS_TRANSITION = "invalid.status.transition";
} }

View File

@@ -8,6 +8,7 @@ import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import net.gepafin.tendermanagement.enums.UserStatusEnum;
import net.gepafin.tendermanagement.model.response.*; import net.gepafin.tendermanagement.model.response.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@@ -120,7 +121,7 @@ public class CallDao {
if (criteriaReqList == null) { if (criteriaReqList == null) {
return null; return null;
} }
List<EvaluationCriteriaEntity> existingCriteria = evaluationCriteriaRepository.findByCallIdAndLookupDataTypeAndIsDeletedFalse(callEntity.getId(), type.getValue()); List<EvaluationCriteriaEntity> existingCriteria = evaluationCriteriaRepository.findByCallIdAndLookupDataTypeAndIsDeletedFalse(callEntity.getId(), type.getValue());
List<Long> incomingIds = criteriaReqList.stream().map(EvaluationCriteriaReq::getId) List<Long> incomingIds = criteriaReqList.stream().map(EvaluationCriteriaReq::getId)
.filter(id -> id != null && id > 0).collect(Collectors.toList()); .filter(id -> id != null && id > 0).collect(Collectors.toList());
@@ -139,7 +140,7 @@ public class CallDao {
} }
private EvaluationCriteriaEntity convertToEvaluationCriteriaEntity(EvaluationCriteriaReq criteriaReq, private EvaluationCriteriaEntity convertToEvaluationCriteriaEntity(EvaluationCriteriaReq criteriaReq,
CallEntity callEntity, LookUpDataTypeEnum type) { CallEntity callEntity, LookUpDataTypeEnum type) {
EvaluationCriteriaEntity criteriaEntity = null; EvaluationCriteriaEntity criteriaEntity = null;
LookUpDataEntity lookupDataEntity = convertLookUpDataRequestIntoLookUpDataEntity(criteriaReq, type); LookUpDataEntity lookupDataEntity = convertLookUpDataRequestIntoLookUpDataEntity(criteriaReq, type);
if (criteriaReq.getId() == null && criteriaReq.getId().equals(0l)) { if (criteriaReq.getId() == null && criteriaReq.getId().equals(0l)) {
@@ -161,7 +162,7 @@ public class CallDao {
public List<DocumentEntity> convertToDocumentEntities(List<DocumentReq> documentReqList, CallEntity callEntity, public List<DocumentEntity> convertToDocumentEntities(List<DocumentReq> documentReqList, CallEntity callEntity,
DocumentTypeEnum documentType) { DocumentTypeEnum documentType) {
if (documentReqList == null) { if (documentReqList == null) {
return null; return null;
} }
@@ -203,10 +204,10 @@ public class CallDao {
return faqEntities; return faqEntities;
} }
public FaqEntity convertToFaqEntity(FaqReq faqReq, CallEntity callEntity, Long userId) { public FaqEntity convertToFaqEntity(FaqReq faqReq, CallEntity callEntity, Long userId) {
FaqEntity faqEntity = new FaqEntity(); FaqEntity faqEntity = new FaqEntity();
validateFaqEntity(faqReq.getQuestion()); validateFaqEntity(faqReq.getQuestion());
UserEntity userEntity = userService.validateUser(userId); UserEntity userEntity = userService.validateUser(userId);
faqEntity.setUser(userEntity); faqEntity.setUser(userEntity);
faqEntity.setIsVisible(true); faqEntity.setIsVisible(true);
if (faqReq.getIsVisible() != null) { if (faqReq.getIsVisible() != null) {
@@ -258,7 +259,7 @@ public class CallDao {
} }
if (createCallRequest.getStartDate().toLocalDate().isBefore(LocalDate.now()) if (createCallRequest.getStartDate().toLocalDate().isBefore(LocalDate.now())
|| createCallRequest.getEndDate().toLocalDate().isBefore(LocalDate.now()) || createCallRequest || createCallRequest.getEndDate().toLocalDate().isBefore(LocalDate.now()) || createCallRequest
.getStartDate().toLocalDate().isAfter(createCallRequest.getEndDate().toLocalDate())) { .getStartDate().toLocalDate().isAfter(createCallRequest.getEndDate().toLocalDate())) {
throw new CustomValidationException(Status.VALIDATION_ERROR, throw new CustomValidationException(Status.VALIDATION_ERROR,
Translator.toLocale(GepafinConstant.INVALID_DATE_MSG)); Translator.toLocale(GepafinConstant.INVALID_DATE_MSG));
} }
@@ -326,8 +327,8 @@ public class CallDao {
} }
public CallResponse assembleCreateCallResponseBean(CallEntity callEntity, public CallResponse assembleCreateCallResponseBean(CallEntity callEntity,
List<EvaluationCriteriaEntity> evaluationCriteriaEntities, List<DocumentEntity> documentEntities, List<EvaluationCriteriaEntity> evaluationCriteriaEntities, List<DocumentEntity> documentEntities,
List<FaqEntity> faqEntities, List<DocumentEntity> images) { List<FaqEntity> faqEntities, List<DocumentEntity> images) {
CallResponse callResponseBean = convertToCallResponseBean(callEntity); CallResponse callResponseBean = convertToCallResponseBean(callEntity);
@@ -351,7 +352,7 @@ public class CallDao {
} }
public List<LookUpDataResponse> convertLookUpDataEntities(List<LookUpDataReq> lookUpData, CallEntity callEntity, public List<LookUpDataResponse> convertLookUpDataEntities(List<LookUpDataReq> lookUpData, CallEntity callEntity,
LookUpDataEntity.LookUpDataTypeEnum type) { LookUpDataEntity.LookUpDataTypeEnum type) {
List<LookUpDataEntity> lookUpDataEntities = lookUpData.stream() List<LookUpDataEntity> lookUpDataEntities = lookUpData.stream()
.map(req -> convertLookUpDataRequestIntoLookUpDataEntity(req, type)).collect(Collectors.toList()); .map(req -> convertLookUpDataRequestIntoLookUpDataEntity(req, type)).collect(Collectors.toList());
@@ -359,7 +360,7 @@ public class CallDao {
} }
private List<LookUpDataResponse> createCallTargetAudienceCheckList(CallEntity callEntity, private List<LookUpDataResponse> createCallTargetAudienceCheckList(CallEntity callEntity,
List<LookUpDataEntity> lookUpDataEntities) { List<LookUpDataEntity> lookUpDataEntities) {
List<LookUpDataResponse> lookUpDataResponses = new ArrayList<>(); List<LookUpDataResponse> lookUpDataResponses = new ArrayList<>();
for (LookUpDataEntity lookUpDataEntity : lookUpDataEntities) { for (LookUpDataEntity lookUpDataEntity : lookUpDataEntities) {
CallTargetAudienceChecklistEntity callTargetAudienceChecklistEntity = new CallTargetAudienceChecklistEntity(); CallTargetAudienceChecklistEntity callTargetAudienceChecklistEntity = new CallTargetAudienceChecklistEntity();
@@ -375,7 +376,7 @@ public class CallDao {
} }
private LookUpDataEntity convertLookUpDataRequestIntoLookUpDataEntity(LookUpDataReq req, private LookUpDataEntity convertLookUpDataRequestIntoLookUpDataEntity(LookUpDataReq req,
LookUpDataEntity.LookUpDataTypeEnum type) { LookUpDataEntity.LookUpDataTypeEnum type) {
if (req.getLookUpDataId() == null || req.getLookUpDataId().equals(0l)) { if (req.getLookUpDataId() == null || req.getLookUpDataId().equals(0l)) {
LookUpDataEntity newEntity = new LookUpDataEntity(); LookUpDataEntity newEntity = new LookUpDataEntity();
newEntity.setValue(req.getValue()); newEntity.setValue(req.getValue());
@@ -405,6 +406,7 @@ public class CallDao {
return callRepository.findById(callId).orElseThrow(() -> new CustomValidationException(Status.VALIDATION_ERROR, return callRepository.findById(callId).orElseThrow(() -> new CustomValidationException(Status.VALIDATION_ERROR,
Translator.toLocale(GepafinConstant.CALL_NOT_FOUND))); Translator.toLocale(GepafinConstant.CALL_NOT_FOUND)));
} }
public CallResponse getCallById(Long callId) { public CallResponse getCallById(Long callId) {
CallEntity callEntity = callRepository.findById(callId) CallEntity callEntity = callRepository.findById(callId)
.orElseThrow(() -> new CustomValidationException(Status.VALIDATION_ERROR, .orElseThrow(() -> new CustomValidationException(Status.VALIDATION_ERROR,
@@ -486,7 +488,7 @@ public class CallDao {
} }
private void updateFaq(CallEntity callEntity, List<FaqReq> faqReqList, UserEntity userEntity) { private void updateFaq(CallEntity callEntity, List<FaqReq> faqReqList, UserEntity userEntity) {
if(faqReqList==null) { if (faqReqList == null) {
return; return;
} }
List<FaqEntity> existingFaqs = faqRepository.findByCallIdAndIsDeletedFalse(callEntity.getId()); List<FaqEntity> existingFaqs = faqRepository.findByCallIdAndIsDeletedFalse(callEntity.getId());
@@ -543,7 +545,7 @@ public class CallDao {
} }
private void createOrUpdateCallTargetAudienceChecklist(LookUpDataReq lookUpDataReq, CallEntity callEntity, private void createOrUpdateCallTargetAudienceChecklist(LookUpDataReq lookUpDataReq, CallEntity callEntity,
LookUpDataTypeEnum type) { LookUpDataTypeEnum type) {
CallTargetAudienceChecklistEntity checklistEntity = null; CallTargetAudienceChecklistEntity checklistEntity = null;
LookUpDataEntity lookupDataEntity = convertLookUpDataRequestIntoLookUpDataEntity(lookUpDataReq, type); LookUpDataEntity lookupDataEntity = convertLookUpDataRequestIntoLookUpDataEntity(lookUpDataReq, type);
if (lookUpDataReq.getId() != null && lookUpDataReq.getId() > 0) { if (lookUpDataReq.getId() != null && lookUpDataReq.getId() > 0) {
@@ -591,6 +593,7 @@ public class CallDao {
callDetailsResponseBean.setUpdatedDate(callEntity.getUpdatedDate()); callDetailsResponseBean.setUpdatedDate(callEntity.getUpdatedDate());
return callDetailsResponseBean; return callDetailsResponseBean;
} }
private CallResponse getCallResponseBean(CallEntity callEntity) { private CallResponse getCallResponseBean(CallEntity callEntity) {
List<DocumentEntity> documentEntities = documentRepository.findByCallIdAndTypeAndIsDeletedFalse(callEntity.getId(), List<DocumentEntity> documentEntities = documentRepository.findByCallIdAndTypeAndIsDeletedFalse(callEntity.getId(),
DocumentTypeEnum.DOCUMENT.getValue()); DocumentTypeEnum.DOCUMENT.getValue());
@@ -613,6 +616,7 @@ public class CallDao {
createCallResponseBean.setCheckList(checkList); createCallResponseBean.setCheckList(checkList);
return createCallResponseBean; return createCallResponseBean;
} }
public List<CallDetailsResponseBean> getAllCalls() { public List<CallDetailsResponseBean> getAllCalls() {
return callRepository.findAll() return callRepository.findAll()
.stream() .stream()
@@ -635,4 +639,38 @@ public class CallDao {
} }
return callEntity; return callEntity;
} }
public CallResponse updateCallStatus(Long callId, CallStatusEnum statusReq) {
CallEntity callEntity = callRepository.findById(callId)
.orElseThrow(() -> new ResourceNotFoundException(Status.NOT_FOUND, Translator.toLocale(GepafinConstant.CALL_NOT_FOUND)));
CallStatusEnum currentStatus = CallStatusEnum.valueOf(callEntity.getStatus());
validateStatusChange(currentStatus, statusReq);
callEntity.setStatus(statusReq.getValue());
callEntity = callRepository.save(callEntity);
return convertToCallResponseBean(callEntity);
}
private void validateStatusChange(CallStatusEnum currentStatus, CallStatusEnum newStatus) {
if (currentStatus == newStatus) {
throw new CustomValidationException(Status.VALIDATION_ERROR,
Translator.toLocale(GepafinConstant.STATUS_SAME_ERROR));
}
switch (currentStatus) {
case DRAFT:
if (newStatus == CallStatusEnum.READY_TO_PUBLISH || newStatus == CallStatusEnum.PUBLISH) {
throw new CustomValidationException(Status.VALIDATION_ERROR,
Translator.toLocale(GepafinConstant.INVALID_STATUS_CHANGE_FROM_DRAFT));
}
break;
case PUBLISH:
case EXPIRE:
throw new CustomValidationException(Status.VALIDATION_ERROR,
Translator.toLocale(GepafinConstant.STATUS_CANNOT_BE_CHANGED));
default:
throw new CustomValidationException(Status.VALIDATION_ERROR,
Translator.toLocale(GepafinConstant.INVALID_STATUS_TRANSITION));
}
}
} }

View File

@@ -67,11 +67,12 @@ public class LookUpDataDao {
return response; return response;
} }
public List<LookUpDataResponseBean> getLookUpDataByType(LookUpDataTypeEnum type) { public List<LookUpDataResponseBean> getLookUpDataByTypes(List<LookUpDataTypeEnum> types) {
return lookUpDataRepository.findByType(type.getValue()) return types.stream()
.stream() .flatMap(type -> lookUpDataRepository.findByType(type.getValue()).stream())
.map(this::convertLookUpDataEntityToResponseBean) .map(this::convertLookUpDataEntityToResponseBean)
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
} }

View File

@@ -4,11 +4,14 @@ import java.util.List;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import net.gepafin.tendermanagement.entities.CallEntity; import net.gepafin.tendermanagement.entities.CallEntity;
import net.gepafin.tendermanagement.enums.CallStatusEnum;
import net.gepafin.tendermanagement.enums.UserStatusEnum;
import net.gepafin.tendermanagement.model.request.CreateCallRequestStep1; import net.gepafin.tendermanagement.model.request.CreateCallRequestStep1;
import net.gepafin.tendermanagement.model.request.CreateCallRequestStep2; import net.gepafin.tendermanagement.model.request.CreateCallRequestStep2;
import net.gepafin.tendermanagement.model.request.UpdateCallRequestStep1; import net.gepafin.tendermanagement.model.request.UpdateCallRequestStep1;
import net.gepafin.tendermanagement.model.response.CallDetailsResponseBean; import net.gepafin.tendermanagement.model.response.CallDetailsResponseBean;
import net.gepafin.tendermanagement.model.response.CallResponse; import net.gepafin.tendermanagement.model.response.CallResponse;
import net.gepafin.tendermanagement.model.response.UserResponseBean;
public interface CallService { public interface CallService {
@@ -25,4 +28,7 @@ public interface CallService {
CallResponse validateCall(Long callId); CallResponse validateCall(Long callId);
public CallEntity getCallEntityById(Long id); public CallEntity getCallEntityById(Long id);
CallResponse updateCallStatus(Long callId, CallStatusEnum statusReq);
} }

View File

@@ -16,5 +16,5 @@ public interface LookUpDataService {
void deleteLookUpData(Long id); void deleteLookUpData(Long id);
List<LookUpDataResponseBean> getLookUpDataByType(LookUpDataTypeEnum type); List<LookUpDataResponseBean> getLookUpDataByType(List<LookUpDataTypeEnum> type);
} }

View File

@@ -4,11 +4,14 @@ import jakarta.servlet.http.HttpServletRequest;
import net.gepafin.tendermanagement.config.jwt.TokenProvider; import net.gepafin.tendermanagement.config.jwt.TokenProvider;
import net.gepafin.tendermanagement.dao.CallDao; import net.gepafin.tendermanagement.dao.CallDao;
import net.gepafin.tendermanagement.entities.CallEntity; import net.gepafin.tendermanagement.entities.CallEntity;
import net.gepafin.tendermanagement.enums.CallStatusEnum;
import net.gepafin.tendermanagement.enums.UserStatusEnum;
import net.gepafin.tendermanagement.model.request.CreateCallRequestStep1; import net.gepafin.tendermanagement.model.request.CreateCallRequestStep1;
import net.gepafin.tendermanagement.model.request.CreateCallRequestStep2; import net.gepafin.tendermanagement.model.request.CreateCallRequestStep2;
import net.gepafin.tendermanagement.model.request.UpdateCallRequestStep1; import net.gepafin.tendermanagement.model.request.UpdateCallRequestStep1;
import net.gepafin.tendermanagement.model.response.CallDetailsResponseBean; import net.gepafin.tendermanagement.model.response.CallDetailsResponseBean;
import net.gepafin.tendermanagement.model.response.CallResponse; import net.gepafin.tendermanagement.model.response.CallResponse;
import net.gepafin.tendermanagement.model.response.UserResponseBean;
import net.gepafin.tendermanagement.service.CallService; import net.gepafin.tendermanagement.service.CallService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -71,4 +74,10 @@ public class CallServiceImpl implements CallService {
public CallEntity getCallEntityById(Long id){ public CallEntity getCallEntityById(Long id){
return callDao.getCallEntityById(id); return callDao.getCallEntityById(id);
} }
@Override
@Transactional(rollbackFor = Exception.class)
public CallResponse updateCallStatus(Long callId, CallStatusEnum statusReq) {
return callDao.updateCallStatus(callId, statusReq);
}
} }

View File

@@ -36,7 +36,7 @@ public class LookUpDataServiceImpl implements LookUpDataService {
lookUpDataDao.deleteLookUpData(id); lookUpDataDao.deleteLookUpData(id);
} }
@Override @Override
public List<LookUpDataResponseBean> getLookUpDataByType(LookUpDataTypeEnum type) { public List<LookUpDataResponseBean> getLookUpDataByType( List<LookUpDataTypeEnum> type) {
return lookUpDataDao.getLookUpDataByType(type); return lookUpDataDao.getLookUpDataByTypes(type);
} }
} }

View File

@@ -2,15 +2,15 @@ package net.gepafin.tendermanagement.web.rest.api;
import java.util.List; import java.util.List;
import net.gepafin.tendermanagement.enums.CallStatusEnum;
import net.gepafin.tendermanagement.enums.UserStatusEnum;
import net.gepafin.tendermanagement.model.response.UserResponseBean;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
@@ -120,5 +120,23 @@ public interface CallApi {
@PreAuthorize("hasRole('ROLE_SUPER_ADMIN')") @PreAuthorize("hasRole('ROLE_SUPER_ADMIN')")
public ResponseEntity<Response<CallResponse>> validateCall(HttpServletRequest request, public ResponseEntity<Response<CallResponse>> validateCall(HttpServletRequest request,
@Parameter(description = "The call id", required = true) @PathVariable("callId") Long callId); @Parameter(description = "The call id", required = true) @PathVariable("callId") Long callId);
@Operation(summary = "Api to update call 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)}))
})
@RequestMapping(value = "/{callId}/status",
produces = {"application/json"},
method = RequestMethod.PUT)
@PreAuthorize("hasRole('ROLE_SUPER_ADMIN')")
default ResponseEntity<Response<CallResponse>> updateCallStatus(
@Parameter(description = "The call id", required = true) @PathVariable("callId") Long callId,
@Parameter(description = "status", required = true)@RequestParam(value = "status", required = true) CallStatusEnum status) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
} }

View File

@@ -77,5 +77,5 @@ public interface LookUpDataApi {
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = { @ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE)}))}) @ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE)}))})
@GetMapping(value = "/type", produces = "application/json") @GetMapping(value = "/type", produces = "application/json")
ResponseEntity<Response<List<LookUpDataResponseBean>>> getLookUpDataByType(HttpServletRequest request, @RequestParam LookUpDataTypeEnum type); ResponseEntity<Response<List<LookUpDataResponseBean>>> getLookUpDataByType(HttpServletRequest request, @RequestParam List<LookUpDataTypeEnum> types);
} }

View File

@@ -2,11 +2,16 @@ package net.gepafin.tendermanagement.web.rest.api.impl;
import java.util.List; import java.util.List;
import net.gepafin.tendermanagement.enums.CallStatusEnum;
import net.gepafin.tendermanagement.enums.UserStatusEnum;
import net.gepafin.tendermanagement.model.response.UserResponseBean;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
@@ -78,4 +83,9 @@ public class CallApiController implements CallApi {
return ResponseEntity.status(HttpStatus.OK) return ResponseEntity.status(HttpStatus.OK)
.body(new Response<>(call, Status.SUCCESS, Translator.toLocale(GepafinConstant.CALL_FETCH_SUCCESS_MSG))); .body(new Response<>(call, Status.SUCCESS, Translator.toLocale(GepafinConstant.CALL_FETCH_SUCCESS_MSG)));
} }
@Override
public ResponseEntity<Response<CallResponse>> updateCallStatus(@PathVariable Long callId, @RequestParam CallStatusEnum status) {
CallResponse updateCall = callService.updateCallStatus(callId, status);
return ResponseEntity.ok(new Response<>(updateCall, Status.SUCCESS, Translator.toLocale(GepafinConstant.UPDATE_CALL_STATUS_SUCCESS_MSG)));
}
} }

View File

@@ -63,7 +63,7 @@ public class LookUpDataApiController implements LookUpDataApi {
.body(new Response<>(null, Status.SUCCESS, Translator.toLocale(GepafinConstant.LOOKUP_DATA_DELETED_SUCCESSFULLY))); .body(new Response<>(null, Status.SUCCESS, Translator.toLocale(GepafinConstant.LOOKUP_DATA_DELETED_SUCCESSFULLY)));
} }
@Override @Override
public ResponseEntity<Response<List<LookUpDataResponseBean>>> getLookUpDataByType(HttpServletRequest request, LookUpDataTypeEnum type) { public ResponseEntity<Response<List<LookUpDataResponseBean>>> getLookUpDataByType(HttpServletRequest request, List<LookUpDataTypeEnum> type) {
List<LookUpDataResponseBean> responseBean = lookUpDataService.getLookUpDataByType(type); List<LookUpDataResponseBean> responseBean = lookUpDataService.getLookUpDataByType(type);
if (responseBean != null) { if (responseBean != null) {
return ResponseEntity.status(HttpStatus.OK) return ResponseEntity.status(HttpStatus.OK)

View File

@@ -51,6 +51,11 @@ call.not.found=Call not found.
score.not.null=Score cannot be null or cannot be zero. score.not.null=Score cannot be null or cannot be zero.
field.not.null={0} cannot be null. field.not.null={0} cannot be null.
field.not.empty={0} cannot be empty. field.not.empty={0} cannot be empty.
update_call_status_success_msg=The call status has been updated successfully.
status.same.error=Status is already set.
invalid.status.change.from.draft=Status cannot be changed to READY_TO_PUBLISH or PUBLISH from DRAFT.
status.cannot.be.changed=Status cannot be changed.
invalid.status.transition=Invalid status transition.
# Login-related messages # Login-related messages
login.successfully=Login successfully. login.successfully=Login successfully.

View File

@@ -51,6 +51,11 @@ call.not.found=Chiamata non trovata.
score.not.null=Il punteggio non pu<70> essere nullo o zero. score.not.null=Il punteggio non pu<70> essere nullo o zero.
field.not.null={0} non pu<70> essere nullo. field.not.null={0} non pu<70> essere nullo.
field.not.empty=la {0} non pu<70> essere vuota. field.not.empty=la {0} non pu<70> essere vuota.
update_call_status_success_msg=Lo stato della chiamata <20> stato aggiornato con successo.
status.same.error=Lo stato <20> gi<67> impostato.
invalid.status.change.from.draft=Lo stato non pu<70> essere cambiato in READY_TO_PUBLISH o PUBLISH da DRAFT.
status.cannot.be.changed=Lo stato non pu<70> essere cambiato.
invalid.status.transition=Transizione di stato non valida.
# Login-related messages # Login-related messages
login.successfully=Accesso effettuato con successo. login.successfully=Accesso effettuato con successo.