Skip to content

Added changes for new AcademicYear#749

Open
abhaykalshetti-gif wants to merge 6 commits into
tekdi:sdbv_rbac_changesfrom
abhaykalshetti-gif:scp-academicYear3
Open

Added changes for new AcademicYear#749
abhaykalshetti-gif wants to merge 6 commits into
tekdi:sdbv_rbac_changesfrom
abhaykalshetti-gif:scp-academicYear3

Conversation

@abhaykalshetti-gif
Copy link
Copy Markdown

For creating he new AcademicYear changed added the updatedBY field addition when the acadmicYear in inactivated
Added the kafka pulish Event for cohortAcademicYear for created event

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 25, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (7)
  • master
  • main
  • dev
  • feat/*
  • feat-*
  • release-*
  • Shiksha-2.0

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2f60a4a8-e6eb-4d8b-a716-612160a4ccce

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ 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.

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
29.0% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces Kafka event publishing for cohort academic years and cohort members, refines variable naming for consistency, and updates academic year deactivation to include audit metadata. The review feedback highlights an inconsistency in the Kafka event publishing mechanism, recommending the use of an internal wrapper to ensure schema uniformity, and notes a deviation from standard logging patterns in error handling.

Comment on lines +585 to +591
this.kafkaService.publishCohortMemberEvent('created', enrichedData, enrichedData.cohortMembershipId).catch(error => {
LoggerUtil.error(
`Failed to publish cohort member created event to Kafka`,
`Error: ${error.message}`,
enrichedData.cohortAcademicYearId
)
})
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Inconsistent Kafka event publishing. In createCohortMembers, you are calling this.kafkaService.publishCohortMemberEvent directly, whereas in updateCohortMembers (line 792), you use the internal wrapper this.publishCohortMemberEvent. The internal wrapper is designed to enrich the event payload with custom fields (like subject, fees, etc.). Bypassing it here means the 'created' event will have a different schema and less data than the 'updated' event, which can cause issues for downstream consumers.

Suggested change
this.kafkaService.publishCohortMemberEvent('created', enrichedData, enrichedData.cohortMembershipId).catch(error => {
LoggerUtil.error(
`Failed to publish cohort member created event to Kafka`,
`Error: ${error.message}`,
enrichedData.cohortAcademicYearId
)
})
this.publishCohortMemberEvent('created', savedCohortMember, apiId).catch(error => {
LoggerUtil.error(
`Failed to publish cohort member created event to Kafka`,
`Error: ${error.message}`,
apiId
)
})

Comment on lines +586 to +590
LoggerUtil.error(
`Failed to publish cohort member created event to Kafka`,
`Error: ${error.message}`,
enrichedData.cohortAcademicYearId
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The LoggerUtil.error call in the catch block is inconsistent with the rest of the file. Usually, apiId is passed as the third argument (context) to allow for better log tracing and filtering. Using enrichedData.cohortAcademicYearId as the context here deviates from that pattern.

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.

1 participant