Skip to content

[Customer Portal][BE] Add action required stat count - #564

Merged
suhand merged 1 commit into
wso2-open-operations:mainfrom
Rashmika998:dev-app-customer-portal
Apr 23, 2026
Merged

suhand merged 1 commit into
wso2-open-operations:mainfrom
Rashmika998:dev-app-customer-portal

Conversation

@Rashmika998

@Rashmika998 Rashmika998 commented Apr 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR enhances the stats endpoints for cases and change requests by introducing an actionRequired metric.

Changes

1️⃣ Case Stats Enhancement

  • Added actionRequired field to case stats response
  • Implemented aggregation logic to calculate action-required cases
  • Updated DTOs/records and mapping logic

2️⃣ Change Request Stats Enhancement

  • Added actionRequired field to change request stats response
  • Implemented aggregation logic for action-required change requests
  • Updated response models and serialization

Reason

The existing stats endpoints did not provide visibility into items requiring user action.
Adding actionRequired enables:

  • Highlighting pending or actionable items
  • Supporting dashboard indicators and alerts
  • Improving user productivity and response time

Impact

  • Response structure extended (non-breaking addition)
  • No changes to request payload
  • Enhances reporting and dashboard capabilities

Testing

  • Verified actionRequired counts for cases and change requests
  • Tested scenarios with:
    • No actionable items
    • Multiple actionable items
  • Confirmed correct aggregation logic

Summary by CodeRabbit

  • New Features
    • Added action-required count metrics to project statistics, enabling users to track pending items requiring attention in both cases and change requests.

@coderabbitai

coderabbitai Bot commented Apr 23, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 90af0adb-2103-487a-9229-e38b71a50054

📥 Commits

Reviewing files that changed from the base of the PR and between fd046d3 and b3962f9.

📒 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

📝 Walkthrough

Walkthrough

The PR adds a new actionRequiredCount integer field to project statistics response types (ProjectCaseStats and ProjectChangeRequestStatsResponse) across type definitions, OpenAPI schema, and mapping utilities to track action-required counts.

Changes

Cohort / File(s) Summary
Type Definitions
apps/customer-portal/backend/modules/entity/types.bal, apps/customer-portal/backend/modules/types/types.bal
Added actionRequiredCount: int field to ProjectCaseStats and ProjectChangeRequestStatsResponse records.
OpenAPI Schema
apps/customer-portal/backend/openapi.yaml
Added required actionRequiredCount property (integer, int64 format) to ProjectCaseStats and ProjectChangeRequestStatsResponse component schemas.
Mapping Utilities
apps/customer-portal/backend/utils.bal
Updated mapCaseStats and mapProjectChangeRequestStatsResponse functions to map actionRequiredCount from response payloads.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested labels

Type/Improvement

Suggested reviewers

  • cloby99
  • shayanmalinda

Poem

🐰 A field for actions yet to do,
Through stats we track what users must pursue,
From types to schema, mappers align,
Count the required—let metrics shine! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description covers key sections including Purpose, Goals, Approach, and Impact, but is missing several required template sections like User stories, Release notes, Documentation, and others. Complete the missing sections from the template: User stories, Release note, Documentation, Training, Certification, Marketing, Automation tests (with test coverage details), Security checks, Samples, Related PRs, Migrations, Test environment, and Learning sections.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding an action required stat count to the customer portal backend.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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.

@suhand
suhand merged commit 052afe3 into wso2-open-operations:main Apr 23, 2026
1 check passed
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