feat(dashboard,core-flows,medusa): update fulfillment flows (#7589)
* fix: fulfillment ops * fix: cancel fulfillment route * fix: adjustInventoryLevelsStep throwing * feat: cancel order and fix endpoint * fix: type * feat: order domain sdk * feat: delete unused file * fix: import
This commit is contained in:
1 parent
da3837f2bc
commit
d285e60961
26 files changed
+296
-183
No files matched your search
@@ -8,7 +8,7 @@ import {
|
||||
MedusaResponse,
|
||||
} from "../../../../../types/routing"
|
||||
|
||||
export const GET = async (
|
||||
export const POST = async (
|
||||
req: AuthenticatedMedusaRequest,
|
||||
res: MedusaResponse
|
||||
) => {
|
||||
|
||||
+1
@@ -20,6 +20,7 @@ export const POST = async (
|
||||
const input = {
|
||||
...req.validatedBody,
|
||||
order_id: req.params.id,
|
||||
fulfillment_id: req.params.fulfillment_id,
|
||||
}
|
||||
|
||||
await cancelOrderFulfillmentWorkflow(req.scope).run({
|
||||
|
||||
@@ -12,8 +12,8 @@ export const GET = async (
|
||||
req: AuthenticatedMedusaRequest,
|
||||
res: MedusaResponse
|
||||
) => {
|
||||
const worklow = getOrderDetailWorkflow(req.scope)
|
||||
const { result } = await worklow.run({
|
||||
const workflow = getOrderDetailWorkflow(req.scope)
|
||||
const { result } = await workflow.run({
|
||||
input: {
|
||||
fields: req.remoteQueryConfig.fields,
|
||||
order_id: req.params.id,
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
AdminCompleteOrder,
|
||||
AdminGetOrdersOrderParams,
|
||||
AdminGetOrdersParams,
|
||||
AdminOrderCancelFulfillment,
|
||||
AdminOrderCreateFulfillment,
|
||||
} from "./validators"
|
||||
|
||||
@@ -78,9 +79,9 @@ export const adminOrderRoutesMiddlewares: MiddlewareRoute[] = [
|
||||
},
|
||||
{
|
||||
method: ["POST"],
|
||||
matcher: "/admin/orders/:id/fulfillments/cancel",
|
||||
matcher: "/admin/orders/:id/fulfillments/:fulfillment_id/cancel",
|
||||
middlewares: [
|
||||
// validateAndTransformBody(),
|
||||
validateAndTransformBody(AdminOrderCancelFulfillment),
|
||||
validateAndTransformQuery(
|
||||
AdminGetOrdersOrderParams,
|
||||
QueryConfig.retrieveTransformQueryConfig
|
||||
|
||||
@@ -81,7 +81,6 @@ export type AdminOrderCreateShipmentType = z.infer<
|
||||
>
|
||||
|
||||
export const AdminOrderCancelFulfillment = z.object({
|
||||
fulfillment_id: z.string(),
|
||||
no_notification: z.boolean().optional(),
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user