Skip to content

[Customer Portal[BE] Enhance change request response and include description in deployed product create/update payloads - #279

Merged
chanukaranaba merged 2 commits into
wso2-open-operations:customer-portal-milestone-1from
Rashmika998:customer-portal-milestone-1-projects
Mar 2, 2026
Merged

chanukaranaba merged 2 commits into
wso2-open-operations:customer-portal-milestone-1from
Rashmika998:customer-portal-milestone-1-projects

Conversation

@Rashmika998

@Rashmika998 Rashmika998 commented Mar 2, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR enhances the change request response structure and updates the deployed product create and update payloads to include a description field.

Changes

1️⃣ Change Request Response Enhancement

  • Extended change request response model
  • Included additional fields (if applicable)
  • Updated DTOs and mappings
  • Ensured consistent serialization and response formatting

Reason:
The existing response did not include sufficient contextual information required by the UI and reporting flows.


2️⃣ Include Description in Deployed Product Create & Update

  • Added optional description field to:
    • Create deployed product payload
    • Update deployed product payload
  • Updated request validation logic
  • Adjusted persistence and mapping logic accordingly

Reason:
Including a description field enables:

  • Better documentation of deployed products
  • Improved clarity in deployment management
  • Enhanced UI support for contextual information

Impact

  • Change request response extended (non-breaking addition)
  • Deployed product payload enhanced with optional field (non-breaking change)

Testing

  • Verified change request response includes updated fields
  • Tested deployed product create with and without description
  • Tested deployed product update with description changes

Related PRs

Summary by CodeRabbit

  • New Features
    • Added optional description when creating/updating deployed products
    • Time card search can now filter by state (Submitted, Approved)
    • Change requests can record assigned engineer and assigned team
    • Change request responses now include approval info (approver and approval timestamp)

@coderabbitai

coderabbitai Bot commented Mar 2, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 352c408 and b182f76.

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

📝 Walkthrough

Walkthrough

Adds optional metadata fields across customer-portal backend types: a description on deployed-product payloads, TimeCardState + state filter for time-card search, and assignment/approval reference fields on change requests; validation and mapping/service calls updated to handle these fields.

Changes

Cohort / File(s) Summary
Type Definitions
apps/customer-portal/backend/modules/types/types.bal, apps/customer-portal/backend/modules/entity/types.bal, apps/customer-portal/backend/modules/entity/enums.bal
Added string? description to DeployedProductCreatePayload/DeployedProductUpdatePayload; added TimeCardState enum and state? to TimeCardSearchPayload filters; added assignedEngineer? and assignedTeam? to ChangeRequest; added approvedBy? and approvedOn? to ChangeRequestResponse.
Validation
apps/customer-portal/backend/modules/entity/utils.bal
Updated validateDeployedProductUpdatePayload to consider description in deactivation checks and "at least one field" requirement.
Mapping / Output
apps/customer-portal/backend/utils.bal
Extended mapChangeRequestSearchResponse and mapChangeRequestResponse to include assignedEngineer, assignedTeam, and approvedBy (as {id,label} objects) in outputs.
Service Layer
apps/customer-portal/backend/service.bal
Included description in deployed-product create payload; added filters?.state to time-card search payload.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • cloby99
  • shayanmalinda
  • sacheeramesh

Poem

"🐰 I hopped through types and left a note,
A description here, a state to float,
Engineers and teams now find their place,
Approvals logged with gentle grace,
The backend bounces on with joyful pace."

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description covers purpose, changes, impact, testing, and related PRs, but omits most template sections like goals, approach, documentation, security checks, and test environment details. Add missing template sections: Goals, Approach, Documentation impact, Security checks (secure coding, FindSecurityBugs, secrets verification), and Test environment details.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title directly matches the two main changes: enhancing change request response and adding description to deployed product payloads.
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
  • Post copyable unit tests in a comment

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

🤖 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 239-240: The validation message returned when active is true (the
string currently mentioning only "cores or tps" near the active check) must be
updated to include "description" as well; locate the conditional that returns
"Invalid value for active field. When updating cores or tps, active field should
be set to false." (the active validation branch) and change the message to
mention "cores, tps, or description" so it reflects the new supported field in
this validation path.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 788d5f8 and 352c408.

📒 Files selected for processing (5)
  • 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/service.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

Labels

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

Projects

Status: Staging Deployed

Development

Successfully merging this pull request may close these issues.

3 participants