[Customer Portal]{BE] Update case response - #317
Conversation
📝 WalkthroughWalkthroughThis PR extends the Case data model across three backend modules by adding an optional Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 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 321-322: The CaseResponse type currently inherits product as
optional from the shared Case record, which weakens the contract; update
CaseResponse so product is required by removing the optional marker and ensure
the other guaranteed fields (updatedOn, slaResponseTime, account, csManager) are
also non-optional on CaseResponse (either by making them non-optional in the
shared Case if appropriate or by explicitly redeclaring them non-optional on
CaseResponse) so the API contract matches the frontend expectations; if
list/search payloads omit these fields, model those payloads separately rather
than making CaseResponse fields optional.
In `@apps/customer-portal/backend/modules/types/types.bal`:
- Around line 91-92: The product field and other API-guaranteed fields were made
optional causing the public CaseResponse contract to break; update the
CaseResponse definition (the type named CaseResponse that embeds *Case) to make
product non-optional (change ReferenceItem? product to ReferenceItem product)
and likewise mark updatedOn, slaResponseTime, account, and csManager as
non-optional so the API contract is preserved; if you need an alternate
optional/search shape create a separate type for that instead of changing
CaseResponse.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 57582ebf-7cb9-40d8-bc9c-cfe3660e5960
📒 Files selected for processing (3)
apps/customer-portal/backend/modules/entity/types.balapps/customer-portal/backend/modules/types/types.balapps/customer-portal/backend/utils.bal
6fc6660
into
wso2-open-operations:customer-portal-milestone-1
Description
Updated the case response to include the associated product information.
Changes
Reason
Including product information in the case response allows clients to retrieve product-related data without requiring additional API calls.
Impact
Related PRs
Summary by CodeRabbit