Chore/rm main entity concept (#7709)
**What** Update the `MedusaService` class, factory and types to remove the concept of main modules. The idea being that all method will be explicitly named and suffixes to represent the object you are trying to manipulate. This pr also includes various fixes in different modules Co-authored-by: Stevche Radevski <4820812+sradevski@users.noreply.github.com> Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
2895ccfba8
commit
48963f55ef
@@ -28,7 +28,7 @@ medusaIntegrationTestRunner({
|
||||
Modules.PRODUCT
|
||||
] as unknown as IProductModuleService
|
||||
|
||||
const productList = await product.list()
|
||||
const productList = await product.listProducts()
|
||||
|
||||
expect(productList).toEqual(expect.arrayContaining([]))
|
||||
})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ModuleRegistrationName, Modules } from "@medusajs/modules-sdk"
|
||||
import { IPaymentModuleService, IRegionModuleService } from "@medusajs/types"
|
||||
import { IRegionModuleService } from "@medusajs/types"
|
||||
import { ContainerRegistrationKeys } from "@medusajs/utils"
|
||||
import { medusaIntegrationTestRunner } from "medusa-test-utils"
|
||||
import { createAdminUser } from "../../..//helpers/create-admin-user"
|
||||
@@ -15,14 +15,12 @@ medusaIntegrationTestRunner({
|
||||
describe("Remote Query", () => {
|
||||
let appContainer
|
||||
let regionModule: IRegionModuleService
|
||||
let paymentModule: IPaymentModuleService
|
||||
let remoteQuery
|
||||
let remoteLink
|
||||
|
||||
beforeAll(async () => {
|
||||
appContainer = getContainer()
|
||||
regionModule = appContainer.resolve(ModuleRegistrationName.REGION)
|
||||
paymentModule = appContainer.resolve(ModuleRegistrationName.PAYMENT)
|
||||
remoteQuery = appContainer.resolve(
|
||||
ContainerRegistrationKeys.REMOTE_QUERY
|
||||
)
|
||||
@@ -34,7 +32,7 @@ medusaIntegrationTestRunner({
|
||||
})
|
||||
|
||||
it("should fail to retrieve a single non-existing id", async () => {
|
||||
const region = await regionModule.create({
|
||||
const region = await regionModule.createRegions({
|
||||
name: "Test Region",
|
||||
currency_code: "usd",
|
||||
countries: ["us"],
|
||||
@@ -75,19 +73,19 @@ medusaIntegrationTestRunner({
|
||||
})
|
||||
|
||||
it("should fail if a expected relation is not found", async () => {
|
||||
const region = await regionModule.create({
|
||||
const region = await regionModule.createRegions({
|
||||
name: "Test Region",
|
||||
currency_code: "usd",
|
||||
countries: ["us"],
|
||||
})
|
||||
|
||||
const regionWithPayment = await regionModule.create({
|
||||
const regionWithPayment = await regionModule.createRegions({
|
||||
name: "Test W/ Payment",
|
||||
currency_code: "brl",
|
||||
countries: ["br"],
|
||||
})
|
||||
|
||||
const regionNoLink = await regionModule.create({
|
||||
const regionNoLink = await regionModule.createRegions({
|
||||
name: "No link",
|
||||
currency_code: "eur",
|
||||
countries: ["dk"],
|
||||
|
||||
Reference in New Issue
Block a user