-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
feat: Admin Returns API #8117
feat: Admin Returns API #8117
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
6 Skipped Deployments
|
|
The PR needs a lot of clean-up of types, return values, more tests and others. Please keep the review isolated to the flow of events. I'll clean it up as soon as we've got the workflows in place. Aside from the flow of events, there are two larger elements to also discuss:
Let me know what you think. |
For this one, I could port over what we have in |
changes: OrderChangeDTO[] | ||
} | ||
|
||
export const confirmOrderChanges = createStep( |
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.
comment: Can be "bulkified"
returnId: string | ||
} | ||
|
||
export const createReturnItems = createStep( |
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.
comment: Can be "bulkified"
packages/core/core-flows/src/order/workflows/confirm-return-request.ts
Outdated
Show resolved
Hide resolved
packages/core/core-flows/src/order/workflows/confirm-return-request.ts
Outdated
Show resolved
Hide resolved
/snapshot-this |
🚀 A snapshot release has been made for this PRTest the snapshots by updating your yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add [email protected] yarn add @medusajs/[email protected] yarn add [email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add [email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add [email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected]
|
|
||
const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY) | ||
|
||
await requestItemReturnWorkflow(req.scope).run({ |
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.
I believe we should return the result
of this workflow, which will be the preview of the Order after the change actions are applied.
Same for the shipping-method
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.
Do you think we will need anything but the totals preview in the FE?
Was just discussing the response with Seb, and we thought of doing:
res.status(200).json({ return: orderReturn, total_summary: result.summary })
...provided the result
here is the order preview.
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.
Do you think we will need anything but the totals preview in the FE?
Was just discussing the response with Seb, and we thought of doing:
res.status(200).json({ return: orderReturn, total_summary: result.summary })
...provided the result
here is the order preview.
location_id?: string | ||
description?: string | ||
internal_note?: string |
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.
discussion: we would need to send this info when we confirm a return request right? When we initiate a return request we don't know this info yet and later we can't update this fields.
EDIT: or we add a general update return request endpoint which would update note, location etc.?
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.
Yes, that's right – it will be send with the confirmation request. Also just discussed the return reasons with Seb. We will move these from the return level to the return item level, as we also talked about this morning. This is pending design.
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 add a general update return request endpoint which would update note, location etc.?
Yeah, that's also possible. We will have the following endpoint:
POST /admin/returns/:id
{ location_id?, no_notification?, metadata? }
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.
Good point.
And based on the message displayed when the location selected doesn't have stock associated with that location, maybe we need an extra endpoint to update the return location and return the result of this stock location check.
@fPolic @carlos-r-l-rodrigues, would it make sense to merge this and address the rest in follow up PRs? |
sounds good 👍 |
Opening to solicit feedback
What
Adds
POST /admin/returns/:id/request-items
POST /admin/returns/:id/shipping-method
POST /admin/returns/:id/request