[Customer Portal][BE] Add project type ID to the classify endpoint payload - #520
Conversation
📝 WalkthroughWalkthroughThe pull request adds a required Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/customer-portal/backend/modules/ai_chat_agent/types.bal`:
- Around line 44-46: Add the missing projectTypeId to the frontend payload:
update the CaseClassificationRequest type to include projectTypeId: string, read
the value from useGetProjectDetails(projectId).data?.type?.id in
NoveraChatPage.tsx, and pass that value into the classifyCase(...) call where
the request object is constructed; ensure you handle the possible undefined case
(e.g., guard/early return or fallback) so classifyCase receives a valid string
for projectTypeId.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 869f8e31-d59d-4144-9226-2f0400414413
📒 Files selected for processing (2)
apps/customer-portal/backend/modules/ai_chat_agent/types.balapps/customer-portal/backend/openapi.yaml
04074b6
into
wso2-open-operations:dev-app-customer-portal
Summary
This PR updates the
cases/classifyendpoint payload to includeprojectTypeId, enabling the agent to determine severity based on the project type.Changes
projectTypeIdfield tocases/classifyrequest payloadReason
Severity classification varies depending on the project type.
Previously, the agent did not have project context, which could lead to incorrect severity classification.
By including
projectTypeId:Impact
⚠ Payload updated (potential breaking change if field is required)
Consumers must include:
projectTypeIdin the classify request payloadTesting
projectTypeIdSummary by CodeRabbit
New Features
Bug Fixes