feat(core-flows,medusa,types,utils): add rules to promotion endpoints + workflow (#6692)
* feat(core-flows,medusa,types,utils): add rules to promotion endpoints + workflow * chore: fix specs * chore: move input type to types package
This commit is contained in:
@@ -38,3 +38,5 @@ export interface FilterablePromotionRuleProps
|
||||
id?: string[]
|
||||
code?: string[]
|
||||
}
|
||||
|
||||
export type PromotionRuleTypes = "buy_rules" | "target_rules" | "rules"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
export * from "./common"
|
||||
export * from "./mutations"
|
||||
export * from "./service"
|
||||
export * from "./workflows"
|
||||
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
FilterableCampaignProps,
|
||||
FilterablePromotionProps,
|
||||
PromotionDTO,
|
||||
PromotionRuleDTO,
|
||||
RemovePromotionRuleDTO,
|
||||
UpdatePromotionDTO,
|
||||
} from "./common"
|
||||
@@ -82,37 +83,37 @@ export interface IPromotionModuleService extends IModuleService {
|
||||
promotionId: string,
|
||||
rulesData: CreatePromotionRuleDTO[],
|
||||
sharedContext?: Context
|
||||
): Promise<PromotionDTO>
|
||||
): Promise<PromotionRuleDTO[]>
|
||||
|
||||
addPromotionTargetRules(
|
||||
promotionId: string,
|
||||
rulesData: CreatePromotionRuleDTO[],
|
||||
sharedContext?: Context
|
||||
): Promise<PromotionDTO>
|
||||
): Promise<PromotionRuleDTO[]>
|
||||
|
||||
addPromotionBuyRules(
|
||||
promotionId: string,
|
||||
rulesData: CreatePromotionRuleDTO[],
|
||||
sharedContext?: Context
|
||||
): Promise<PromotionDTO>
|
||||
): Promise<PromotionRuleDTO[]>
|
||||
|
||||
removePromotionRules(
|
||||
promotionId: string,
|
||||
rulesData: RemovePromotionRuleDTO[],
|
||||
sharedContext?: Context
|
||||
): Promise<PromotionDTO>
|
||||
): Promise<void>
|
||||
|
||||
removePromotionTargetRules(
|
||||
promotionId: string,
|
||||
rulesData: RemovePromotionRuleDTO[],
|
||||
sharedContext?: Context
|
||||
): Promise<PromotionDTO>
|
||||
): Promise<void>
|
||||
|
||||
removePromotionBuyRules(
|
||||
promotionId: string,
|
||||
rulesData: RemovePromotionRuleDTO[],
|
||||
sharedContext?: Context
|
||||
): Promise<PromotionDTO>
|
||||
): Promise<void>
|
||||
|
||||
createCampaigns(
|
||||
data: CreateCampaignDTO,
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import { CreatePromotionRuleDTO, PromotionRuleTypes } from "./common"
|
||||
|
||||
export type AddPromotionRulesWorkflowDTO = {
|
||||
rule_type: PromotionRuleTypes
|
||||
data: {
|
||||
id: string
|
||||
rules: CreatePromotionRuleDTO[]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user