feat(types): promotion module uses big number (#6522)

what: 

- promotion modules (application method and campaign budget) uses big number fields instead of numeric fields
- refreshes the migrations to include new fields for big numbers
- adds a promotion_ prefix to promotion models
- uses `take: null` within the module to prevent the default pagination on performing actions within the module
This commit is contained in:
Riqwan Thamir
2024-02-28 17:27:43 +05:30
committed by GitHub
parent a6d7070dd6
commit 0d46abf0ff
17 changed files with 343 additions and 259 deletions

View File

@@ -1,13 +1,13 @@
import { initDb, useDb } from "../../../../environment-helpers/use-db"
import { CampaignBudgetType } from "@medusajs/utils"
import { IPromotionModuleService } from "@medusajs/types"
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
import { createAdminUser } from "../../../helpers/create-admin-user"
import { getContainer } from "../../../../environment-helpers/use-container"
import { IPromotionModuleService } from "@medusajs/types"
import { CampaignBudgetType } from "@medusajs/utils"
import path from "path"
import { startBootstrapApp } from "../../../../environment-helpers/bootstrap-app"
import { useApi } from "../../../../environment-helpers/use-api"
import { getContainer } from "../../../../environment-helpers/use-container"
import { createAdminUser } from "../../../helpers/create-admin-user"
jest.setTimeout(50000)
@@ -101,6 +101,14 @@ describe("GET /admin/campaigns", () => {
type: "spend",
limit: 1000,
used: 0,
raw_limit: {
precision: 20,
value: "1000",
},
raw_used: {
precision: 20,
value: "0",
},
created_at: expect.any(String),
updated_at: expect.any(String),
deleted_at: null,
@@ -123,6 +131,14 @@ describe("GET /admin/campaigns", () => {
type: "usage",
limit: 1000,
used: 0,
raw_limit: {
precision: 20,
value: "1000",
},
raw_used: {
precision: 20,
value: "0",
},
created_at: expect.any(String),
updated_at: expect.any(String),
deleted_at: null,

View File

@@ -1,13 +1,13 @@
import { initDb, useDb } from "../../../../environment-helpers/use-db"
import { CampaignBudgetType } from "@medusajs/utils"
import { IPromotionModuleService } from "@medusajs/types"
import { ModuleRegistrationName } from "@medusajs/modules-sdk"
import { createAdminUser } from "../../../helpers/create-admin-user"
import { getContainer } from "../../../../environment-helpers/use-container"
import { IPromotionModuleService } from "@medusajs/types"
import { CampaignBudgetType } from "@medusajs/utils"
import path from "path"
import { startBootstrapApp } from "../../../../environment-helpers/bootstrap-app"
import { useApi } from "../../../../environment-helpers/use-api"
import { getContainer } from "../../../../environment-helpers/use-container"
import { createAdminUser } from "../../../helpers/create-admin-user"
jest.setTimeout(50000)
@@ -102,6 +102,14 @@ describe("GET /admin/campaigns", () => {
campaign: expect.any(Object),
type: "spend",
limit: 1000,
raw_limit: {
precision: 20,
value: "1000",
},
raw_used: {
precision: 20,
value: "0",
},
used: 0,
created_at: expect.any(String),
updated_at: expect.any(String),