Skip to content

[Customer Entity] Extend service-requests search response and add email to assignedEngineer - #905

Merged
Rashmika998 merged 3 commits into
wso2-open-operations:v2from
cloby99:task/entity-service
Jun 22, 2026
Merged

[Customer Entity] Extend service-requests search response and add email to assignedEngineer#905
Rashmika998 merged 3 commits into
wso2-open-operations:v2from
cloby99:task/entity-service

Conversation

@cloby99

@cloby99 cloby99 commented Jun 22, 2026

Copy link
Copy Markdown
Member

Summary

  • Removed conversation field from POST /service-requests/search response
  • Added email field to assignedEngineer in POST /cases/search, POST /service-requests/search, and GET /cases/{id} responses
  • Updated OpenAPI spec to reflect both changes

Summary by CodeRabbit

  • New Features
    • Engineer email addresses are now included in assigned engineer information across all API responses, enabling users to directly contact assigned engineers without additional lookups
    • Case search results now display comprehensive assigned engineer details alongside project and deployment reference information for enhanced visibility and context

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@cloby99, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 21 minutes and 7 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9b674468-3aa0-4df9-873c-d11091c0e5b0

📥 Commits

Reviewing files that changed from the base of the PR and between 24151ca and fde6721.

📒 Files selected for processing (3)
  • entity-service/internal/domain/entity.go
  • entity-service/internal/service/sn_case_service.go
  • entity-service/openapi.yaml
📝 Walkthrough

Walkthrough

Adds an optional email field to AssignedEngineerRef across the domain struct, SN case service mapping, and OpenAPI schema. Updates SearchCaseView to expose AssignedEngineer, upgrades ServiceRequestView.AssignedEngineer from *EntityRef to *AssignedEngineerRef, and removes the conversation field from ServiceRequestView and its mapping code.

Changes

AssignedEngineerRef email and conversation removal

Layer / File(s) Summary
Domain structs
entity-service/internal/domain/entity.go
AssignedEngineerRef gains Email *string; SearchCaseView gains AssignedEngineer *AssignedEngineerRef; ServiceRequestView.AssignedEngineer changes from *EntityRef to *AssignedEngineerRef and the Conversation field is removed.
OpenAPI schema
entity-service/openapi.yaml
AssignedEngineerRef schema adds nullable email property; CaseSearchView reorders and retains assignedEngineer as a $ref to AssignedEngineerRef; ServiceRequestView drops conversation and adjusts assignedEngineer.
SN internal structs and service mapping
entity-service/internal/service/sn_case_service.go
Adds snAssignedEngineerRef with ID, Name, and Email; snCase and snServiceRequestCase adopt it; GetCaseByID, SearchCases, and SearchServiceRequests now map Email into domain.AssignedEngineerRef; SearchServiceRequests removes the Conversation mapping block.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

Type/Improvement, Area/Backend

Suggested reviewers

  • suhand
  • dilshanfardil

Poem

🐇 A little email hops into the ref,
The conversation field? It's now deaf.
Engineers are known by name, ID, and mail,
Search cases see them now without fail.
Clean structs, clean YAML — what a tale! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is minimal and does not follow the template structure. It lacks critical sections including Purpose, Goals, Approach, User stories, Release note, Documentation, Training, Certification, Marketing, Testing, Security, and other required sections. Expand the description to follow the provided template, including Purpose (with issue links), Goals, Approach, User stories, Release notes, Documentation impact, and relevant testing/security information.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main changes: extending service-requests search response and adding email to assignedEngineer across multiple endpoints.
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.

@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

🧹 Nitpick comments (1)
entity-service/openapi.yaml (1)

1410-1412: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Add format: email to AssignedEngineerRef.email for schema consistency.

This keeps generated-client validation consistent with other email fields in this spec.

Suggested diff
     AssignedEngineerRef:
       type: object
       nullable: true
       properties:
         id:
           type: string
         name:
           type: string
         email:
           type: string
+          format: email
           nullable: true
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@entity-service/openapi.yaml` around lines 1410 - 1412, The
AssignedEngineerRef.email field in the OpenAPI schema is missing the format
specification that other email fields in the spec have. Add the format property
with value "email" to the email field definition (located in the type: string,
nullable: true block for AssignedEngineerRef.email) to ensure consistent
validation behavior across generated clients and align with other email field
definitions in the specification.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@entity-service/openapi.yaml`:
- Around line 1899-1909: The `conversation` field has been removed from the
`ServiceRequestView` schema in `entity-service/openapi.yaml`, but downstream
consumers like the `customer-portal` backend still define `conversation` as a
required field in their `Case` schema. Before releasing this breaking change,
identify all downstream services that consume `ServiceRequestView` responses and
update their schemas to remove or make the `conversation` field
optional/nullable to match the upstream changes. Verify that consuming services
have been deployed with these schema updates to handle responses without the
`conversation` field.

---

Nitpick comments:
In `@entity-service/openapi.yaml`:
- Around line 1410-1412: The AssignedEngineerRef.email field in the OpenAPI
schema is missing the format specification that other email fields in the spec
have. Add the format property with value "email" to the email field definition
(located in the type: string, nullable: true block for
AssignedEngineerRef.email) to ensure consistent validation behavior across
generated clients and align with other email field definitions in the
specification.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 73030772-1b53-4775-a774-d2f0aaed8897

📥 Commits

Reviewing files that changed from the base of the PR and between 60a3155 and 24151ca.

📒 Files selected for processing (3)
  • entity-service/internal/domain/entity.go
  • entity-service/internal/service/sn_case_service.go
  • entity-service/openapi.yaml

Comment thread entity-service/openapi.yaml
@Rashmika998
Rashmika998 merged commit 3ec9936 into wso2-open-operations:v2 Jun 22, 2026
1 check passed
Rashmika998 added a commit to Rashmika998/cs-tools that referenced this pull request Jun 22, 2026
…ity-service PR wso2-open-operations#905

- Add email (nullable) to AssignedEngineerRef schema
- Change ServiceRequestView.assignedEngineer ref from EntityRef to AssignedEngineerRef
- Remove conversation field from ServiceRequestView (removed upstream)
- Rename ServiceRequestSearchResponse.cases array key to serviceRequests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
v15a1 pushed a commit that referenced this pull request Jun 22, 2026
…ity-service PR #905

- Add email (nullable) to AssignedEngineerRef schema
- Change ServiceRequestView.assignedEngineer ref from EntityRef to AssignedEngineerRef
- Remove conversation field from ServiceRequestView (dropped upstream)
- Rename ServiceRequestSearchResponse.cases array key to serviceRequests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
v15a1 added a commit that referenced this pull request Jun 22, 2026
…ema-updates

[CSM Portal][BE] fix(openapi): align service-requests schema with entity-service PR #905
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants