feat(dashboard,core-flows,types,order): change order accepts price updates (#9476)
* chore: change order can accept price updates * chore: add changes to transformed order * chore: fix transform * chore: transform raw unit price
This commit is contained in:
@@ -155,6 +155,9 @@ export const confirmOrderEditRequestWorkflow = createWorkflow(
|
||||
let quantity: BigNumberInput =
|
||||
itemAction.raw_quantity ?? itemAction.quantity
|
||||
|
||||
let unit_price: BigNumberInput =
|
||||
itemAction.raw_unit_price ?? itemAction.unit_price
|
||||
|
||||
const updateAction = itemAction.actions!.find(
|
||||
(a) => a.action === ChangeActionType.ITEM_UPDATE
|
||||
)
|
||||
@@ -169,6 +172,7 @@ export const confirmOrderEditRequestWorkflow = createWorkflow(
|
||||
id: ordItem.id,
|
||||
variant_id: ordItem.variant_id,
|
||||
quantity,
|
||||
unit_price,
|
||||
})
|
||||
allVariants.push(ordItem.variant)
|
||||
})
|
||||
|
||||
@@ -84,6 +84,7 @@ export const orderEditUpdateItemQuantityWorkflow = createWorkflow(
|
||||
details: {
|
||||
reference_id: item.id,
|
||||
quantity: item.quantity,
|
||||
unit_price: item.unit_price,
|
||||
},
|
||||
}))
|
||||
}
|
||||
|
||||
@@ -104,6 +104,7 @@ export const updateOrderEditAddItemWorkflow = createWorkflow(
|
||||
id: input.action_id,
|
||||
details: {
|
||||
quantity: data.quantity ?? originalAction.details?.quantity,
|
||||
unit_price: data.unit_price ?? originalAction.details?.unit_price,
|
||||
},
|
||||
internal_note: data.internal_note,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user