Skip to content

[CSM Portal][BE] align with entity service PR #934: case type rename and nullable fields - #938

Merged
cloby99 merged 1 commit into
wso2-open-operations:v2from
Rashmika998:task/csm-portal-be-pr934-alignment
Jun 24, 2026
Merged

cloby99 merged 1 commit into
wso2-open-operations:v2from
Rashmika998:task/csm-portal-be-pr934-alignment

Conversation

@Rashmika998

@Rashmika998 Rashmika998 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Aligns the CSM portal BFF with entity service PR #934 (improve case API response consistency for ServiceNow data source).

  • Rename type enum value supportcase in CaseCreatePayload and CaseSearchFilters
  • Add type (nullable) and engagementType (nullable) fields to CaseView
  • Add catalog, catalogItem, assignedTeam, conversation as nullable EntityRef fields to CaseView
  • Mark deployment, deployedProduct, product as nullable in CaseView
  • Add type field and mark deployment, deployedProduct, product as nullable in CaseSearchView
  • Update test payload ("type":"case") and docs accordingly

Note: This branch builds on csm-portal-be-pr929-alignment and should be merged after that PR lands.

Test plan

  • go test ./... passes (verified via pre-push hook)
  • openapi.yaml updated: CaseCreatePayload.type enum, CaseSearchFilters.types enum, CaseView and CaseSearchView response schemas
  • POST /cases with "type":"case" forwards correctly

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Case creation now accepts the correct case type value, improving request validation and consistency.
    • Case-related responses and search results now include additional case metadata and handle missing related fields more gracefully.
  • Documentation

    • Updated backend and API docs to reflect the current case type requirements and response fields.

… case type rename and nullable fields

- Rename type enum value support→case in CaseCreatePayload and CaseSearchFilters
- Add type and engagementType nullable fields to CaseView
- Add catalog, catalogItem, assignedTeam, conversation nullable EntityRef fields to CaseView
- Mark deployment, deployedProduct, product as nullable in CaseView
- Add type field and mark deployment, deployedProduct, product as nullable in CaseSearchView
- Update test payload and docs to use type: "case"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR renames the case type enum value from "support" to "case" across the OpenAPI spec (CaseCreatePayload.type, CaseSearchFilters.types), the handler test fixture, and both documentation files. It also adds new nullable type and engagementType fields to CaseView, adds a nullable type field to CaseSearchView, and redefines multiple relationship properties in both views as nullable with allOf references to EntityRef.

Changes

Case Type Rename and Schema Updates

Layer / File(s) Summary
Case type enum rename: support → case
apps/csm-portal/backend/openapi.yaml, apps/csm-portal/backend/internal/handler/cases_test.go, apps/csm-portal/backend/README.md, apps/csm-portal/backend/CLAUDE.md
CaseCreatePayload.type and CaseSearchFilters.types enum values updated from "support" to "case" in the OpenAPI spec. Handler test validPayload JSON updated to match. Both README.md and CLAUDE.md docs updated to reflect the new required value.
CaseView and CaseSearchView schema extensions
apps/csm-portal/backend/openapi.yaml
CaseView gains nullable type and engagementType properties; deployment, deployedProduct, product, catalog, catalogItem, assignedTeam, and conversation relationship fields are redefined as nullable allOf EntityRef references. CaseSearchView gains a nullable type field and its deployment, deployedProduct, and product fields are similarly updated.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

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

Suggested reviewers

  • cloby99
  • shayanmalinda

Poem

🐇 A hop and a tweak, the type takes a spin,
"support" steps out, and "case" jumps in!
Nullable refs now embrace EntityRef tight,
The schemas aligned by the end of the night.
No more old labels — just "case" all the way,
This rabbit approves of the cleanups today! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description covers summary and tests, but it misses most required template sections like Purpose, Goals, Approach, Release note, and Security checks. Add the missing template sections or mark inapplicable ones clearly, including Purpose, Goals, Approach, Release note, Documentation, Security checks, and other required fields.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: renaming case type values and aligning nullable fields with the entity service.
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.

@Rashmika998 Rashmika998 self-assigned this Jun 24, 2026
@Rashmika998 Rashmika998 added Type/Improvement Marks enhancements or improvements to existing features Area/Backend App/CSM Portal labels Jun 24, 2026
rksk added a commit to rksk/os-cs-tools that referenced this pull request Jun 24, 2026
…support->case; nullable CaseView refs)

- Rename case type value 'support' -> 'case' across BeCaseType,
  BeCaseCreatePayload (POST /cases), the case-type filter (caseType.ts:
  label 'Support' -> 'Case'), and CsmCaseCreatePage. Matches the entity
  PR wso2-open-operations#934 rename.
- BeCaseView: add nullable type/engagementType and catalog/catalogItem/
  assignedTeam/conversation EntityRefs; mark deployment/deployedProduct
  nullable.
- BeCaseSearchView: add 'type'; mark deployment/deployedProduct nullable.
  Map it onto the row (caseType: c.type).

Pure contract alignment. NOTE: depends on BE PR wso2-open-operations#938 — merge this after
it, or the cases list/create will send the new 'case' value to a BE that
still expects 'support'.
@cloby99
cloby99 merged commit f115571 into wso2-open-operations:v2 Jun 24, 2026
1 check passed
rksk added a commit to rksk/os-cs-tools that referenced this pull request Jun 24, 2026
…support->case; nullable CaseView refs)

- Rename case type value 'support' -> 'case' across BeCaseType,
  BeCaseCreatePayload (POST /cases), the case-type filter (caseType.ts:
  label 'Support' -> 'Case'), and CsmCaseCreatePage. Matches the entity
  PR wso2-open-operations#934 rename.
- BeCaseView: add nullable type/engagementType and catalog/catalogItem/
  assignedTeam/conversation EntityRefs; mark deployment/deployedProduct
  nullable.
- BeCaseSearchView: add 'type'; mark deployment/deployedProduct nullable.
  Map it onto the row (caseType: c.type).

Pure contract alignment. NOTE: depends on BE PR wso2-open-operations#938 — merge this after
it, or the cases list/create will send the new 'case' value to a BE that
still expects 'support'.
cloby99 added a commit that referenced this pull request Jun 25, 2026
[CSM Portal] Operations tab + SR creation; align FE with BE #938; stop calling missing /csm/dashboard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants