feat(core-flows,dashboard,medusa): ability to add and remove items to claim inbound (#8480)

* wip: setup UI

* wip: rendering modal, adding claim items, create checks

* fix: make form work after merge

* fix: continuation of claim edit

* chore: ability to add and remove items to claim inbound

* chore: minor fixes

---------

Co-authored-by: fPolic <mainacc.polic@gmail.com>
This commit is contained in:
Riqwan Thamir
2024-08-07 15:27:04 +02:00
committed by GitHub
parent 17567b9f0a
commit eb590417be
11 changed files with 140 additions and 113 deletions
@@ -86,8 +86,8 @@ export const orderClaimRequestItemReturnWorkflow = createWorkflow(
})
const orderReturn: ReturnDTO = transform(
{ createdReturn, existingOrderReturn, orderClaim },
({ createdReturn, existingOrderReturn, orderClaim }) => {
{ createdReturn, existingOrderReturn },
({ createdReturn, existingOrderReturn }) => {
return existingOrderReturn ?? (createdReturn?.[0] as ReturnDTO)
}
)
@@ -102,7 +102,7 @@ export const orderClaimRequestItemReturnWorkflow = createWorkflow(
const orderChange: OrderChangeDTO = useRemoteQueryStep({
entry_point: "order_change",
fields: ["id", "status"],
fields: ["id", "status", "canceled_at", "confirmed_at", "declined_at"],
variables: {
filters: {
order_id: orderClaim.order_id,
@@ -113,7 +113,6 @@ export const orderClaimRequestItemReturnWorkflow = createWorkflow(
list: false,
}).config({
name: "order-change-query",
status: [OrderChangeStatus.PENDING, OrderChangeStatus.REQUESTED],
})
validationStep({
@@ -6,7 +6,6 @@ import {
} from "@medusajs/types"
import { ChangeActionType, OrderChangeStatus } from "@medusajs/utils"
import {
WorkflowData,
WorkflowResponse,
createStep,
createWorkflow,
@@ -79,7 +79,17 @@ export const removeItemReturnActionWorkflow = createWorkflow(
const orderChange: OrderChangeDTO = useRemoteQueryStep({
entry_point: "order_change",
fields: ["id", "status", "version", "actions.*"],
fields: [
"id",
"status",
"version",
"return_id",
"order_id",
"actions.*",
"canceled_at",
"confirmed_at",
"declined_at",
],
variables: {
filters: {
order_id: orderReturn.order_id,