Skip to content

Call status open if language not mapped#85

Merged
mo839639 merged 6 commits intoPSMRI:developfrom
ravishanigarapu:develop
May 26, 2025
Merged

Call status open if language not mapped#85
mo839639 merged 6 commits intoPSMRI:developfrom
ravishanigarapu:develop

Conversation

@ravishanigarapu
Copy link
Copy Markdown
Contributor

@ravishanigarapu ravishanigarapu commented May 26, 2025

📋 Description

JIRA ID:

Please provide a summary of the change and the motivation behind it. Include relevant context and details.


✅ Type of Change

  • 🐞 Bug fix (non-breaking change which resolves an issue)
  • New feature (non-breaking change which adds functionality)
  • 🔥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 🛠 Refactor (change that is neither a fix nor a new feature)
  • ⚙️ Config change (configuration file or build script updates)
  • 📚 Documentation (updates to docs or readme)
  • 🧪 Tests (adding new or updating existing tests)
  • 🎨 UI/UX (changes that affect the user interface)
  • 🚀 Performance (improves performance)
  • 🧹 Chore (miscellaneous changes that don't modify src or test files)

ℹ️ Additional Information

Please describe how the changes were tested, and include any relevant screenshots, logs, or other information that provides additional context.

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of call allocation and status updates for calls of type "ANM" when the language is not mapped, ensuring consistent behavior with "introductory" calls.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The conditional logic in CallClosureImpl.java was updated to include calls of type "ANM" along with "introductory" when handling cases where the language is not mapped. This change adjusts how call allocation and status are managed for these call types under the specified condition.

Changes

File(s) Change Summary
src/main/java/com/iemr/ecd/service/associate/CallClosureImpl.java Expanded the condition to reset allocation and status when language is not mapped to include "ANM" call type alongside "introductory".

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant CallClosureImpl
    participant UserAllocation

    Caller->>CallClosureImpl: Close call with callType and language mapping
    alt Language not mapped and callType is "introductory" or "ANM"
        CallClosureImpl->>UserAllocation: Clear allocatedUserId
        CallClosureImpl->>UserAllocation: Set callStatus to OPEN
        CallClosureImpl->>UserAllocation: Reset callAttemptNo to 0
        CallClosureImpl->>UserAllocation: Set allocationStatus to UNALLOCATED
    else Other cases
        CallClosureImpl->>UserAllocation: Proceed with standard closure logic
    end
Loading

Possibly related PRs

  • Duplicate records #83: Modifies conditional logic in CallClosureImpl.java for call status and allocation updates based on language mapping and call type, similar to this PR.
  • If call disconnected call status open #82: Extends logic for resetting call allocation and status to include "ANM" call types, directly modifying the same method and control flow.
  • Call status open if language not mapped #85: Expands condition to include "ANM" calls for resetting allocation status and call state, directly related to call type handling and allocation logic.

Suggested reviewers

  • helenKaryamsetty
  • mo839639

Poem

A bunny hopped through code so bright,
To add "ANM" to the call type light.
Now calls reset with greater care,
When language mapping isn’t there.
Allocation cleared, status anew—
Another hop, another view!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 702a432 and 6ff690d.

📒 Files selected for processing (1)
  • src/main/java/com/iemr/ecd/service/associate/CallClosureImpl.java (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Inline review comments failed to post. This is likely due to GitHub's limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 1

🛑 Comments failed to post (1)
src/main/java/com/iemr/ecd/repo/call_conf_allocation/OutboundCallsRepo.java (1)

132-132: 💡 Verification agent

🧩 Analysis chain

Verify impact on total allocated counts.

The addition of (t.isFurtherCallRequired = true OR t.isFurtherCallRequired IS NULL) condition to total allocated count queries changes the counting logic. Ensure this aligns with business requirements - previously allocated calls that don't require further calls will no longer be counted.

Run the following script to verify the impact of this change:

Also applies to: 139-139


🏁 Script executed:

#!/bin/bash
# Description: Check for any existing tests or documentation that might be affected by the count query changes

# Search for test files that might test these count methods
fd -e java -t f | xargs rg -l "getTotalAllocatedCount"

# Search for any documentation or comments about these count methods
rg -A 5 -B 5 "getTotalAllocatedCount"

Length of output: 5950


Missing tests and documentation for updated count logic

File: src/main/java/com/iemr/ecd/repo/call_conf_allocation/OutboundCallsRepo.java
Lines: 132 (getTotalAllocatedCountMother) and 139 (getTotalAllocatedCountChild)

We’ve added

AND (t.isFurtherCallRequired = true OR t.isFurtherCallRequired IS NULL)

to both count queries, which now exclude records where isFurtherCallRequired = false. Running:

fd -e java -t f | xargs rg -l getTotalAllocatedCount
rg -A 5 -B 5 getTotalAllocatedCount

showed no existing unit/integration tests or documentation covering these methods. To ensure correct behavior:

  • Add or update tests under src/test/java to cover all three states of isFurtherCallRequired (true, false, null) for both getTotalAllocatedCountMother and getTotalAllocatedCountChild.
  • Update any design docs, README sections or inline comments describing the allocated-count logic to note that calls flagged as “no further call required” are now omitted.
🤖 Prompt for AI Agents
In src/main/java/com/iemr/ecd/repo/call_conf_allocation/OutboundCallsRepo.java
at lines 132 and 139, the count queries for getTotalAllocatedCountMother and
getTotalAllocatedCountChild now exclude records where isFurtherCallRequired is
false by adding the condition (t.isFurtherCallRequired = true OR
t.isFurtherCallRequired IS NULL). To fix this, add or update unit and
integration tests in src/test/java to cover all three states of
isFurtherCallRequired (true, false, null) for both methods, ensuring the
counting logic is correctly validated. Also, update any relevant design
documentation, README files, or inline comments to reflect this change in
allocated-count logic, explicitly noting that calls marked as no further call
required are excluded.

@mo839639 mo839639 merged commit 668dd17 into PSMRI:develop May 26, 2025
6 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request May 26, 2025
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants