refactor: migrate promotion module (#10410)

This commit is contained in:
Harminder Virk
2024-12-11 13:12:39 +05:30
committed by GitHub
parent 777582ac43
commit fad85a9d29
22 changed files with 682 additions and 745 deletions

View File

@@ -9,6 +9,7 @@ import {
MedusaError,
PromotionType,
} from "@medusajs/framework/utils"
import { InferEntityType } from "@medusajs/types"
import { Promotion } from "@models"
import { CreateApplicationMethodDTO, UpdateApplicationMethodDTO } from "@types"
@@ -28,7 +29,7 @@ export const allowedAllocationForQuantity: string[] = [
export function validateApplicationMethodAttributes(
data: UpdateApplicationMethodDTO | CreateApplicationMethodDTO,
promotion: Promotion
promotion: InferEntityType<typeof Promotion>
) {
const applicationMethod = promotion?.application_method || {}
const buyRulesMinQuantity =