Highlights
Order transfers
You can now transfer order ownership between customers. We've added UI support in three places:
- Order details page in Medusa Admin
- Customer details page (Order list) in Medusa Admin
- Self-serve in our Next.js and B2B starters
The high-level flow is as follows:
- Initiate transfer
POST /admin/orders/:id/transfer { customer_id: string }
Send a request to generate a transfer token and emit an event with the order ID.
- Event subscriber
A subscriber picks up the event and emails the order’s current customer with the token.
- Accept Transfer
Customer accepts the order transfer.
POST /store/orders/:id/transfer/accept { token: string }
Product Module DML migration
Warning
Breaking changes (avoidable)
The Product module now uses our DML for data model definitions instead of MikroORM. This migration introduces improvements and fixes but results in breaking changes to some relationship APIs. These can be avoided through explicit configurations.
Required actions
- Relation ownership on
manyToMany
relation
Previously, the manyToMany
API inferred the owning side of relations based on the order of loading models. If the first-loaded model used mappedBy
, it became the owner. Now, ownership is determined by examining both sides of the relation, before defaulting to the old behavior. This change might lead to unexpected behavior, and we therefore recommend explicitly defining the owner.
Explicitly define the owner using joinColumn
, inverseJoinColumn
, or pivotTable
:
const ProductVariant = model
.define("ProductVariant", {
id: model.id({ prefix: "variant" }).primaryKey(),
...
options: model.manyToMany(() => ProductOptionValue, {
pivotTable: "product_variant_option",
mappedBy: "variants",
joinColumn: "variant_id",
inverseJoinColumn: "option_value_id",
}),
})
- Pivot table naming
Aside from the relation ownership, we have also updated how pivot table names are generated.
Before
We used the model names in alphabetical order and pluralized the last one of them.
Now
We use the model's table names in alphabetical order and pluralize the last one of them.
To avoid issues with your project, explicitly set pivotTable
in manyToMany
relations to match your existing table names:
For example:
const user = model.define('User', () => {
addresses: model.manyToMany(() => Address, { pivotTable: 'address_users' })
})
New languages
Our admin dashboard has been translated into Brazilian Portuguese, French, Thai, and Spanish.
Features
- feat(dashboard): Allow setting a tooltip for disabled action items by @kasperkristensen in #10234
- feat(dashboard, js-sdk): customer page transfer order + cancel request in timeline by @fPolic in #10250
- feat: convert MikroORM entities to DML entities by @thetutlage in #10043
- feat: add ptBR (Brazilian Portuguese) in translations by @DanSilva41 in #10188
- feat: add Thai language support by @oDestroyeRo in #10249
- feat: French translation V2 by @triplecasquette in #10301
Bugs
- fix: Fix product module creation example by @sradevski in #10228
- fix: Inventory module schema by @olivermrbl in #10262
- fix(dashboard): Add Metadata form to variant page by @kasperkristensen in #10285
- fix(dashboard): Truncate long product organization tags by @kasperkristensen in #10261
- fix(core-flows): aggregate payment status by @carlos-r-l-rodrigues in #10278
- fix(dashboard): Align casing of fields in reset password event by @kasperkristensen in #10313
- fix(dashboard): adjust transfer SVG for theme by @fPolic in #10307
- fix(dashboard): Prevent product metadata form from throwing error by @kasperkristensen in #10312
- fix(utils): read dir recursive by @carlos-r-l-rodrigues in #10318
- fix(dashboard): Correct Spain provinces in country-states.ts by @anthid in #10264
Documentation
- docs: update injection zones for v2.0.5 by @shahednasser in #10225
- docs: add details on updating a cart's customer by @shahednasser in #10226
- docs: added section on medusa cloud by @shahednasser in #10265
- docs-util: fix references generator by @shahednasser in #10271
- docs-util: fix build errors by @shahednasser in #10275
- docs: fixes to Medusa Cloud sections by @shahednasser in #10270
- docs: changes for CLI tools by @shahednasser in #10284
- docs: fix link to payment session by @shahednasser in #10286
- docs: fix links in API reference workflows section by @shahednasser in #10269
- docs: revise scheduled jobs by @shahednasser in #10291
- docs: fix links in examples guide by @shahednasser in #10296
- docs: revise workflows docs by @shahednasser in #10294
- docs: fix link to medusa container by @shahednasser in #10298
- docs: revise admin customization pages by @shahednasser in #10297
- docs: clarify medusa_url in Stripe docs by @shahednasser in #10305
- docs: update list of events by @shahednasser in #10308
- docs: add resend integration guide by @shahednasser in #10268
- docs: fix database URL in railway guide by @shahednasser in #10311
- docs: fix updateProvider edit user's password example by @xqSimone in #10253
- docs: Update Redis connection string instructions for Railway by @qbitdoge in #10246
Chores
- chore: fix CI branch in test by @shahednasser in #10274
- chore(dashboard): Add missing keys to i18n translation files by @kasperkristensen #10260
New Contributors
- @DanSilva41 made their first contribution in #10188
- @xqSimone made their first contribution in #10253
- @qbitdoge made their first contribution in #10246
- @anthid made their first contribution in #10301
Full Changelog: v2.0.6...v2.0.7