Skip to content

Sdbv rbac changes#660

Merged
Shubham4026 merged 2 commits intomainfrom
sdbv_rbac_changes
Feb 23, 2026
Merged

Sdbv rbac changes#660
Shubham4026 merged 2 commits intomainfrom
sdbv_rbac_changes

Conversation

@Shubham4026
Copy link
Collaborator

@Shubham4026 Shubham4026 commented Feb 23, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Improved metadata propagation when updating custom fields in cohorts and cohort members, ensuring consistent data tracking across field updates.

@Shubham4026 Shubham4026 merged commit 46131b2 into main Feb 23, 2026
1 check failed
@coderabbitai
Copy link

coderabbitai bot commented Feb 23, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 3a3184f and f533617.

📒 Files selected for processing (2)
  • src/cohort/cohort.service.ts
  • src/cohortMembers/cohortMembers.service.ts

Walkthrough

The changes extend custom field update handling in two services to propagate metadata through the field update flow. CohortService.updateCohort now constructs an additionalData object containing tenant and user information, passing it to updateCustomFields. CohortMembersService similarly enhances its field processing pipeline to fetch cohort details, build metadata, and thread it through custom field registration and updates, including handling for missing cohort scenarios.

Changes

Cohort / File(s) Summary
CohortService Custom Field Updates
src/cohort/cohort.service.ts
Added additionalData object construction (tenantId, contextType, createdBy, updatedBy) from existing cohort details and passed it as fourth parameter to FieldsService.updateCustomFields for metadata propagation during custom field updates.
CohortMembersService Field Processing Pipeline
src/cohortMembers/cohortMembers.service.ts
Updated method signatures for registerFieldValue and processCustomFields to accept optional/required additionalData parameter; added cohort detail fetching after member updates with 404 error handling; threaded metadata through custom field registration and update flow; aligned update path to pass null and additionalData to updateCustomFields.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant CohortService
    participant CohortMembersService
    participant FieldsService

    Client->>CohortService: updateCohort(data)
    CohortService->>CohortService: extractAdditionalData(tenantId, contextType, createdBy, updatedBy)
    CohortService->>FieldsService: updateCustomFields(cohortId, fieldData, attributes, additionalData)
    FieldsService-->>CohortService: success

    Client->>CohortMembersService: updateCohortMember(memberData)
    CohortMembersService->>CohortMembersService: fetch cohort details
    CohortMembersService->>CohortMembersService: constructAdditionalData(tenantId, COHORTMEMBER, createdBy, updatedBy)
    CohortMembersService->>CohortMembersService: processCustomFields(fields, additionalData)
    CohortMembersService->>CohortMembersService: registerFieldValue(fieldId, value, additionalData)
    CohortMembersService->>FieldsService: updateCustomFields(memberId, fieldData, additionalData)
    FieldsService-->>CohortMembersService: success
    CohortMembersService-->>Client: member updated
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sdbv_rbac_changes

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.

@sonarqubecloud
Copy link

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