[Customer Portal] Add multi select filter support for case search - #750
Conversation
📝 WalkthroughWalkthroughThis PR extends the case search filtering capability by adding support for filtering by multiple case severities and deployments. The ChangesMulti-value case severity and deployment filters
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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
🧹 Nitpick comments (1)
apps/customer-portal/backend/modules/entity/types.bal (1)
437-450: ⚖️ Poor tradeoffVerify coexistence of singular and plural filter fields.
Both
severityKey/severityKeysanddeploymentId/deploymentIdspairs coexist in the filter record. If this is for backward compatibility during migration, consider:
- Documenting which fields are preferred
- Adding deprecation notices to the singular versions if they're being phased out
- Ensuring the implementation correctly handles precedence when both are provided
Note the type inconsistency:
deploymentIdisstring(line 448) whiledeploymentIdsuses the stricterIdString[]constraint (line 450).🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/customer-portal/backend/modules/entity/types.bal` around lines 437 - 450, The filter record defines both singular and plural fields (severityKey vs severityKeys, deploymentId vs deploymentIds) and has a type mismatch (deploymentId is string while deploymentIds is IdString[]); update the types and handling so they are consistent and unambiguous: change deploymentId to IdString? to match deploymentIds, mark singular fields (severityKey, deploymentId) as deprecated in comments/Docs if you intend to migrate to plural forms, and implement/verify precedence logic in the code that reads these filters so when both singular and plural are provided (e.g., severityKey + severityKeys or deploymentId + deploymentIds) you deterministically prefer one (document which) and convert singular to a single-element plural internally; ensure functions that consume these fields (search/filter handlers) accept the normalized plural arrays.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/customer-portal/backend/modules/types/types.bal`:
- Around line 63-64: Rename the field `severityIds` to `severityKeys` in the
types definition so it matches the entity module; update any direct references
within this module to use `severityKeys` (search for `severityIds` usages and
replace with `severityKeys`) and ensure the field type and comment remain the
same (int[]? and "List of case severity keys") to preserve behavior and
compatibility with the entity layer.
---
Nitpick comments:
In `@apps/customer-portal/backend/modules/entity/types.bal`:
- Around line 437-450: The filter record defines both singular and plural fields
(severityKey vs severityKeys, deploymentId vs deploymentIds) and has a type
mismatch (deploymentId is string while deploymentIds is IdString[]); update the
types and handling so they are consistent and unambiguous: change deploymentId
to IdString? to match deploymentIds, mark singular fields (severityKey,
deploymentId) as deprecated in comments/Docs if you intend to migrate to plural
forms, and implement/verify precedence logic in the code that reads these
filters so when both singular and plural are provided (e.g., severityKey +
severityKeys or deploymentId + deploymentIds) you deterministically prefer one
(document which) and convert singular to a single-element plural internally;
ensure functions that consume these fields (search/filter handlers) accept the
normalized plural arrays.
🪄 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: 693ac408-4f1b-443d-9bf3-c73c4243fe63
📒 Files selected for processing (4)
apps/customer-portal/backend/modules/entity/types.balapps/customer-portal/backend/modules/types/types.balapps/customer-portal/backend/openapi.yamlapps/customer-portal/backend/utils.bal
Description
Summary by CodeRabbit
New Features