Skip to content

[Customer Portal][BE] Enhance project and deployment responses with PDP subscription and number field - #514

Merged
cloby99 merged 1 commit into
wso2-open-operations:dev-app-customer-portalfrom
Rashmika998:dev-app-customer-portal
Apr 19, 2026
Merged

cloby99 merged 1 commit into
wso2-open-operations:dev-app-customer-portalfrom
Rashmika998:dev-app-customer-portal

Conversation

@Rashmika998

@Rashmika998 Rashmika998 commented Apr 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR updates project-related responses to include PDP subscription information and enhances deployment responses with an additional number field.

Changes

1️⃣ Project Response Update

  • Replaced hasSr field with hasPdpSubscription
  • Updated DTOs/records and mapping logic

2️⃣ Projects List Response Update

  • Added hasPdpSubscription field to project response
  • Updated response models and mappings accordingly

Reason:
hasPdpSubscription more accurately reflects the subscription status compared to hasSr, improving clarity and domain alignment.


3️⃣ Deployment Response Enhancement

  • Added number field to deployment response
  • Updated DTOs and serialization logic

Reason:
Including a number field provides better identification and display support for deployments in the UI.

Impact

  • hasSr field removed and replaced with hasPdpSubscription

Consumers must update usage accordingly.

Testing

  • Verified project response includes hasPdpSubscription
  • Confirmed projects list response no longer includes hasSr
  • Tested deployment response includes number

Summary by CodeRabbit

Release Notes

  • New Features

    • Projects now expose PDP subscription status in API responses, replacing service request status indicator.
    • Deployments now include deployment number information.
  • Improvements

    • Account schema properties now have defined default values for improved consistency.

@Rashmika998 Rashmika998 self-assigned this Apr 19, 2026
@Rashmika998 Rashmika998 added Type/Improvement Marks enhancements or improvements to existing features App/Customer Portal Area/Backend labels Apr 19, 2026
@coderabbitai

coderabbitai Bot commented Apr 19, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Backend type definitions and API schemas updated to replace service request (hasSr) tracking with PDP subscription indicator (hasPdpSubscription) across Project and ProjectResponse records. Deployment record extended with optional number field. Mapping utilities and OpenAPI schema synchronized accordingly.

Changes

Cohort / File(s) Summary
Type Definitions
apps/customer-portal/backend/modules/entity/types.bal, apps/customer-portal/backend/modules/types/types.bal
Added boolean hasPdpSubscription field to Project and ProjectResponse records; removed boolean hasSr from ProjectResponse. Added optional string? number field to Deployment record.
OpenAPI Schema
apps/customer-portal/backend/openapi.yaml
Updated components/schemas/ProjectResponse to replace required field hasSr with hasPdpSubscription (with updated description). Added default values ("") to Account.domainList and Account.classification properties.
Utility Mappings
apps/customer-portal/backend/utils.bal
Extended mapDeployments to include number field mapping. Updated mapProjectsResponse to add hasPdpSubscription mapping. Replaced hasSr with hasPdpSubscription in mapProjectResponse return structure.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • cloby99
  • shayanmalinda
  • sacheeramesh

Poem

🐰 Old hasSr fields fade away,
PDP subscriptions lead the way,
Deployments now have numbers true,
Type schemas shine with changes new,
The backend hops with mapping grace! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers key changes with clear sections, but lacks several required template sections like Purpose, Goals, Approach, Release note, Documentation, and others. Add missing required sections from the template: Purpose (with issue links), Goals, Approach, Release note, Documentation, Training, Certification, Marketing, Automation tests, Security checks, Samples, Related PRs, Migrations, Test environment, and Learning.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: enhancing project and deployment responses with PDP subscription and number fields.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 | 🟠 Major

Document the changed list/deployment response bodies too.

The PR changes project-list items and deployment responses, but these 200 responses still have no OpenAPI body schema. Generated clients will not learn about hasPdpSubscription on /projects/search results or number on 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, and DeploymentsResponse component schemas so they include hasPdpSubscription and number.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4869abd and 1e6b937.

📒 Files selected for processing (4)
  • apps/customer-portal/backend/modules/entity/types.bal
  • apps/customer-portal/backend/modules/types/types.bal
  • apps/customer-portal/backend/openapi.yaml
  • apps/customer-portal/backend/utils.bal

Comment thread apps/customer-portal/backend/modules/entity/types.bal
@Rashmika998
Rashmika998 requested a review from cloby99 April 19, 2026 07:14
@cloby99
cloby99 merged commit 9eb19d3 into wso2-open-operations:dev-app-customer-portal Apr 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

App/Customer Portal Area/Backend Type/Improvement Marks enhancements or improvements to existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants