fix: add InsightsRoutingService and refactor InsightsBookingRepository#22057
fix: add InsightsRoutingService and refactor InsightsBookingRepository#22057eunjae-lee merged 7 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
|
✅ No security or compliance issues detected. Reviewed everything up to e81c738. Security Overview
Detected Code Changes
Reply to this PR with |
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (06/26/25)1 reviewer was added to this PR based on Keith Williams's automation. |
There was a problem hiding this comment.
cubic found 2 issues across 7 files. Review them in cubic.dev
React with 👍 or 👎 to teach cubic. Tag @cubic-dev-ai to give specific feedback.
|
|
||
| export const get = async ({ ctx, input }: GetDataOptions) => { | ||
| const teamMembership = await MembershipRepository.findFirstByUserIdAndTeamId({ | ||
| const teamMembership = await MembershipRepository.findUniqueByUserIdAndTeamId({ |
There was a problem hiding this comment.
The method findUniqueByUserIdAndTeamId may not be present in MembershipRepository or may not be implemented as expected. Ensure that this method exists and is correctly implemented, as a typo or missing method could cause runtime errors.
| updater: BulkAttributeAssigner; | ||
| }) => { | ||
| const membership = await MembershipRepository.findFirstByUserIdAndTeamId({ userId, teamId: orgId }); | ||
| const membership = await MembershipRepository.findUniqueByUserIdAndTeamId({ userId, teamId: orgId }); |
There was a problem hiding this comment.
findUniqueByUserIdAndTeamId may return all columns for the membership entity. For performance and security, use a select clause to fetch only the required fields (e.g., id).
E2E results are ready! |
What does this PR do?
This PR does 2 things:
It adds
InsightsRoutingServiceIt converts
InsightsBookingRepositorytoInsightsBookingServiceas it mostly contains business logic. All the repository-like code has been moved to corresponding repositories.And so far, we don't have any specific repository-like code for Insights Booking, so we're not having InsightsBookingRepository yet. We might add it in the future.
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Passes integration tests