Raw
1 import { ChangeActionType, MedusaError } from "@medusajs/framework/utils"
2 import { OrderChangeProcessing } from "../calculate-order-change"
3
4 OrderChangeProcessing.registerActionType(ChangeActionType.PROMOTION_REMOVE, {
5 operation({ action, currentOrder, options }) {
6 // no-op
7 },
8 validate({ action }) {
9 if (!action.reference_id) {
10 throw new MedusaError(
11 MedusaError.Types.INVALID_DATA,
12 "Reference ID is required."
13 )
14 }
15 },
16 })