feat(medusa,types): added buyget support for modules (#6159)
This commit is contained in:
@@ -16,8 +16,11 @@ export interface ApplicationMethodDTO {
|
||||
allocation?: ApplicationMethodAllocationValues
|
||||
value?: string | null
|
||||
max_quantity?: number | null
|
||||
buy_rules_min_quantity?: number | null
|
||||
apply_to_quantity?: number | null
|
||||
promotion?: PromotionDTO | string
|
||||
target_rules?: PromotionRuleDTO[]
|
||||
buy_rules?: PromotionRuleDTO[]
|
||||
}
|
||||
|
||||
export interface CreateApplicationMethodDTO {
|
||||
@@ -26,8 +29,11 @@ export interface CreateApplicationMethodDTO {
|
||||
allocation?: ApplicationMethodAllocationValues
|
||||
value?: string | null
|
||||
max_quantity?: number | null
|
||||
buy_rules_min_quantity?: number | null
|
||||
apply_to_quantity?: number | null
|
||||
promotion?: PromotionDTO | string
|
||||
target_rules?: CreatePromotionRuleDTO[]
|
||||
buy_rules?: CreatePromotionRuleDTO[]
|
||||
}
|
||||
|
||||
export interface UpdateApplicationMethodDTO {
|
||||
@@ -37,6 +43,8 @@ export interface UpdateApplicationMethodDTO {
|
||||
allocation?: ApplicationMethodAllocationValues
|
||||
value?: string | null
|
||||
max_quantity?: number | null
|
||||
buy_rules_min_quantity?: number | null
|
||||
apply_to_quantity?: number | null
|
||||
promotion?: PromotionDTO | string
|
||||
}
|
||||
|
||||
|
||||
@@ -8,12 +8,12 @@ import {
|
||||
import { CampaignDTO } from "./campaign"
|
||||
import { CreatePromotionRuleDTO, PromotionRuleDTO } from "./promotion-rule"
|
||||
|
||||
export type PromotionType = "standard" | "buyget"
|
||||
export type PromotionTypeValues = "standard" | "buyget"
|
||||
|
||||
export interface PromotionDTO {
|
||||
id: string
|
||||
code?: string
|
||||
type?: PromotionType
|
||||
type?: PromotionTypeValues
|
||||
is_automatic?: boolean
|
||||
application_method?: ApplicationMethodDTO
|
||||
rules?: PromotionRuleDTO[]
|
||||
@@ -22,7 +22,7 @@ export interface PromotionDTO {
|
||||
|
||||
export interface CreatePromotionDTO {
|
||||
code: string
|
||||
type: PromotionType
|
||||
type: PromotionTypeValues
|
||||
is_automatic?: boolean
|
||||
application_method?: CreateApplicationMethodDTO
|
||||
rules?: CreatePromotionRuleDTO[]
|
||||
@@ -34,7 +34,7 @@ export interface UpdatePromotionDTO {
|
||||
id: string
|
||||
is_automatic?: boolean
|
||||
code?: string
|
||||
type?: PromotionType
|
||||
type?: PromotionTypeValues
|
||||
application_method?: UpdateApplicationMethodDTO
|
||||
campaign_id?: string
|
||||
}
|
||||
@@ -44,6 +44,6 @@ export interface FilterablePromotionProps
|
||||
id?: string[]
|
||||
code?: string[]
|
||||
is_automatic?: boolean
|
||||
type?: PromotionType[]
|
||||
type?: PromotionTypeValues[]
|
||||
budget_id?: string[]
|
||||
}
|
||||
|
||||
@@ -90,6 +90,12 @@ export interface IPromotionModuleService extends IModuleService {
|
||||
sharedContext?: Context
|
||||
): Promise<PromotionDTO>
|
||||
|
||||
addPromotionBuyRules(
|
||||
promotionId: string,
|
||||
rulesData: CreatePromotionRuleDTO[],
|
||||
sharedContext?: Context
|
||||
): Promise<PromotionDTO>
|
||||
|
||||
removePromotionRules(
|
||||
promotionId: string,
|
||||
rulesData: RemovePromotionRuleDTO[],
|
||||
@@ -102,6 +108,12 @@ export interface IPromotionModuleService extends IModuleService {
|
||||
sharedContext?: Context
|
||||
): Promise<PromotionDTO>
|
||||
|
||||
removePromotionBuyRules(
|
||||
promotionId: string,
|
||||
rulesData: RemovePromotionRuleDTO[],
|
||||
sharedContext?: Context
|
||||
): Promise<PromotionDTO>
|
||||
|
||||
createCampaigns(
|
||||
data: CreateCampaignDTO,
|
||||
sharedContext?: Context
|
||||
|
||||
Reference in New Issue
Block a user