* migration
* fix snapshot
* primarykey
* init work on dnd
* progress
* dnd
* undo changes
* undo changes
* undo changes
* undo changes
* fix firefox issue
* lint
* lint
* lint
* add changeset
* undo changes to product module
* set activator node
* init work on service layer
* alternative
* switch to OneToMany
* add tests
* progress
* update migration
* update approach and remove all references to images in product.ts tests
* handle delete images on empty array
* fix config and order type
* update changeset
* rm flag
* export type and fix type in test
* fix type
---------
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
**What**
- **core-flows**:
- cancel transfer
- decline transfer
- **API**:
- admin cancel transfer
- store decline transfer
- store cancel transfer
- **js-sdk**:
- add methods for store endpoints
---
CLOSES CMRC-726
What:
- `Dirent` class from `NodeJS` has different properties in different versions, causing issues in our loaders.
- Util `readDirRecursive` was introduced, avoiding old node versions to break
FIXES: https://github.com/medusajs/medusa/issues/8419
RESOLVES SUP-185
**What**
The cart fields to be fetched for the promotion workflow was not including the sales_channel_id, making any rules being constraint to that fields not being validated against this property.
**What**
- add request order transfer workflow
- add admin endpoint for transferring an order to a customer
- accept order transfer storefront endpoint
- accept transfer workflow
- changes in the order module to introduce new change and action types
---
**Note**
- we return 400 instead 409 currently if there is already an active order edit, I will revisit this in a followup
- endpoint for requesting order transfer from the storefront will be added in a separate PR
---
RESOLVES CMRC-701
RESOLVES CMRC-703
RESOLVES CMRC-704
RESOLVES CMRC-705
FIXES CMRC-691
**What**
`Date` is something that get executed, since workflows are meant to compose the definition of what will be executed, the date where always having the same value as they was executed once during composition.
Instead wrap those into transformer that will be executed when needed and fix the Date issues
Initially I thought that we will have to add special checks to allow relationships referencing itself. However, it turned out that not to be the case. Instead, it had more to do with how self relationships are defined in Mikro ORM.
In case of `belongsTo` relationship we have to define the other side as well either as a `hasMany` or `hasOne`. For example:
**❌ The following code will fail, because no children are defined for the parent**
```ts
const user = model.define("user", {
id: model.number(),
username: model.text(),
parent: model.belongsTo(() => user)
})
```
**✅ Addition of children relationship will make things work**
```ts
const user = model.define("user", {
id: model.number(),
username: model.text(),
parent: model.belongsTo(() => user, { mappedBy: "children" }),
children: model.hasMany(() => user, { mappedBy: "parent" }),
})
```
We can see the similar setup here with our `ProductCategory` MikroORM entity. https://github.com/medusajs/medusa/blob/develop/packages/modules/product/src/models/product-category.ts#L87-L94
@adrien2p Correct me if I am wrong. But I have added the tests for now so that we know the behavior of self relationships
What:
When `autocapture` is enabled, the webhook is processed before the order was created.
The payment processing workflows were merged into a single one
FIXES: SUP-118, SUP-9
https://github.com/medusajs/medusa/issues/9998
What:
- copy data before saving checkpoint
- removed unused data format function
- properly handle registerStepFailure to not throw
- emit onFinish event even when execution failed
**What**
- fix prefix for table search which caused the other table rendered on the page to fire query
- additionally, fix a typo in js SDK and only format the file
---
FIXES SUP-112
CLOSES https://github.com/medusajs/medusa/issues/9968