Commit Graph

627 Commits

Author SHA1 Message Date
Pedro Guzman
2affc0d7d9 fix: fix weight/length/height/width types in updates (#12500) 2025-05-16 10:16:43 +02:00
olivermrbl
d2dd2e7c72 chore: Version packages 2025-05-15 09:49:09 +02:00
Pedro Guzman
142a1f0a5b fix(product): returned updates order in upsertWithReplace (#12486)
* add failing test for upsertWithReplace order

* reproduce prices update shuffling issue

* fix: fix order of returned updates in updateMany

* fix: fix order of returned updates in ProductService

* fix: reset test count to 1

* Create tame-insects-marry.md

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-05-15 09:22:24 +02:00
Carlos R. L. Rodrigues
c661e06488 fix(index): query builder handle json array (#12480)
* fix(index): query builder handle json array

* fix sales channel event names
2025-05-14 18:43:01 +02:00
Adrien de Peretti
7fdbf2a965 fix(workflows-sdk): Miss match context usage within run as step (#12449)
**What**

Currently, runAsStep keep reference of the workflow context that is being run as step, except that the step is composed for the current workflow composition and not the workflow being run as a step. Therefore, the context are currently miss matched leading to wrong configuration being used in case of async workflows.

**BUG**
This fix allow the runAsStep to use the current composition context to configure the step for the sub workflow to be run

**BUG BREAKING**
fix the step config wrongly used to wrap async step handlers. Now steps configured async through .config that returns a new step response will indeed marked itself as success without the need for background execution or calling setStepSuccess (as it was expected originally)

**FEATURE**
This pr also add support for cancelling running transaction, the transaction will be marked as being cancelled, once the current step finished, it will cancel the transaction to start compensating all previous steps including itself

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
2025-05-14 13:28:16 +00:00
Adrien de Peretti
ab22faaa52 Chore/test runner improvements (#12439)
**What**
Make sure there is no open handles left and that the shutdown function are properly called. Refactor and improve the medusa test runner. Make sure all modules instances are released and cleaned up

**NOTE:**
On a separate PR we can continue the investigation for the memory growing over time while the tests execute
2025-05-14 13:17:41 +00:00
olivermrbl
d3a5868e8b chore: Version packages 2025-05-13 12:56:07 +02:00
Oli Juhl
92af52d133 fix(tax): Make system provider registration backward compatible (#12441)
* fix(tax): Make provider registration backward compatible

* add tests
2025-05-12 17:06:43 +02:00
Adrien de Peretti
9d29078b0d fix(workflow-engine-*): q text search (#12435) 2025-05-11 16:21:41 +02:00
Pedro Guzman
7ef13495d6 Merge pull request #12367 from medusajs/fix/refactor-update-products
fix: refactor batch product update
2025-05-08 12:28:02 +02:00
Pedro Guzman
1ff5c4bf86 fix: move product update logic to repository 2025-05-08 12:03:29 +02:00
Frane Polić
0d8af119c5 feat(product): search variants by product properties (#12391) 2025-05-07 10:29:14 +00:00
Pedro Guzman
d9c8608e51 fix: use service methods instead of entity manager for product updates 2025-05-07 10:34:55 +02:00
Frane Polić
9cedeb182d feat(dashboard, js-sdk, medusa, tax, types): custom tax providers (#12297)
* wip: setup loaders, add endpoints, module work, types, js sdk

* fix: tax module provider loader

* feat: select provider on region create, fix enpoint middleware registration

* feat: edit form

* fix: rename param

* chore: changeset

* fix: don't default to system provider

* fix: admin fixes, dispalt tax provider

* fix: some tests and types

* fix: remove provider from province regions in test

* fix: more tests, optional provider for sublevel regions, fix few types

* fix: OE test

* feat: edit tax region admin, update tax region core flow changes

* feat: migrate script

* fix: refactor

* chore: use query graph

* feat: provider section
2025-05-06 19:26:33 +02:00
Adrien de Peretti
80007f3afd feat(workflows-*): Allow to re run non idempotent but stored workflow with the same transaction id if considered done (#12362) 2025-05-06 17:17:49 +02:00
Pedro Guzman
0c7657926a fix: refactor batch product update 2025-05-06 13:53:27 +02:00
Oli Juhl
77c3023200 fix(product): Return updated collections (#12354)
Collection updates without a `products` payload were not returned from the service layer due to an incorrect early return

Fixes SUP-1488
2025-05-05 14:41:45 +00:00
Harminder Virk
e4d853185f fix: export ProductImage to allow for custom links to add alt text (#12357) 2025-05-05 14:24:25 +05:30
Harminder Virk
84f58f9058 feat: implement direct upload (#12328)
* feat: implement direct upload

* feat: add direct-upload endpoint

* refactor: implement feedback

* refactor: have a dedicated endpoint for direct uploads

* refactor: convert responses to snakecase

* refactor: rename method to createImport

* test: add tests for the presigned-urls endpoint
2025-05-04 12:58:10 +02:00
Carlos R. L. Rodrigues
90c61d1898 fix(core-flows): add missing remove remote link (#12326)
* fix(core-flows): add missing remove remote link

* temp disable test
2025-04-30 17:43:37 +02:00
Harminder Virk
ceb504db2c feat: add needed methods to the file module and providers (#12325) 2025-04-30 13:17:31 +05:30
Carlos R. L. Rodrigues
b868a4ef4d feat(index): add filterable fields to link definition (#11898)
* feat(index): add filterable fields to link definition

* rm comment

* break recursion

* validate read only links

* validate filterable

* gql schema array

* link parents

* isInverse

* push id when not present

* Fix ciruclar relationships and add tests to ensure proper behaviour (part 1)

* log and fallback to entity.alias

* cleanup and fixes

* cleanup and fixes

* cleanup and fixes

* fix get attributes

* gql type

* unit test

* array inference

* rm only

* package.json

* pacvkage.json

* fix link retrieval on duplicated entity type and aliases + tests

* link parents as array

* Match only parent entity

* rm comment

* remove hard coded schema

* extend types

* unit test

* test

* types

* pagination type

* type

* fix integration tests

* Improve performance of in selection

* use @@ to filter property

* escape jsonPath

* add Event Bus by default

* changeset

* rm postgres analyze

* estimate count

* new query

* parent aliases

* inner query w/ filter and sort relations

* address comments

---------

Co-authored-by: adrien2p <adrien.deperetti@gmail.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-04-29 12:10:31 +02:00
Harminder Virk
552dc52228 test: use shared as integration-tests level (#12278) 2025-04-28 18:41:19 +05:30
olivermrbl
2fec5f4aa0 chore: Version packages 2025-04-23 09:27:02 +02:00
Frane Polić
ad74ba2ca4 fix(core-flows, link-modules): return fulfillment creation (#12227)
* fix: return fulfillment creation

* chore: changeset

* fix: link

* fix: cancel claim flow

* chore: test fulfillment creation as a part of return lifecycle test

* fix: exchanges cancle flow

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-04-22 14:33:46 +02:00
Adrien de Peretti
28958b2e26 Chore/orchestration storage improvements (#12178)
**What**
Cleanup and improve workflow storage utility
2025-04-18 08:35:23 +00:00
Stevche Radevski
c4a0b63778 feat: Add support for uploading a file directly to the file provider from the client (#12224)
* feat: Add support for uploading a file directly to the file provider from the client

* fix: Add missing types and add a couple of module tests

* fix: Allow nested routes, add test for it
2025-04-18 10:22:00 +02:00
Adrien de Peretti
8618e6ee38 fix(): Properly handle workflow as step now that events are fixed entirely (#12196)
**What**
Now that all events management are fixed in the workflows life cycle, the run as step needs to leverage the workflow engine if present (which should always be the case for async workflows) in order to ensure the continuation and the ability to mark parent step in parent workflow as success or failure

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
2025-04-17 09:34:19 +00:00
Frane Polić
9851598dae fix(payment): properly delete refund (#12193)
**What**
- properly delete the refund record if refunding with the provider fails

---

CLOSES SUP-1398
2025-04-16 07:57:39 +00:00
Adrien de Peretti
2f6963a5fb fix(): Event group id propagation and event managements (#12157) 2025-04-14 15:57:52 -03:00
Adrien de Peretti
4ea1a2e09f fix(index): Default schema typings (#12183)
**What**
Fix wrongly type is_giftcard property
2025-04-14 12:00:53 +00:00
olivermrbl
d61694385d chore: Version packages 2025-04-11 10:25:36 +02:00
Adrien de Peretti
6015dcc16d chore(product): Missing index in migration (#12150)
* chore(product): Missing index in migration

* Create silent-parrots-tickle.md
2025-04-11 10:18:58 +02:00
Adrien de Peretti
3a1cf2212a chore: Cache available price rule attributes (#12144)
**What**
We found out that the pricing context from the cart always contains the entire cart, even though it is kind of wrong. The issue is that even though we improve the performances of the query, it will cost a lot to have hundreds of constraint for nothing potentially. For that reason, we cache the attributes in memory with the best possible query we can do to gather them and we renew them when we perform a calculate prices if it has been reset. That way, we ensure we don't have unnecessary checks on attributes that does not have rules.

Since we don't have the type table anymore which was doing that for us and until we have a proper caching layer it would do IMO. But the rules type table was very useful for these attributes findings
2025-04-10 15:55:35 +00:00
Adrien de Peretti
d87b25203c chore(promotion): Improve performances [1] (#12129)
**What**
Reduce database queries when possible and use proper data structure and aggregation when possible in order to reduce performance decrease overall
2025-04-10 15:53:39 +00:00
Carlos R. L. Rodrigues
31abba8cde fix(orchestrator): save checkpoint before async step (#12138) 2025-04-10 15:36:36 +00:00
Adrien de Peretti
07252691c5 chore(pricing): Pricing retrieval improvements (#12128)
**What**
I have removed the check for the context key where it was fetching all attributes available and then stripping out the one that does not exists.. On big dataset these would remove multiple hundreds of ms of query execution
2025-04-10 09:39:21 +00:00
Adrien de Peretti
cb26c224ea chore(pricing): improve calculate prices performances (#12120)
* chore(pricing): Try to improve performances

* chore(pricing): new indexes

* chore(pricing): new indexes

* fix orderr

* Create olive-horses-judge.md

* feedback
2025-04-09 13:21:33 +02:00
Adrien de Peretti
13e159d8ad fix(workflow-engine-*): Prevent passing shared context reference (#11873)
* fix(workflow-engine-*): Prevent passing shared context reference

* fix(workflow-engine-*): Prevent passing shared context reference

* prevent tests from hanging

* fix event handling

* add integration tests

* use interval for scheduled in tests

* skip tests for now

* Create silent-glasses-enjoy.md

* fix cancel

* changeset

* push multiple aliases

* test multiple field alias

* increase wait time to index on test

---------

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
Co-authored-by: Carlos R. L. Rodrigues <rodrigolr@gmail.com>
2025-04-09 10:39:29 +02:00
Adrien de Peretti
74381addc3 chore(): Emit events in batch and index process event ids in batch (#12097)
**What**
First iteration to prevent events from overwhelming the systems.
- Group emitted event ids when possible instead of creating a message per id which leads to reduced amount of events to process massively in cases of import for example
- Update the index engine to process event data in batches of 100
- Update event handling by the index engine to be able to upsert by batch as well
- Fix index engine build config for intermediate listeners inferrence
2025-04-08 16:57:08 +00:00
Frane Polić
9bf1e52d25 fix(order): update add item unit price (#12072) 2025-04-04 12:47:00 +02:00
Carlos R. L. Rodrigues
2270f29ec5 chore(link-modules): backward compatible links (#12062)
What:
 * Add `hasMany` for links that accepted that in the past. That way we don't block marketplaces to link 1 cart to multiple orders and carts with split payment.
2025-04-02 11:56:48 +00:00
Harminder Virk
d3e725a907 feat: add hasMany flag to enforce in app link uniqueness (#12039)
* feat: add createMultiple flag to enforce inApp link uniqueness

* changes

* mocks

* default

* many to many

---------

Co-authored-by: Carlos R. L. Rodrigues <rodrigolr@gmail.com>
2025-04-02 10:46:51 +02:00
Kasper Fabricius Kristensen
f441362f4a feat(medusa,core-flows,types,js-sdk): Draft Order workflows and API endpoints (#11805) 2025-04-02 10:23:33 +02:00
Riqwan Thamir
c870a7a1ba fix(utils,promotion): fix case where mutliple percentage promotions werent applied (#11992)
what:

- fix case where mutliple percentage promotions werent applied
2025-03-26 22:46:50 +00:00
Riqwan Thamir
1f8fab3636 feat(core-flows,types,order,cart): assign tax lines only to regular products (#11994)
what:

- assign tax lines only to regular products
2025-03-26 22:26:34 +00:00
Frane Polić
d0d2ea4f20 fix(order): caculate received total for pending difference (#11919)
**What**
- use the return received total to compute pending difference with return requested total

**Why**
- this would show incorrect outstanding amount when receiving a return and also, the outstanding amount after the return is received would be incorrect
2025-03-25 18:14:44 +00:00
Harminder Virk
aa6d5aa3cf fix: register locking provider with its unique id (#11874) 2025-03-18 15:04:47 +05:30
Riqwan Thamir
5ab15a2988 feat(dashboard,js-sdk,admin-shared): add customer addresses + layout change (#11871)
what:

- changes customer layout from 1 layout to 2
- adds ability to create and delete customer addresses
- adds 2 customer widget locations
- adds is_giftcard=false by default to products list

<img width="1663" alt="Screenshot 2025-03-08 at 21 34 02" src="https://github.com/user-attachments/assets/e66f05da-718c-4c25-81ce-67ba0a814ca3" />
2025-03-17 16:16:27 +00:00
Riqwan Thamir
cb6249320e fix(types,order,medusa): Create credit lines + hooks (#11569)
what:

- api/workflows to create credit lines
- hooks to enable extending credit lines
2025-03-17 15:20:59 +00:00