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)
|
||||
})
|
||||
|
||||
+1
@@ -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,
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ interface NewItem {
|
||||
interface ExistingItem {
|
||||
id: string
|
||||
quantity: BigNumberInput
|
||||
unit_price?: BigNumberInput
|
||||
internal_note?: string | null
|
||||
}
|
||||
|
||||
@@ -59,6 +60,7 @@ export interface UpdateOrderEditAddNewItemWorkflowInput {
|
||||
action_id: string
|
||||
data: {
|
||||
quantity?: BigNumberInput
|
||||
unit_price?: BigNumberInput
|
||||
internal_note?: string | null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { DmlEntity, toMikroOrmEntities } from "../dml"
|
||||
import { CustomTsMigrationGenerator } from "../dal"
|
||||
import type {
|
||||
AnyEntity,
|
||||
EntityClass,
|
||||
EntityClassGroup,
|
||||
EntitySchema,
|
||||
MikroORMOptions,
|
||||
EntityClassGroup,
|
||||
} from "@mikro-orm/core"
|
||||
import { kebabCase } from "../common"
|
||||
import { CustomTsMigrationGenerator } from "../dal"
|
||||
import { DmlEntity, toMikroOrmEntities } from "../dml"
|
||||
|
||||
type Options = Partial<Omit<MikroORMOptions, "entities" | "entitiesTs">> & {
|
||||
entities: (
|
||||
|
||||
Reference in New Issue
Block a user