Skip to content

[Customer Portal][BE] Update deployed products update payload - #349

Merged
cloby99 merged 1 commit into
wso2-open-operations:customer-portal-milestone-1from
Rashmika998:customer-portal-milestone-1-projects
Mar 17, 2026
Merged

cloby99 merged 1 commit into
wso2-open-operations:customer-portal-milestone-1from
Rashmika998:customer-portal-milestone-1-projects

Conversation

@Rashmika998

@Rashmika998 Rashmika998 commented Mar 17, 2026 •

Copy link
Copy Markdown
Contributor

Description

  • Update deployed product update payload to include the updates

Summary by CodeRabbit

  • New Features
    • Deployed products now display a comprehensive update history including timestamps, update levels, and additional details for each change. This enhancement provides improved visibility into product development evolution, replacing the previous simplified update level indicator.

@coderabbitai

coderabbitai Bot commented Mar 17, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The PR introduces a new ProductUpdate record type and restructures the DeployedProduct type to use an optional array of ProductUpdate objects instead of a single updateLevel field, updating related validation and mapping logic 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 new ProductUpdate record with updateLevel, date, and optional details fields. Updated DeployedProduct and DeployedProductUpdatePayload to include optional ProductUpdate[]? updates field, replacing the single updateLevel field.
Validation Logic
apps/customer-portal/backend/modules/entity/utils.bal
Enhanced validation to account for the new updates field. Deactivation now requires updates to be absent alongside cores, tps, and description. Update checks now require at least one of these fields to be provided.
Mapping Utilities
apps/customer-portal/backend/utils.bal
Updated mapDeployedProducts function to map the new updates field from product data instead of updateLevel.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

Type/Improvement

Suggested reviewers

  • cloby99
  • shayanmalinda

Poem

🐰 A new ProductUpdate hops into sight,
Replacing updateLevel with structured delight,
Arrays of changes, validation so tight,
The DeployedProduct now shimmers more bright! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is incomplete. It lacks critical sections from the required template including Purpose, Goals, Approach, User stories, Release notes, and other mandatory sections. Expand the description to include all template sections: Purpose (with issue links), Goals, Approach, User stories, Release notes, Documentation, Security checks, and other applicable sections.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: updating the deployed products update payload to include product updates.
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
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

CodeRabbit can approve the review once all CodeRabbit's comments are resolved.

Enable the reviews.request_changes_workflow setting to automatically approve the review once all CodeRabbit's comments are resolved.

@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

🤖 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/utils.bal`:
- Around line 238-249: The error messages contain minor spacing typos: update
the deactivation message that currently says "updates  fields" to use a single
space ("updates fields") and fix the concatenated update message so there is a
space between "updating" and "deployed" (either add the trailing space in the
first literal "updating " or leading space in the second literal " deployed");
these strings are in the validation block that references variables
ProductUpdate, payload, updates, active, cores, tps, and description—adjust
those two string literals accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 15172aac-a3d3-41d3-aa82-7fa183a34ca0

📥 Commits

Reviewing files that changed from the base of the PR and between 05b5361 and 5c12060.

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

Comment thread apps/customer-portal/backend/modules/entity/utils.bal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants