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:
co-authored by
Stevche Radevski
Oli Juhl
parent
2895ccfba8
commit
48963f55ef
@@ -31,7 +31,7 @@ medusaIntegrationTestRunner({
|
||||
const fulfillmentModule: IFulfillmentModuleService =
|
||||
getContainer().resolve(ModuleRegistrationName.FULFILLMENT)
|
||||
|
||||
fulfillmentSet1 = await fulfillmentModule.create({
|
||||
fulfillmentSet1 = await fulfillmentModule.createFulfillmentSets({
|
||||
name: "Test fulfillment set",
|
||||
type: "pickup",
|
||||
})
|
||||
|
||||
@@ -91,10 +91,10 @@ medusaIntegrationTestRunner({
|
||||
const defaultId = (await api.get("/admin/stores", adminHeaders)).data
|
||||
.stores?.[0]?.id
|
||||
if (defaultId) {
|
||||
storeModule.delete(defaultId)
|
||||
storeModule.deleteStores(defaultId)
|
||||
}
|
||||
|
||||
store = await storeModule.create({
|
||||
store = await storeModule.createStores({
|
||||
name: "New store",
|
||||
supported_currency_codes: ["usd", "dkk"],
|
||||
default_currency_code: "usd",
|
||||
@@ -532,13 +532,13 @@ medusaIntegrationTestRunner({
|
||||
)
|
||||
|
||||
const service = appContainer.resolve(ModuleRegistrationName.STORE)
|
||||
const [store] = await service.list()
|
||||
const [store] = await service.listStores()
|
||||
|
||||
if (store) {
|
||||
await service.delete(store.id)
|
||||
await service.deleteStores(store.id)
|
||||
}
|
||||
|
||||
await service.create({
|
||||
await service.createStores({
|
||||
supported_currency_codes: ["usd", "dkk"],
|
||||
default_currency_code: "usd",
|
||||
default_sales_channel_id: defaultSalesChannel.id,
|
||||
@@ -969,13 +969,13 @@ medusaIntegrationTestRunner({
|
||||
)
|
||||
|
||||
const service = appContainer.resolve(ModuleRegistrationName.STORE)
|
||||
const [store] = await service.list()
|
||||
const [store] = await service.listStores()
|
||||
|
||||
if (store) {
|
||||
await service.delete(store.id)
|
||||
await service.deleteStores(store.id)
|
||||
}
|
||||
|
||||
await service.create({
|
||||
await service.createStores({
|
||||
supported_currency_codes: ["usd", "dkk"],
|
||||
default_currency_code: "usd",
|
||||
default_sales_channel_id: defaultSalesChannel.id,
|
||||
|
||||
@@ -301,7 +301,7 @@ medusaIntegrationTestRunner({
|
||||
const fulfillmentModule = getContainer().resolve(
|
||||
ModuleRegistrationName.FULFILLMENT
|
||||
)
|
||||
const sets = await fulfillmentModule.list()
|
||||
const sets = await fulfillmentModule.listFulfillmentSets()
|
||||
expect(sets).toHaveLength(0)
|
||||
})
|
||||
|
||||
|
||||
@@ -25,10 +25,10 @@ medusaIntegrationTestRunner({
|
||||
const defaultId = (await api.get("/admin/stores", adminHeaders)).data
|
||||
.stores?.[0]?.id
|
||||
if (defaultId) {
|
||||
storeModule.delete(defaultId)
|
||||
await storeModule.deleteStores(defaultId)
|
||||
}
|
||||
|
||||
store = await storeModule.create({
|
||||
store = await storeModule.createStores({
|
||||
name: "New store",
|
||||
supported_currency_codes: ["usd", "dkk"],
|
||||
default_currency_code: "usd",
|
||||
|
||||
Reference in New Issue
Block a user