[Customer Portal][BE] Enhance project and deployment responses with PDP subscription and number field - #514
Conversation
📝 WalkthroughWalkthroughBackend type definitions and API schemas updated to replace service request ( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 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: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/customer-portal/backend/openapi.yaml (1)
82-83:⚠️ Potential issue | 🟠 MajorDocument the changed list/deployment response bodies too.
The PR changes project-list items and deployment responses, but these
200responses still have no OpenAPI body schema. Generated clients will not learn abouthasPdpSubscriptionon/projects/searchresults ornumberon deployment search results.Proposed schema wiring
"200": description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectsResponse'"200": description: Ok + content: + application/json: + schema: + $ref: '#/components/schemas/DeploymentsResponse'Also add/update the corresponding
Project,ProjectsResponse,Deployment, andDeploymentsResponsecomponent schemas so they includehasPdpSubscriptionandnumber.Also applies to: 183-184
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/customer-portal/backend/openapi.yaml` around lines 82 - 83, The 200 responses for the changed endpoints lack response bodies and thus clients won't see new fields; update the OpenAPI 200 responses for the affected operations (e.g., the /projects/search response and the deployment search response) to reference appropriate response schemas, and add/update the component schemas Project, ProjectsResponse, Deployment, and DeploymentsResponse to include the new properties hasPdpSubscription (on Project) and number (on Deployment) so the responses expose those fields to generated clients; wire the operations' 200 response to these components (e.g., $ref: '#/components/schemas/ProjectsResponse' and '#/components/schemas/DeploymentsResponse') and ensure required/nullable settings match behavior.
🤖 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 1193-1194: The deployment type's `number` field is currently
declared as `string? number;` which requires the field to be present and will
fail deserialization when upstream omits it; change the declaration to make
presence optional (i.e., the same pattern used for `description` and `url`) by
updating the `number` field to an optional-presence nullable type so missing
`number` in responses won't break parsing.
---
Outside diff comments:
In `@apps/customer-portal/backend/openapi.yaml`:
- Around line 82-83: The 200 responses for the changed endpoints lack response
bodies and thus clients won't see new fields; update the OpenAPI 200 responses
for the affected operations (e.g., the /projects/search response and the
deployment search response) to reference appropriate response schemas, and
add/update the component schemas Project, ProjectsResponse, Deployment, and
DeploymentsResponse to include the new properties hasPdpSubscription (on
Project) and number (on Deployment) so the responses expose those fields to
generated clients; wire the operations' 200 response to these components (e.g.,
$ref: '#/components/schemas/ProjectsResponse' and
'#/components/schemas/DeploymentsResponse') and ensure required/nullable
settings match behavior.
🪄 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: b36a6103-4832-4991-96c9-045b3877b9b9
📒 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
9eb19d3
into
wso2-open-operations:dev-app-customer-portal
Summary
This PR updates project-related responses to include PDP subscription information and enhances deployment responses with an additional
numberfield.Changes
1️⃣ Project Response Update
hasSrfield withhasPdpSubscription2️⃣ Projects List Response Update
hasPdpSubscriptionfield to project responseReason:
hasPdpSubscriptionmore accurately reflects the subscription status compared tohasSr, improving clarity and domain alignment.3️⃣ Deployment Response Enhancement
numberfield to deployment responseReason:
Including a
numberfield provides better identification and display support for deployments in the UI.Impact
hasSrfield removed and replaced withhasPdpSubscriptionConsumers must update usage accordingly.
Testing
hasPdpSubscriptionhasSrnumberSummary by CodeRabbit
Release Notes
New Features
Improvements