feat(fulfillment): implementation part 2 (#6408)
**What**
> [!NOTE]
> I can see this pr becoming huge, so I d like to get this partial one merged 👍
- Fixes shared connection usage (mikro orm compare the instance to its own package and therefore was resulting in not trully reusing the provided connection leading to exhausting the connection pool as multiple connections was created and end up not being all destroyed properly under the hood, discovered in my integration tests)
- Create shipping options method implementation
- DTO's definition and service interface update
- integration tests
- Re work of the indexes with new util update
- Test runner utils to remove a big chunk of the boilerplate of the packages integrations
FIXES CORE-1742
This commit is contained in:
@@ -1 +0,0 @@
|
||||
// noop
|
||||
+1416
-1153
File diff suppressed because it is too large
Load Diff
@@ -1,6 +0,0 @@
|
||||
if (typeof process.env.DB_TEMP_NAME === "undefined") {
|
||||
const tempName = parseInt(process.env.JEST_WORKER_ID || "1")
|
||||
process.env.DB_TEMP_NAME = `medusa-fulfillment-integration-${tempName}`
|
||||
}
|
||||
|
||||
process.env.MEDUSA_FULFILLMENT_DB_SCHEMA = "public"
|
||||
@@ -1,3 +0,0 @@
|
||||
import { JestUtils } from "medusa-test-utils"
|
||||
|
||||
JestUtils.afterAllHookDropDatabase()
|
||||
@@ -1,13 +0,0 @@
|
||||
import { TestDatabaseUtils } from "medusa-test-utils"
|
||||
|
||||
import * as Models from "@models"
|
||||
|
||||
const mikroOrmEntities = Models as unknown as any[]
|
||||
|
||||
export const MikroOrmWrapper = TestDatabaseUtils.getMikroOrmWrapper(
|
||||
mikroOrmEntities,
|
||||
null,
|
||||
process.env.MEDUSA_FULFILLMENT_DB_SCHEMA
|
||||
)
|
||||
|
||||
export const DB_URL = TestDatabaseUtils.getDatabaseURL()
|
||||
@@ -1,33 +0,0 @@
|
||||
import { Modules, ModulesDefinition } from "@medusajs/modules-sdk"
|
||||
|
||||
import { DB_URL } from "./database"
|
||||
|
||||
export function getInitModuleConfig() {
|
||||
const moduleOptions = {
|
||||
defaultAdapterOptions: {
|
||||
database: {
|
||||
clientUrl: DB_URL,
|
||||
schema: process.env.MEDUSA_FULFILLMENT_DB_SCHEMA,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
const injectedDependencies = {}
|
||||
|
||||
const modulesConfig_ = {
|
||||
[Modules.FULFILLMENT]: {
|
||||
definition: ModulesDefinition[Modules.FULFILLMENT],
|
||||
options: moduleOptions,
|
||||
},
|
||||
}
|
||||
|
||||
return {
|
||||
injectedDependencies,
|
||||
modulesConfig: modulesConfig_,
|
||||
databaseConfig: {
|
||||
clientUrl: DB_URL,
|
||||
schema: process.env.MEDUSA_FULFILLMENT_DB_SCHEMA,
|
||||
},
|
||||
joinerConfig: [],
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
export * from "./database"
|
||||
export * from "./get-init-module-config"
|
||||
Reference in New Issue
Block a user