Promotion Service Models - rettersoft/rbs-docs GitHub Wiki

SetContentInput {
    contentId: string
    promotionId: string
}
CreatePromotionInput {
    contentId?: string
    categoryId: string
    applyOnce: boolean
    discardMinCartTotal: boolean
    dontCombineOtherPromotions: boolean
    maxAmount?: number
    totalCount?: number
    usedCount?: number
    perUserCount?: number
    condition: Condition
    gifts: Gift[]
    tags?: string[]
    erpTags?: string[]
    isVisible: boolean
}
Promotion extends CreatePromotionInput {
    promotionId: string
    createdAt: number
}
Condition {
    minAmount?: number
    minPricedXthOrder?: {
        minPricedOrderCount: number
        minPrice: number
    }
    orderCount?: number
    everyXthOrder?: number
    timeExpressionCreatedAt?: string
    timeExpressionDeliveredAt?: string
    createdAfter?: number
    couponGroupId?: string
    couponCode?: string
    couponPromotion?: boolean
    products?: {
        productId: string
        qty: number
    }[]
    productCategories?: {
        categoryId: string
        minAmount: number
    }[]
    productGroups?: {
        groupId: string
        minAmount: number
        qty: number
    }[]
    brands?: {
        brandId: string
        minAmount: number
        qty: number
    }[]
    paymentMethod?: string
    paymentMethodBinNumbers?: string[]
    zones?: string[]
    segments?: string[]
    targets?: string[]
}
Gift {
    giftType: GiftType
    products?: CartItem[]
    qty?: number
    discount?: number
    price?: number
    groupId?: string
    categoryId?: string
    brandId?: string
}
enum GiftType {
    product = 'product',
    eachProduct = 'eachProduct',
    brandPercent = 'brandPercent',
    brandQty = 'brandQty',
    productGroupCheapest = 'productGroupCheapest',
    groupDiscount = 'groupDiscount',
    groupPercent = 'groupPercent',
    groupQty = 'groupQty',
    discount = 'discount',
    percentDiscount = 'percentDiscount',
    categoryDiscount = 'categoryDiscount',
    serviceFee = 'serviceFee',
    nextOrder = 'nextOrder',
}
CartItem {
    productId: string
    price: number
    taxRate: number
    qty: number
    categories: {
        categoryId: string
    }[]
    brands: {
        brandId: string
    }[]
    groups: string[]
    noDiscount: boolean
}
class ListPromotionItem {
    promotionId: string
    createdAt: number
    contentId: string
    title: string
}