feat(promotion,dashboard,types,utils,medusa): Add statuses to promotions (#10950)
what: - adds a status column to promotion table - introduce active promotion query - scope revert, register and compute actions to active promotions - admin to create and update promotion with statuses RESOLVES CMRC-845 RESOLVES CMRC-846 RESOLVES CMRC-847 RESOLVES CMRC-848 RESOLVES CMRC-849 RESOLVES CMRC-850
This commit is contained in:
@@ -3,7 +3,11 @@ import {
|
||||
IPromotionModuleService,
|
||||
PromotionDTO,
|
||||
} from "@medusajs/framework/types"
|
||||
import { isPresent, toMikroORMEntity } from "@medusajs/framework/utils"
|
||||
import {
|
||||
isPresent,
|
||||
PromotionStatus,
|
||||
toMikroORMEntity,
|
||||
} from "@medusajs/framework/utils"
|
||||
import { SqlEntityManager } from "@mikro-orm/postgresql"
|
||||
import { Promotion } from "@models"
|
||||
import { defaultPromotionsData } from "./data"
|
||||
@@ -51,6 +55,7 @@ export async function createDefaultPromotion(
|
||||
return await service.createPromotions({
|
||||
code: "PROMOTION_TEST",
|
||||
type: "standard",
|
||||
status: PromotionStatus.ACTIVE,
|
||||
campaign_id: "campaign-id-1",
|
||||
...promotion,
|
||||
application_method: {
|
||||
|
||||
Reference in New Issue
Block a user