-
Notifications
You must be signed in to change notification settings - Fork 9.4k
feat: Add rerouting
to AssignmentReasonRecorder
#19252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (02/12/25)1 reviewer was added to this PR based on Keith Williams's automation. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
@@ -467,6 +469,7 @@ const NewRoutingManager = ({ | |||
// TODO: Long term, we should refactor handleNewBooking and use a different route specific for this purpose, | |||
createBookingMutation.mutate({ | |||
rescheduleUid: booking.uid, | |||
rescheduledBy: session?.data?.user?.email, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to track who is calling the reroute
isRerouting, | ||
reroutedByEmail, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can reuse the logic that we use when recording the initial routing. That way we can see what attributes changed.
E2E results are ready! |
This PR is being marked as stale due to inactivity. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy with this, LGTM
This PR is being marked as stale due to inactivity. |
@@ -469,6 +471,7 @@ const NewRoutingManager = ({ | |||
// TODO: Long term, we should refactor handleNewBooking and use a different route specific for this purpose, | |||
createBookingMutation.mutate({ | |||
rescheduleUid: booking.uid, | |||
rescheduledBy: session?.data?.user?.email ?? undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we error early if session is nullish, because rerouting can't be done by a non-logged in user.
Doing this change make it feel like non-logged in user could do re-routing
const userQuery = await prisma.user.findFirst({ | ||
where: { | ||
email: reroutedByEmail, | ||
}, | ||
select: { | ||
id: true, | ||
}, | ||
}); | ||
|
||
if (userQuery) { | ||
reroutedByUserId = userQuery.id; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use UserRepository
reasonString: attributeValues.join(", "), | ||
reasonEnum: isRerouting ? AssignmentReasonEnum.REROUTED : AssignmentReasonEnum.ROUTING_FORM_ROUTING, | ||
reasonString: `${ | ||
reroutedByUserId ? `Rerouted by user: ${reroutedByUserId}` : "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this reason would be shown to users, so maybe we should show the email here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments, overall looks good.
Also, CI is failing a lot of checks
What does this PR do?
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?