Commit Graph

816 Commits

Author SHA1 Message Date
Riqwan Thamir
6486f2bcce feat(core-flows,medusa): remove cart customer validation + rename workflow (#10207)
what:

- removes cart customer takeover validation
- change workflow from update to transfer
2024-11-21 16:57:03 +00:00
mStenz
25d1dfdea5 Fix typo in db error message (#9612) 2024-11-21 13:48:22 +00:00
420coupe
da7a078a7d update CreateOrderFulfillmentWorkflowInput to include optional requires_shipping boolean (#9479)
Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
2024-11-21 14:22:54 +01:00
Riqwan Thamir
2a8811edd9 feat(medusa): skip draft orders on order list (#10195) 2024-11-21 14:09:23 +01:00
Carlos R. L. Rodrigues
aeb5b43692 feat(workflows-sdk): add response to permanent failure (#10177) 2024-11-20 17:29:37 -03:00
Carlos R. L. Rodrigues
42c08fa8e0 fix(framework): handle deprecated Dirent path (#10179)
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
2024-11-20 20:25:48 +00:00
Riqwan Thamir
6680f69588 fix: move transfer cart under cart (#10175)
made a whoopsie!
2024-11-20 11:12:49 +00:00
Shahed Nasser
3fee17747f fix(types): fix AdminBatchProductRequest to have product ID (#10168) 2024-11-20 11:10:26 +02:00
Oli Juhl
8091c5f5bc fix: Remove undefined from events in update (#10170) 2024-11-20 09:43:51 +01:00
Harminder Virk
7390c14c20 feat: add support for making relationships searchable (#10172)
Closes: FRMW-2784
2024-11-20 08:39:44 +00:00
Riqwan Thamir
495c381709 feat(types, js-sdk): add updateCustomer to js-sdk (#10158)
what:

- adds new `POST /store/cart/:id/customer` endpoint to js sdk
2024-11-19 18:32:49 +00:00
Frane Polić
79088c8a3b feat(medusa): request order transfer storefront API (#10156)
**What**
- add an endpoint for order transfer requests from the storefront

---

CLOSES CMRC-702
2024-11-19 17:42:25 +00:00
Shahed Nasser
b43febda54 chore(js-sdk,types): add tsdocs for admin JS SDK methods [6/n] (#10028)
* chore(js-sdk,types): add tsdocs for admin JS SDK methods [6/n]

* fix error

* remove type changes
2024-11-19 19:15:44 +02:00
Riqwan Thamir
85f9c2b85a fix(framework,types): correct example of database driver options (#10166) 2024-11-19 16:32:31 +00:00
Shahed Nasser
5fb73e6698 chore(core-flows,types): add TSDocs for useQueryGraphStep (#10042) 2024-11-19 18:31:33 +02:00
Harminder Virk
9dff05cdde Revert "feat: add optional fields" (#10159)
Reverts medusajs/medusa#10150
2024-11-19 13:28:02 +00:00
Adrien de Peretti
59bf9afd48 fix(core-flows): Add missing cart sales channel id fields to be part of the application context (#10142)
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.
2024-11-19 11:46:49 +00:00
Riqwan Thamir
b7044bb3b0 feat(core-flows,medusa): Add API to update cart's customer (#10151)
what:

- adds an endpoint that updates a cart's customer

RESOLVES CMRC-718
2024-11-19 11:44:25 +00:00
Sebastian Rindom
41dc05d0c9 fix: add address and customer metadata to tax calc context (#10122)
Fixes CMRC-713

**What**
- Ensure that customer and shipping address metadata is passed in the tax calculation context when updating tax lines on a cart.

**Why**
- Gives more flexibility in criteria to evaluate tax rates. 
- https://github.com/medusajs/medusa/discussions/10121
- https://github.com/medusajs/medusa/discussions/10114

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2024-11-19 11:42:31 +00:00
Harminder Virk
661ea7865c feat: add optional fields (#10150) 2024-11-19 16:28:33 +05:30
Frane Polić
36460a3a07 feat(medusa, types, utils, core-flows, order) request & accept order transfer (#10106)
**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
2024-11-19 08:53:22 +00:00
Harminder Virk
2c957c64be refactor: rename workflow to singular (#10134) 2024-11-18 14:58:30 +05:30
Adrien de Peretti
10da8b379f chore(workflows-sdk): Display each error individually instead of packed (#10072)
**What**
Instead of displaying a single string prepared with all the errors, log each error individually
2024-11-15 11:27:52 +00:00
Adrien de Peretti
2e5fd9fd71 fix(core-flows): Fix date usage accross workflows (#10100)
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
2024-11-14 14:51:30 +00:00
Carlos R. L. Rodrigues
3e265229f2 chore(event-bus): event bus error handling (#10085) 2024-11-13 18:03:29 -03:00
Harminder Virk
98bf8c9006 test: add tests for self relationships (#10071)
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
2024-11-13 17:20:27 +00:00
Carlos R. L. Rodrigues
fc5d2b5fca feat(core-flows): order add quantity diff (#10065) 2024-11-12 16:49:58 -03:00
Carlos R. L. Rodrigues
2344012d1c fix(core-flows): capture before order created (#9980)
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
2024-11-12 13:43:48 +00:00
Carlos R. L. Rodrigues
1eef324af3 fix(orchestration): fix set step failure (#10031)
What:
 - copy data before saving checkpoint
 - removed unused data format function
 - properly handle registerStepFailure to not throw
 - emit onFinish event even when execution failed
2024-11-12 10:06:36 +00:00
olivermrbl
d5605656ae chore: Version packages 2024-11-12 10:10:07 +01:00
Frane Polić
fb05ca2b8a fix(medusa, types): filter product by external_id (#10010) 2024-11-11 19:31:41 +01:00
Kasper Fabricius Kristensen
34f4f695c0 fix(types): Add AdminBatchUpdateProductVariant type (#10009) 2024-11-11 19:30:44 +01:00
Harminder Virk
e228088f8d fix: pluralize type helper to account for uncountable nouns and special rules (#10011) 2024-11-11 17:18:23 +05:30
olivermrbl
ecece05b72 chore: Version packages 2024-11-11 10:58:20 +01:00
Oli Juhl
094971775b chore: Add actor type check + more tests (#10005) 2024-11-10 21:38:19 +00:00
Carlos R. L. Rodrigues
1bae311a29 fix(core-flows): keep same customer on cart update (#9977)
* fix(core-flows): keep same customer on cart update

* update guest customer email

* create guest customer for new emails

* rm log
2024-11-10 14:11:40 +01:00
Carlos R. L. Rodrigues
03f4b66b90 fix(link-modules): generate graphql type of read only links (#9955) 2024-11-08 07:54:50 -03:00
Carlos R. L. Rodrigues
6496789c65 fix(framework): exclude nested fields when excluding requested field (#9979) 2024-11-07 18:26:02 -03:00
Frane Polić
af9eec73df fix(core-flows): pass metadata on order fulfillment create (#9974)
CLOSES SUP-109
CLOSES https://github.com/medusajs/medusa/issues/9964
2024-11-07 19:13:44 +00:00
Frane Polić
576da17da3 fix(dashboard): user invite search (#9973)
**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
2024-11-07 19:13:28 +00:00
olivermrbl
8feb589659 chore: Release 2024-11-06 21:47:01 +01:00
Oli Juhl
441004cc21 chore: Update auth flow (#9959) 2024-11-06 21:21:45 +01:00
Oli Juhl
505768dd9f fix: Product type tax overrides (#9951)
* fix: Make product type tax override work

* fix: Make product type tax override work
2024-11-06 20:33:40 +01:00
Frane Polić
aa78fbf546 fix(types): add display_id to OrderDTO (#9953)
FIXED CMRC-644
2024-11-06 18:21:17 +00:00
Oli Juhl
c1c85ef952 fix(core-flows,medusa): Include region_id in shipping option retrieval (#9929)
### What
Include `region_id` when retrieving shipping options for a cart

### Why
Otherwise, region-specific prices will never show in the Store API

Closes CMRC-655 https://github.com/medusajs/medusa/issues/9906
2024-11-06 15:59:47 +00:00
Stevche Radevski
b3cbc160eb fix: Default to a relative path for the admin backend URL (#9947) 2024-11-06 15:08:38 +01:00
Stevche Radevski
30edc8fa40 fix: Support relative path in SDK (#9942) 2024-11-06 09:45:59 +01:00
Adrien de Peretti
879ce33090 fix(utils/dml): set-relationship graphql generator from DML wrong managed belongsTo (#9932)
**What**
Currently, when setting a `belongsTo` relationship on the DML with the otherside being `hasMany` it result in a wrongly generated gql output making the belongs to being a collection of the relation instead of the relation directly. This pr fixes this issue
2024-11-05 14:14:28 +00:00
Adrien de Peretti
bbf4af1725 fix(types): Prev limit wrong values (#9935)
**What**
The values are wrongly set which can lead to infinite depth iteration

**Note**
This will change on how we manage those cases in the future but currently it fixes an issue
2024-11-05 14:14:06 +00:00
Adrien de Peretti
c0368cca28 fix(workflows-sdk): Paralellize steps rollback issue with config (#9921)
* fix(workflows-sdk): Paralellize steps rollback issue with config

* Create tall-starfishes-travel.md
2024-11-05 08:54:04 +01:00