Skip to content

Conversation

@jmgasper
Copy link
Collaborator

@jmgasper jmgasper commented Nov 1, 2025

No description provided.

},
};

const scorecardById = await this.prisma.scorecard.findUnique({
Copy link

Choose a reason for hiding this comment

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

[⚠️ maintainability]
Consider using findUniqueOrThrow instead of findUnique for scorecardById to automatically throw an error if the scorecard is not found. This would simplify the logic by removing the need for the subsequent if (scorecardById) check.

return scorecardById as ScorecardWithGroupResponseDto;
}

const scorecardByLegacyId = await this.prisma.scorecard.findFirst({
Copy link

Choose a reason for hiding this comment

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

[❗❗ correctness]
The use of findFirst for scorecardByLegacyId could potentially return an incorrect scorecard if multiple scorecards have the same legacyId. Ensure that legacyId is unique or adjust the logic to handle multiple matches appropriately.

@jmgasper jmgasper merged commit 26d7ffb into develop Nov 1, 2025
5 checks passed
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