diff --git a/.changeset/sour-ladybugs-check.md b/.changeset/sour-ladybugs-check.md new file mode 100644 index 0000000000..abca8bc3fb --- /dev/null +++ b/.changeset/sour-ladybugs-check.md @@ -0,0 +1,24 @@ +--- +"@medusajs/api-key": patch +"@medusajs/auth": patch +"@medusajs/cart": patch +"@medusajs/currency": patch +"@medusajs/file": patch +"@medusajs/fulfillment": patch +"@medusajs/index": patch +"@medusajs/inventory": patch +"@medusajs/locking": patch +"@medusajs/notification": patch +"@medusajs/order": patch +"@medusajs/payment": patch +"@medusajs/pricing": patch +"@medusajs/product": patch +"@medusajs/promotion": patch +"@medusajs/region": patch +"@medusajs/sales-channel": patch +"@medusajs/stock-location": patch +"@medusajs/store": patch +"@medusajs/locking-postgres": patch +--- + +fix(): Order constraint and receive return diff --git a/packages/modules/api-key/package.json b/packages/modules/api-key/package.json index 4d57fd4159..dda56d20a1 100644 --- a/packages/modules/api-key/package.json +++ b/packages/modules/api-key/package.json @@ -30,10 +30,10 @@ "build": "rimraf dist && tsc --build && npm run resolve:aliases", "test": "jest --runInBand --bail --forceExit -- src/**/__tests__/**/*.ts", "test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.ts", - "migration:initial": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", - "migration:create": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", - "migration:up": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", - "orm:cache:clear": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" + "migration:initial": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", + "migration:create": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", + "migration:up": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", + "orm:cache:clear": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" }, "devDependencies": { "@medusajs/framework": "2.8.6", diff --git a/packages/modules/auth/package.json b/packages/modules/auth/package.json index 4b9f593fe6..c94f8f6cd2 100644 --- a/packages/modules/auth/package.json +++ b/packages/modules/auth/package.json @@ -30,10 +30,10 @@ "build": "rimraf dist && tsc --build && npm run resolve:aliases", "test": "jest --runInBand --bail --passWithNoTests --forceExit -- src", "test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.ts", - "migration:initial": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", - "migration:create": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", - "migration:up": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", - "orm:cache:clear": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" + "migration:initial": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", + "migration:create": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", + "migration:up": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", + "orm:cache:clear": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" }, "devDependencies": { "@medusajs/framework": "2.8.6", diff --git a/packages/modules/cart/package.json b/packages/modules/cart/package.json index 880796d79b..e92ca0c9a7 100644 --- a/packages/modules/cart/package.json +++ b/packages/modules/cart/package.json @@ -30,10 +30,10 @@ "build": "rimraf dist && tsc --build && npm run resolve:aliases", "test": "jest --runInBand --bail --passWithNoTests --forceExit -- src", "test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.ts", - "migration:initial": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", - "migration:create": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", - "migration:up": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", - "orm:cache:clear": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" + "migration:initial": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", + "migration:create": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", + "migration:up": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", + "orm:cache:clear": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" }, "devDependencies": { "@medusajs/framework": "2.8.6", diff --git a/packages/modules/currency/package.json b/packages/modules/currency/package.json index 0fbf45f190..cd6eff3f29 100644 --- a/packages/modules/currency/package.json +++ b/packages/modules/currency/package.json @@ -30,10 +30,10 @@ "build": "rimraf dist && tsc --build && npm run resolve:aliases", "test": "jest --runInBand --bail --forceExit -- src/**/__tests__/**/*.ts", "test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.ts", - "migration:initial": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", - "migration:create": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", - "migration:up": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", - "orm:cache:clear": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" + "migration:initial": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", + "migration:create": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", + "migration:up": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", + "orm:cache:clear": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" }, "devDependencies": { "@medusajs/framework": "2.8.6", diff --git a/packages/modules/file/package.json b/packages/modules/file/package.json index 237d260b80..231ccd10c8 100644 --- a/packages/modules/file/package.json +++ b/packages/modules/file/package.json @@ -30,10 +30,10 @@ "build": "rimraf dist && tsc --build && npm run resolve:aliases", "test": "jest --passWithNoTests --runInBand --bail --forceExit -- src/**/__tests__/**/*.ts", "test:integration": "jest --passWithNoTests --forceExit -- integration-tests/**/__tests__/**/*.ts", - "migration:initial": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", - "migration:create": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", - "migration:up": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", - "orm:cache:clear": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" + "migration:initial": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", + "migration:create": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", + "migration:up": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", + "orm:cache:clear": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" }, "devDependencies": { "@medusajs/framework": "2.8.6", diff --git a/packages/modules/fulfillment/package.json b/packages/modules/fulfillment/package.json index 5844ad0a5b..926c584b74 100644 --- a/packages/modules/fulfillment/package.json +++ b/packages/modules/fulfillment/package.json @@ -30,10 +30,10 @@ "build": "rimraf dist && tsc --build && npm run resolve:aliases", "test": "jest --runInBand --bail --forceExit --passWithNoTests -- src", "test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.spec.ts", - "migration:initial": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial -n InitialSetupMigration", - "migration:create": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", - "migration:up": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", - "orm:cache:clear": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" + "migration:initial": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial -n InitialSetupMigration", + "migration:create": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", + "migration:up": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", + "orm:cache:clear": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" }, "devDependencies": { "@medusajs/framework": "2.8.6", diff --git a/packages/modules/index/package.json b/packages/modules/index/package.json index a6d356f5cf..419f90c0a6 100644 --- a/packages/modules/index/package.json +++ b/packages/modules/index/package.json @@ -30,10 +30,10 @@ "build": "rimraf dist && tsc --build && npm run resolve:aliases", "test": "jest --passWithNoTests ./src", "test:integration": "jest --forceExit --runInBand -- integration-tests/__tests__/**/*.ts", - "migration:initial": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", - "migration:create": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", - "migration:up": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", - "orm:cache:clear": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" + "migration:initial": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", + "migration:create": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", + "migration:up": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", + "orm:cache:clear": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" }, "devDependencies": { "@medusajs/framework": "2.8.6", diff --git a/packages/modules/inventory/package.json b/packages/modules/inventory/package.json index 894716b49d..7086d205ea 100644 --- a/packages/modules/inventory/package.json +++ b/packages/modules/inventory/package.json @@ -50,9 +50,9 @@ "build": "rimraf dist && tsc --build && npm run resolve:aliases", "test": "jest --runInBand --bail --forceExit -- src/**/__tests__/**/*.ts", "test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.spec.ts", - "migration:initial": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial -n InitialSetupMigration", - "migration:create": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", - "migration:up": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", - "orm:cache:clear": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" + "migration:initial": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial -n InitialSetupMigration", + "migration:create": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", + "migration:up": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", + "orm:cache:clear": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" } } diff --git a/packages/modules/locking/package.json b/packages/modules/locking/package.json index 7dc6ce3528..f5c3beea9c 100644 --- a/packages/modules/locking/package.json +++ b/packages/modules/locking/package.json @@ -26,10 +26,10 @@ "build": "rimraf dist && tsc --build && npm run resolve:aliases", "test": "jest --passWithNoTests --runInBand --bail --forceExit -- src/", "test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.spec.ts", - "migration:initial": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial -n InitialSetupMigration", - "migration:create": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", - "migration:up": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", - "orm:cache:clear": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" + "migration:initial": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial -n InitialSetupMigration", + "migration:create": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", + "migration:up": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", + "orm:cache:clear": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" }, "devDependencies": { "@medusajs/framework": "2.8.6", diff --git a/packages/modules/notification/package.json b/packages/modules/notification/package.json index 1baecdb85b..5925c14bdf 100644 --- a/packages/modules/notification/package.json +++ b/packages/modules/notification/package.json @@ -30,10 +30,10 @@ "build": "rimraf dist && tsc --build && npm run resolve:aliases", "test": "jest --runInBand --bail --forceExit --passWithNoTests -- src", "test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.spec.ts", - "migration:initial": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial -n InitialSetupMigration", - "migration:create": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", - "migration:up": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", - "orm:cache:clear": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" + "migration:initial": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial -n InitialSetupMigration", + "migration:create": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", + "migration:up": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", + "orm:cache:clear": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" }, "devDependencies": { "@medusajs/framework": "2.8.6", diff --git a/packages/modules/order/integration-tests/__tests__/create-order.ts b/packages/modules/order/integration-tests/__tests__/create-order.spec.ts similarity index 76% rename from packages/modules/order/integration-tests/__tests__/create-order.ts rename to packages/modules/order/integration-tests/__tests__/create-order.spec.ts index 5b75da22e9..5fe450abe6 100644 --- a/packages/modules/order/integration-tests/__tests__/create-order.ts +++ b/packages/modules/order/integration-tests/__tests__/create-order.spec.ts @@ -1,12 +1,12 @@ import { CreateOrderDTO, IOrderModuleService } from "@medusajs/framework/types" -import { Modules } from "@medusajs/framework/utils" +import { Modules, promiseAll } from "@medusajs/framework/utils" import { moduleIntegrationTestRunner } from "@medusajs/test-utils" jest.setTimeout(100000) moduleIntegrationTestRunner({ moduleName: Modules.ORDER, - testSuite: ({ service }) => { + testSuite: ({ service, MikroOrmWrapper }) => { describe("Order Module Service", () => { const input = { email: "foo@bar.com", @@ -307,6 +307,107 @@ moduleIntegrationTestRunner({ ) }) + it("should delete entirely an order, shipping method and items. Including taxes and adjustments associated with them and credit lines", async function () { + const inpCopy = JSON.parse(JSON.stringify(input)) as CreateOrderDTO + inpCopy.transactions!.push({ + amount: 10, + currency_code: "USD", + }) + const created = await service.createOrders(inpCopy) + + await service.createOrderCreditLines([ + { + order_id: created.id, + amount: 10, + reference_id: "credit_line_1", + }, + ]) + + await service.addOrderTransactions([ + { + order_id: created.id, + amount: -20, + currency_code: "USD", + }, + ]) + + async function findAllOrderRelatedEntities(orderId: string) { + const orderIdClause = { order_id: orderId } + const manager = MikroOrmWrapper.forkManager() + const [ + order, + orderItems, + orderSummary, + orderShippingMethods, + orderTransactions, + orderCreditLines, + orderShippingAddress, + orderBillingAddress, + orderChange, + orderChangeAction, + ] = await promiseAll([ + manager.findOne("Order", { + id: created.id, + }), + manager.findOne("OrderItem", orderIdClause), + manager.findOne("OrderSummary", orderIdClause), + manager.findOne("OrderShipping", orderIdClause), + manager.findOne("OrderTransaction", orderIdClause), + manager.findOne("OrderCreditLine", orderIdClause), + manager.findOne("OrderAddress", { + first_name: "Test", + last_name: "Test", + address_1: "Test", + city: "Test", + country_code: "US", + postal_code: "12345", + phone: "12345", + }), + manager.findOne("OrderAddress", { + first_name: "Test", + last_name: "Test", + address_1: "Test", + city: "Test", + country_code: "US", + postal_code: "12345", + }), + ]) + + return { + order, + orderItems, + orderSummary, + orderShippingMethods, + orderTransactions, + orderCreditLines, + orderShippingAddress, + orderBillingAddress, + } + } + + let orderRelatedEntities = await findAllOrderRelatedEntities(created.id) + expect(orderRelatedEntities.order).not.toBeNull() + expect(orderRelatedEntities.orderItems).not.toBeNull() + expect(orderRelatedEntities.orderSummary).not.toBeNull() + expect(orderRelatedEntities.orderShippingMethods).not.toBeNull() + expect(orderRelatedEntities.orderTransactions).not.toBeNull() + expect(orderRelatedEntities.orderCreditLines).not.toBeNull() + expect(orderRelatedEntities.orderShippingAddress).not.toBeNull() + expect(orderRelatedEntities.orderBillingAddress).not.toBeNull() + + await service.deleteOrders([created.id]) + + orderRelatedEntities = await findAllOrderRelatedEntities(created.id) + expect(orderRelatedEntities.order).toBeNull() + expect(orderRelatedEntities.orderItems).toBeNull() + expect(orderRelatedEntities.orderSummary).toBeNull() + expect(orderRelatedEntities.orderShippingMethods).toBeNull() + expect(orderRelatedEntities.orderTransactions).toBeNull() + expect(orderRelatedEntities.orderCreditLines).toBeNull() + expect(orderRelatedEntities.orderShippingAddress).toBeNull() + expect(orderRelatedEntities.orderBillingAddress).toBeNull() + }) + it("should transform requested fields and relations to match the db schema and return the order", async function () { const createdOrder = await service.createOrders(input) const getOrder = await service.retrieveOrder(createdOrder.id, { diff --git a/packages/modules/order/integration-tests/__tests__/order-claim.ts b/packages/modules/order/integration-tests/__tests__/order-claim.spec.ts similarity index 100% rename from packages/modules/order/integration-tests/__tests__/order-claim.ts rename to packages/modules/order/integration-tests/__tests__/order-claim.spec.ts diff --git a/packages/modules/order/integration-tests/__tests__/order-edit.ts b/packages/modules/order/integration-tests/__tests__/order-edit.spec.ts similarity index 100% rename from packages/modules/order/integration-tests/__tests__/order-edit.ts rename to packages/modules/order/integration-tests/__tests__/order-edit.spec.ts diff --git a/packages/modules/order/integration-tests/__tests__/order-exchange.ts b/packages/modules/order/integration-tests/__tests__/order-exchange.spec.ts similarity index 100% rename from packages/modules/order/integration-tests/__tests__/order-exchange.ts rename to packages/modules/order/integration-tests/__tests__/order-exchange.spec.ts diff --git a/packages/modules/order/integration-tests/__tests__/order-return.ts b/packages/modules/order/integration-tests/__tests__/order-return.spec.ts similarity index 100% rename from packages/modules/order/integration-tests/__tests__/order-return.ts rename to packages/modules/order/integration-tests/__tests__/order-return.spec.ts diff --git a/packages/modules/order/integration-tests/__tests__/returns.ts b/packages/modules/order/integration-tests/__tests__/returns.spec.ts similarity index 100% rename from packages/modules/order/integration-tests/__tests__/returns.ts rename to packages/modules/order/integration-tests/__tests__/returns.spec.ts diff --git a/packages/modules/order/package.json b/packages/modules/order/package.json index 2c31b2fb26..d49511a84c 100644 --- a/packages/modules/order/package.json +++ b/packages/modules/order/package.json @@ -30,10 +30,10 @@ "build": "rimraf dist && tsc --build && npm run resolve:aliases", "test": "jest --runInBand --bail --forceExit -- src/**/__tests__/**/*.ts", "test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.spec.ts", - "migration:initial": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", - "migration:create": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", - "migration:up": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", - "orm:cache:clear": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" + "migration:initial": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", + "migration:create": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", + "migration:up": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", + "orm:cache:clear": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" }, "devDependencies": { "@medusajs/framework": "2.8.6", diff --git a/packages/modules/order/src/migrations/.snapshot-medusa-order.json b/packages/modules/order/src/migrations/.snapshot-medusa-order.json index 66f06e16f3..2e256e0c3d 100644 --- a/packages/modules/order/src/migrations/.snapshot-medusa-order.json +++ b/packages/modules/order/src/migrations/.snapshot-medusa-order.json @@ -1311,6 +1311,7 @@ "id" ], "referencedTableName": "public.order", + "deleteRule": "cascade", "updateRule": "cascade" } }, diff --git a/packages/modules/order/src/migrations/Migration20250704120229.ts b/packages/modules/order/src/migrations/Migration20250704120229.ts new file mode 100644 index 0000000000..e27e29de87 --- /dev/null +++ b/packages/modules/order/src/migrations/Migration20250704120229.ts @@ -0,0 +1,23 @@ +import { Migration } from "@mikro-orm/migrations" + +export class Migration20250704120229 extends Migration { + override async up(): Promise { + this.addSql( + `alter table if exists "order_credit_line" drop constraint if exists "order_credit_line_order_id_foreign";` + ) + + this.addSql( + `alter table if exists "order_credit_line" add constraint "order_credit_line_order_id_foreign" foreign key ("order_id") references "order" ("id") on update cascade on delete cascade;` + ) + } + + override async down(): Promise { + this.addSql( + `alter table if exists "order_credit_line" drop constraint if exists "order_credit_line_order_id_foreign";` + ) + + this.addSql( + `alter table if exists "order_credit_line" add constraint "order_credit_line_order_id_foreign" foreign key ("order_id") references "order" ("id") on update cascade;` + ) + } +} diff --git a/packages/modules/order/src/models/order.ts b/packages/modules/order/src/models/order.ts index 9843ae9cd3..4266aca82f 100644 --- a/packages/modules/order/src/models/order.ts +++ b/packages/modules/order/src/models/order.ts @@ -56,7 +56,13 @@ const _Order = model }), }) .cascades({ - delete: ["summary", "items", "shipping_methods", "transactions"], + delete: [ + "summary", + "items", + "shipping_methods", + "transactions", + "credit_lines", + ], }) .indexes([ { diff --git a/packages/modules/order/src/services/order-module-service.ts b/packages/modules/order/src/services/order-module-service.ts index 62561a4c5a..a5c05a4171 100644 --- a/packages/modules/order/src/services/order-module-service.ts +++ b/packages/modules/order/src/services/order-module-service.ts @@ -897,13 +897,10 @@ export default class OrderModuleService (orderShipping) => orderShipping.shipping_method_id ) - await promiseAll([ - this.orderAddressService_.delete(orderAddressIds, sharedContext), - // Delete order changes & actions - this.orderChangeService_.delete(orderChangeIds, sharedContext), - ]) + await this.orderAddressService_.delete(orderAddressIds, sharedContext) + await this.orderChangeService_.delete(orderChangeIds, sharedContext) - // Delete order, order items, summary, shipping methods and transactions + // Delete order, order items, summary, shipping methods, transactions and credit lines await super.deleteOrders(ids, sharedContext) await promiseAll([ @@ -3653,7 +3650,7 @@ export default class OrderModuleService ): Promise { const ret = await this.receiveReturn_(data, sharedContext) - return await this.retrieveReturn(ret.id, { + return await this.retrieveReturn(ret[0].id, { relations: [ "items", "items.item", @@ -3668,7 +3665,7 @@ export default class OrderModuleService private async receiveReturn_( data: OrderTypes.ReceiveOrderReturnDTO, @MedusaContext() sharedContext?: Context - ): Promise { + ): Promise { return await BundledActions.receiveReturn.bind(this)(data, sharedContext) } diff --git a/packages/modules/payment/package.json b/packages/modules/payment/package.json index 03d8a4a1a2..f47c32d59a 100644 --- a/packages/modules/payment/package.json +++ b/packages/modules/payment/package.json @@ -30,10 +30,10 @@ "build": "rimraf dist && tsc --build && npm run resolve:aliases", "test": "jest --runInBand --bail --passWithNoTests --forceExit -- src", "test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.ts", - "migration:initial": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", - "migration:create": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", - "migration:up": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", - "orm:cache:clear": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" + "migration:initial": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", + "migration:create": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", + "migration:up": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", + "orm:cache:clear": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" }, "devDependencies": { "@medusajs/framework": "2.8.6", diff --git a/packages/modules/pricing/package.json b/packages/modules/pricing/package.json index dacf2ddeec..98cadac297 100644 --- a/packages/modules/pricing/package.json +++ b/packages/modules/pricing/package.json @@ -30,10 +30,10 @@ "build": "rimraf dist && tsc --build && npm run resolve:aliases", "test": "jest --runInBand --bail --forceExit -- src/**/__tests__/**/*.ts", "test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.ts", - "migration:initial": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", - "migration:create": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", - "migration:up": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", - "orm:cache:clear": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" + "migration:initial": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", + "migration:create": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", + "migration:up": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", + "orm:cache:clear": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" }, "devDependencies": { "@medusajs/framework": "2.8.6", diff --git a/packages/modules/product/package.json b/packages/modules/product/package.json index 435a9c8fd6..dbaedae105 100644 --- a/packages/modules/product/package.json +++ b/packages/modules/product/package.json @@ -30,10 +30,10 @@ "build": "rimraf dist && tsc --build && npm run resolve:aliases", "test": "jest --runInBand --bail --forceExit -- src/**/__tests__/**/*.ts", "test:integration": "jest --bail --forceExit -- integration-tests/__tests__/**/*.ts", - "migration:initial": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", - "migration:create": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", - "migration:up": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", - "orm:cache:clear": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" + "migration:initial": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", + "migration:create": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", + "migration:up": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", + "orm:cache:clear": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" }, "devDependencies": { "@medusajs/framework": "2.8.6", diff --git a/packages/modules/promotion/package.json b/packages/modules/promotion/package.json index 1caec91f54..f856c76567 100644 --- a/packages/modules/promotion/package.json +++ b/packages/modules/promotion/package.json @@ -30,10 +30,10 @@ "build": "rimraf dist && tsc --build && npm run resolve:aliases", "test": "jest --runInBand --passWithNoTests --bail --forceExit -- src", "test:integration": "jest --forceExit ", - "migration:initial": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", - "migration:create": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", - "migration:up": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", - "orm:cache:clear": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" + "migration:initial": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", + "migration:create": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", + "migration:up": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", + "orm:cache:clear": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" }, "devDependencies": { "@medusajs/framework": "2.8.6", diff --git a/packages/modules/providers/locking-postgres/package.json b/packages/modules/providers/locking-postgres/package.json index 511358fd44..5bcaaab34a 100644 --- a/packages/modules/providers/locking-postgres/package.json +++ b/packages/modules/providers/locking-postgres/package.json @@ -41,10 +41,10 @@ "build": "rimraf dist && tsc --build && npm run resolve:aliases", "test": "jest --passWithNoTests src", "test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.spec.ts", - "migration:initial": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial -n InitialSetupMigration", - "migration:create": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", - "migration:up": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", - "orm:cache:clear": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" + "migration:initial": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial -n InitialSetupMigration", + "migration:create": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", + "migration:up": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", + "orm:cache:clear": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" }, "keywords": [ "medusa-providers", diff --git a/packages/modules/region/package.json b/packages/modules/region/package.json index 6a821e3aa4..909a3e7399 100644 --- a/packages/modules/region/package.json +++ b/packages/modules/region/package.json @@ -30,10 +30,10 @@ "build": "rimraf dist && tsc --build && npm run resolve:aliases", "test": "jest --runInBand --passWithNoTests --bail --forceExit -- src", "test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.ts", - "migration:initial": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", - "migration:create": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", - "migration:up": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", - "orm:cache:clear": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" + "migration:initial": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", + "migration:create": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", + "migration:up": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", + "orm:cache:clear": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" }, "devDependencies": { "@medusajs/framework": "2.8.6", diff --git a/packages/modules/sales-channel/package.json b/packages/modules/sales-channel/package.json index 5ba9136233..1c98afe9b7 100644 --- a/packages/modules/sales-channel/package.json +++ b/packages/modules/sales-channel/package.json @@ -30,10 +30,10 @@ "build": "rimraf dist && tsc --build && npm run resolve:aliases", "test": "jest --runInBand --bail --forceExit -- src/**/__tests__/**/*.ts", "test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.ts", - "migration:initial": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", - "migration:create": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", - "migration:up": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", - "orm:cache:clear": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" + "migration:initial": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", + "migration:create": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", + "migration:up": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", + "orm:cache:clear": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" }, "devDependencies": { "@medusajs/framework": "2.8.6", diff --git a/packages/modules/stock-location/package.json b/packages/modules/stock-location/package.json index 93766c3ab4..9f0db05506 100644 --- a/packages/modules/stock-location/package.json +++ b/packages/modules/stock-location/package.json @@ -50,9 +50,9 @@ "build": "rimraf dist && tsc --build && npm run resolve:aliases", "test": "jest --runInBand --bail --forceExit -- src/**/__tests__/**/*.ts", "test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.spec.ts", - "migration:initial": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial -n InitialSetupMigration", - "migration:create": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", - "migration:up": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", - "orm:cache:clear": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" + "migration:initial": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial -n InitialSetupMigration", + "migration:create": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", + "migration:up": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", + "orm:cache:clear": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" } } diff --git a/packages/modules/store/package.json b/packages/modules/store/package.json index bf03bf1201..e556a520ae 100644 --- a/packages/modules/store/package.json +++ b/packages/modules/store/package.json @@ -30,10 +30,10 @@ "build": "rimraf dist && tsc --build && npm run resolve:aliases", "test": "jest --runInBand --bail --forceExit -- src/**/__tests__/**/*.ts", "test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.ts", - "migration:initial": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", - "migration:create": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", - "migration:up": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", - "orm:cache:clear": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" + "migration:initial": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", + "migration:create": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", + "migration:up": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", + "orm:cache:clear": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" }, "devDependencies": { "@medusajs/framework": "2.8.6", diff --git a/packages/modules/tax/package.json b/packages/modules/tax/package.json index 74aab84bba..a02ea1a894 100644 --- a/packages/modules/tax/package.json +++ b/packages/modules/tax/package.json @@ -30,10 +30,10 @@ "build": "rimraf dist && tsc --build && npm run resolve:aliases", "test": "jest --runInBand --bail --forceExit -- src/**/__tests__/**/*.ts", "test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.spec.ts", - "migration:initial": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", - "migration:create": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", - "migration:up": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", - "orm:cache:clear": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" + "migration:initial": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", + "migration:create": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", + "migration:up": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", + "orm:cache:clear": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" }, "devDependencies": { "@medusajs/framework": "2.8.6", diff --git a/packages/modules/user/package.json b/packages/modules/user/package.json index fa74979b6f..719e7c557f 100644 --- a/packages/modules/user/package.json +++ b/packages/modules/user/package.json @@ -30,10 +30,10 @@ "build": "rimraf dist && tsc --build && npm run resolve:aliases", "test": "jest --runInBand --passWithNoTests --bail --forceExit -- src", "test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.ts", - "migration:initial": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", - "migration:create": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", - "migration:up": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", - "orm:cache:clear": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" + "migration:initial": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", + "migration:create": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", + "migration:up": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", + "orm:cache:clear": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" }, "devDependencies": { "@medusajs/framework": "2.8.6", diff --git a/packages/modules/workflow-engine-inmemory/package.json b/packages/modules/workflow-engine-inmemory/package.json index 0504079741..5b12c3f859 100644 --- a/packages/modules/workflow-engine-inmemory/package.json +++ b/packages/modules/workflow-engine-inmemory/package.json @@ -30,10 +30,10 @@ "build": "rimraf dist && tsc --build && npm run resolve:aliases", "test": "jest --passWithNoTests --runInBand --bail --forceExit -- src", "test:integration": "jest --forceExit -- integration-tests/**/__tests__/*.ts", - "migration:initial": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", - "migration:create": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", - "migration:up": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", - "orm:cache:clear": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" + "migration:initial": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", + "migration:create": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", + "migration:up": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", + "orm:cache:clear": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" }, "devDependencies": { "@medusajs/framework": "2.8.6", diff --git a/packages/modules/workflow-engine-redis/package.json b/packages/modules/workflow-engine-redis/package.json index af6fbfc9b8..3170ab6657 100644 --- a/packages/modules/workflow-engine-redis/package.json +++ b/packages/modules/workflow-engine-redis/package.json @@ -30,10 +30,10 @@ "build": "rimraf dist && tsc --build && npm run resolve:aliases", "test": "jest --passWithNoTests --runInBand --bail --forceExit -- src", "test:integration": "jest --forceExit -- integration-tests/**/__tests__/*.ts", - "migration:initial": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", - "migration:create": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", - "migration:up": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", - "orm:cache:clear": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" + "migration:initial": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial", + "migration:create": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create", + "migration:up": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up", + "orm:cache:clear": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear" }, "devDependencies": { "@medusajs/framework": "2.8.6",