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:
Riqwan Thamir
2024-10-07 10:54:21 +02:00
committed by GitHub
parent 781d0ca624
commit 2d1f4bcabc
15 changed files with 81 additions and 12 deletions

View File

@@ -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)
})

View File

@@ -84,6 +84,7 @@ export const orderEditUpdateItemQuantityWorkflow = createWorkflow(
details: {
reference_id: item.id,
quantity: item.quantity,
unit_price: item.unit_price,
},
}))
}

View File

@@ -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,
}