Skip to content

[Customer Portal][BE]Update case creation and project responses with parentCase and chat support - #222

Merged
Rashmika998 merged 4 commits into
wso2-open-operations:customer-portal-milestone-1from
cloby99:refactor/existing-apis
Feb 21, 2026
Merged

Rashmika998 merged 4 commits into
wso2-open-operations:customer-portal-milestone-1from
cloby99:refactor/existing-apis

Conversation

@cloby99

@cloby99 cloby99 commented Feb 21, 2026

Copy link
Copy Markdown
Member
  • Purpose
    This PR enhances case creation and related response payloads to support parent-child case relationships and chat references.

  • Changes
    Updated CaseCreatePayload to accept parentCaseId and chatId fields
    Added related parentCase and chat fields to the case record
    Updated callRequestCreatePayload response
    Updated project response payload structure

Summary by CodeRabbit

Release Notes

  • New Features
    • Cases can now reference parent cases and related chats for better case organization and tracking.
    • Project responses now include detailed account information.
    • Call request reason field is now optional.

@coderabbitai

coderabbitai Bot commented Feb 21, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

The pull request updates entity types and mappings to support case relationships and optional call request reasons. Changes include replacing ProjectResponse's Subscription field with an account record, adding parentCase and chat references to Case types, making CallRequestCreatePayload's reason optional, and updating corresponding mappings.

Changes

Cohort / File(s) Summary
Entity Type Definitions
apps/customer-portal/backend/modules/entity/types.bal
Removes Subscription type entirely; replaces ProjectResponse's Subscription field with optional account record containing id, name, activationDate, deactivationDate, region, etc. Adds optional parentCaseId and chatId to CaseCreatePayload, optional parentCase and chat to Case and CaseResponse, and makes CallRequestCreatePayload's reason field optional (string?).
Type Definitions
apps/customer-portal/backend/modules/types/types.bal
Adds two optional reference fields to Case record: parentCase and chat (both ReferenceItem?) for linking to related cases and chats.
Case Mapping Logic
apps/customer-portal/backend/utils.bal
Updates searchCases function to map new parentCase and chat fields from case records, each mapped to objects containing id and label properties when present.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested labels

Type/Improvement, App/Customer Portal, Area/Backend

Suggested reviewers

  • shayanmalinda
  • sacheeramesh

Poem

🐰 Cases now can hold their kin,
With parent links and chats within,
Subscriptions fade, accounts remain—
Relations bloom through diff's domain! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is incomplete and lacks required template sections (Purpose with issue links, Goals, Approach, User stories, Release note, Documentation, Training, Certification, Marketing, Automation tests, Security checks, Samples, Related PRs, Migrations, Test environment, Learning). Only minimal change details are provided. Expand the description to include all required template sections: add issue links in Purpose, detailed Goals and Approach, affected User stories, Release note, Documentation impact, and other required sections (or mark as N/A with explanation where not applicable).
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title directly reflects the main changes: updating case creation payloads and project responses to support parentCase and chat references, which aligns with the changeset modifications across multiple files.
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

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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.

@Rashmika998 Rashmika998 added Type/Improvement Marks enhancements or improvements to existing features App/Customer Portal Area/Backend labels Feb 21, 2026

@Rashmika998 Rashmika998 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.

LGTM

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.

2 participants