Skip to content

[Customer Portal][BE] Fix support stats response - #422

Merged
cloby99 merged 2 commits into
wso2-open-operations:mainfrom
Rashmika998:main
Mar 25, 2026
Merged

cloby99 merged 2 commits into
wso2-open-operations:mainfrom
Rashmika998:main

Conversation

@Rashmika998

@Rashmika998 Rashmika998 commented Mar 25, 2026 •

Copy link
Copy Markdown
Contributor

Description

  • Fix support stats response to fetch past 30 days resolved cases count and fix active count.

Summary by CodeRabbit

  • Bug Fixes / Refactor
    • Support stats API now reports resolved cases from the past 30 days instead of session chat count.
    • Active case metric simplified to use direct active counts for accuracy.
    • Removed legacy ongoing-case computation to streamline support metrics.

@coderabbitai

coderabbitai Bot commented Mar 25, 2026 •

Copy link
Copy Markdown
Contributor

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

ProjectSupportStats replaced sessionChats? with resolvedPast30DaysCasesCount?; service mapping now uses caseStats.activeCount and maps resolvedPast30DaysCasesCount from caseStats.resolvedCount.pastThirtyDays; the helper getOngoingCasesCount was removed.

Changes

Cohort / File(s) Summary
Type Definition
apps/customer-portal/backend/modules/types/types.bal
Removed sessionChats?; added resolvedPast30DaysCasesCount? to ProjectSupportStats.
Service Response Mapping
apps/customer-portal/backend/service.bal
Replaced getOngoingCasesCount(...) usage with caseStats.activeCount; removed sessionChats mapping and added resolvedPast30DaysCasesCount sourced from caseStats.resolvedCount.pastThirtyDays.
Utility Cleanup
apps/customer-portal/backend/utils.bal
Deleted public isolated function `getOngoingCasesCount(entity: ProjectCaseStatsResponse

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

Type/Improvement

Suggested reviewers

  • cloby99
  • shayanmalinda

Poem

🐰 I hopped through types and service trails,
Swapped old session counts for thirty-day tales,
Removed a helper that once tallied woes,
Now activeCount leads where the data flows,
Hooray for tidy stats — nibble of code, tonight we toast!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description lacks critical required sections. It only contains a brief description statement, omitting Purpose, Goals, Approach, and other mandatory sections from the template. Add missing sections from the template: Purpose with issue links, Goals explaining the fix objectives, Approach describing implementation details, and other required sections like Release notes and Documentation impact.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title '[Customer Portal][BE] Fix support stats response' clearly and specifically summarizes the main change: fixing the support stats response in the Customer Portal backend.
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.

@Rashmika998
Rashmika998 requested a review from cloby99 March 25, 2026 10:40
Comment thread apps/customer-portal/backend/modules/types/types.bal Outdated
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