[Customer Portal][BE] Remove case checks and update case response - #202
Conversation
📝 WalkthroughWalkthroughExtended the CaseResponse record type with closure metadata fields (closedOn, closedBy, closeNotes, hasAutoClosed), and removed per-request case access validation from the comments and attachments retrieval endpoints in the backend service. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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: 2
🤖 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/entity/types.bal`:
- Around line 291-298: The frontend CaseDetails interface is missing the new
closure fields added to the backend CaseResponse; update the CaseDetails
interface in responses.ts to include closedOn: string | null, closedBy: string |
null (or the appropriate ReferenceTableItem-like object type if you have an
equivalent frontend type), closeNotes: string | null, and hasAutoClosed: boolean
| null so the model matches the API contract (ensure you update any places that
construct or read CaseDetails to handle nullable values).
- Around line 291-298: Update the frontend CaseDetails interface to include the
four new closure properties so the API response types align: add closedOn
(string|null), closedBy ({ id: string; name: string | null } | null), closeNotes
(string|null), and hasAutoClosed (boolean|null) to the CaseDetails interface;
ensure the property names exactly match the backend fields (closedOn, closedBy,
closeNotes, hasAutoClosed) and adjust any serializers or uses of CaseDetails
that assume these fields are absent or non-nullable.
9751224
into
wso2-open-operations:customer-portal-milestone-1
Description
This PR removes the case validation/check logic from the stats endpoint and updates the case response structure.
Changes
Remove Case Check from Stats Endpoint
Update Case Response
Reason
Stats Endpoint Simplification
Case validation is now handled by ServiceNow (SN). Keeping the check in this service resulted in redundant validation and unnecessary coupling.
Removing it:
Case Response Update
The case response structure has been updated to reflect the latest contract and functional requirements.
Testing
Related PRs
Summary by CodeRabbit
New Features
Refactor