-
Notifications
You must be signed in to change notification settings - Fork 51
1097 Abandon Call Disposition Count #357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/main/java/com/iemr/common/data/cti/DispositionCountRequest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| package com.iemr.common.data.cti; | ||
| import lombok.Data; | ||
|
|
||
| @Data | ||
| public class DispositionCountRequest { | ||
| private String transaction_id = "CTI_GET_DISP_COUNT"; | ||
| private String campaign_name; | ||
| private String disposition; | ||
| private String date; | ||
| private String enc_flag; | ||
| } |
43 changes: 43 additions & 0 deletions
43
src/main/java/com/iemr/common/data/cti/DispositionCountResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| package com.iemr.common.data.cti; | ||
| import lombok.Data; | ||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
| import com.google.gson.annotations.Expose; | ||
| import java.util.List; | ||
|
|
||
| @Data | ||
| @JsonIgnoreProperties(ignoreUnknown = true) | ||
| public class DispositionCountResponse { | ||
| @Expose | ||
| private String status; | ||
|
|
||
| @Expose | ||
| private Integer code; | ||
|
|
||
| @Expose | ||
| private String failure_reason; | ||
|
|
||
| @Expose | ||
| private Object data; | ||
|
|
||
| // Inner class for campaign data | ||
| @Data | ||
| @JsonIgnoreProperties(ignoreUnknown = true) | ||
| public static class CampaignData { | ||
| @Expose | ||
| private String campaign_name; | ||
|
|
||
| @Expose | ||
| private List<DispositionDetail> dispositions; | ||
| } | ||
|
|
||
| // Inner class for disposition detail | ||
| @Data | ||
| @JsonIgnoreProperties(ignoreUnknown = true) | ||
| public static class DispositionDetail { | ||
| @Expose | ||
| private String call_status_disposition; | ||
|
|
||
| @Expose | ||
| private String disposition_count; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,6 +52,8 @@ | |
| import com.iemr.common.data.cti.CampaignRole; | ||
| import com.iemr.common.data.cti.CampaignSkills; | ||
| import com.iemr.common.data.cti.CustomerLanguage; | ||
| import com.iemr.common.data.cti.DispositionCountRequest; | ||
| import com.iemr.common.data.cti.DispositionCountResponse; | ||
| import com.iemr.common.data.cti.TransferCall; | ||
| import com.iemr.common.repository.callhandling.BeneficiaryCallRepository; | ||
| import com.iemr.common.repository.callhandling.IEMRCalltypeRepositoryImplCustom; | ||
|
|
@@ -962,7 +964,9 @@ | |
|
|
||
| @Override | ||
| public String callPostUrl(String urlRequest, String Json) { | ||
| logger.info("From call post URL method.. URL: " + urlRequest + " Json: " + Json); | ||
| String result = httpUtils.post(urlRequest, Json); | ||
| logger.info("From call post URL method.. result: " + result); | ||
| return result; | ||
| } | ||
|
|
||
|
|
@@ -1084,4 +1088,29 @@ | |
|
|
||
| return result; | ||
| } | ||
|
|
||
| @Override | ||
| public OutputResponse getDispositionCount(String request, String ipAddress) throws IEMRException, JSONException, JsonMappingException, JsonProcessingException { | ||
|
|
||
| OutputResponse output = new OutputResponse(); | ||
| ObjectMapper objectMapper = new ObjectMapper(); | ||
| String ctiURI = ConfigProperties.getPropertyByName("get-disposition-count-URL"); | ||
| String serverURL = ConfigProperties.getPropertyByName("cti-server-ip"); | ||
| logger.info("Request="+request + ":: CTI URL="+ ctiURI + ":: Server URL="+ serverURL); | ||
Check noticeCode scanning / SonarCloud Logging should not be vulnerable to injection attacks Low
Change this code to not log user-controlled data. See more on SonarQube Cloud
|
||
| DispositionCountRequest dispositionRequest = objectMapper.readValue(request, DispositionCountRequest.class); | ||
|
|
||
| ctiURI = ctiURI.replace("CTI_SERVER", serverURL); | ||
|
|
||
| String response = this.callPostUrl(ctiURI, objectMapper.writeValueAsString(dispositionRequest)); | ||
| logger.info("disposition count API returned: " + response); | ||
|
|
||
| DispositionCountResponse result = objectMapper.readValue(response, DispositionCountResponse.class); | ||
|
|
||
| if (result.getCode() != null && result.getCode().toString().equals(CUSTOM_API_SUCCESS)) { | ||
| output.setResponse(objectMapper.writeValueAsString(result)); | ||
| } else { | ||
| output.setError(OutputResponse.GENERIC_FAILURE, result.getFailure_reason(), result.getStatus()); | ||
| } | ||
| return output; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check notice
Code scanning / SonarCloud
Logging should not be vulnerable to injection attacks Low