Commit Graph

1372 Commits

Author SHA1 Message Date
Leonardo Benini
9c957e1da0 chore(core-flows): only allow published products in addToCartWorkflow (#13182)
Closes #13163 

I have a few questions about expected behaviour, since this currently breaks some tests:

- Many tests use the productModule to create products, with default status == "draft", and use the addToCart workflow which now throws. Should I change all breaking tests to specify status == "published" whne creating the product? The alternative would be to check the status in the store API route before the workflow but 1. it would be an extra query and 2. the addToCart workflow is only used in the store currently, and even if it was to be used admin-side, it still doesn't make sense to add a draft product to cart

- After this PR an unpublished product would give the same error as a variant that doesn't exist. While imho this is correct, the thrown error (for both) is "Items  do not have a price" which doesn't make much sense(i believe the workflows goes through with an empty variants list and then errors at the price check point). Should I throw a different error when a variant doesn't exists/isn't published?


---

> [!NOTE]
> Enforces that only variants from published products can be added to carts, adds status fetching, refines errors, and updates tests to use ProductStatus.PUBLISHED.
> 
> - **Core Flows**:
>   - addToCart: Validate variants exist and belong to `product.status = PUBLISHED`; throw clear `INVALID_DATA` when not found/unpublished.
>   - Data fetching: Include `product.status` in `cart` and `order` variant field selections.
> - **Tests/Fixtures**:
>   - Update integration tests to set `status: ProductStatus.PUBLISHED` when creating products and import `ProductStatus` where needed.
>   - Add cases for unpublished products and non-existent variants producing the new error message.
> 
> <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit ca72532e957964d2d8e6bcecbb0905054c677ded. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup>
2025-10-02 12:31:53 +00:00
Adrien de Peretti
b9d6f73320 Feat(): distributed caching (#13435)
RESOLVES CORE-1153

**What**
- This pr mainly lay the foundation the caching layer. It comes with a modules (built in memory cache) and a redis provider.
- Apply caching to few touch point to test

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
2025-09-30 16:19:06 +00:00
William Bouchard
087887fefb feat(core-flows): support ad hoc returns (#13598)
* feat(core-flows): support ad hoc returns

* fix: missing transform

* handle edge case

* refactor

* replace gte for gt

* cleanup

* weird bug fix

* add test

* Create quick-nails-kick.md

* stop sending empty strings

* add code to refund reason

* fix build

* fix tests

* handle code in dashboard

* fix tests

* more tests failing

* add reference and reference id to credit lieng

* rework create refund form
2025-09-30 07:38:50 -04:00
William Bouchard
9d3c71fefd fix(medusa): cart now returns 404 when not found (#13622)
FIXES #10218 
FIXES CORE-739
2025-09-30 06:49:17 +00:00
William Bouchard
5346079d47 chore(): create default refund reasons (#13591)
* chore(): create default refund reasons

* Create great-donuts-swim.md

* woops

* woopsie

* woopsie

* tests

* tests

* woopsie

* fml

* fix: comment
2025-09-28 10:07:48 +02:00
Adrien de Peretti
5ea32aaa44 fix(): Cart workflow price calculation for different items but same variant (#13511)
RESOLVES CORE-1204

**What**
- Fix wrong price tier when multiple items are targetting the same variant
- fix type import from the wrong package

**Notes**
If you are struggling navigating the changes, you can focus on the following files:
```
integration-tests/http/__tests__/cart/store/cart.spec.ts
integration-tests/modules/__tests__/cart/store/cart.workflows.spec.ts
packages/core/core-flows/src/cart/steps/get-promotion-codes-to-apply.ts
packages/core/core-flows/src/cart/steps/get-variant-price-sets.ts
packages/core/core-flows/src/cart/workflows/add-to-cart.ts
packages/core/core-flows/src/cart/workflows/create-carts.ts
packages/core/core-flows/src/cart/workflows/get-variants-and-items-with-prices.ts
packages/core/core-flows/src/cart/workflows/refresh-cart-items.ts
packages/core/core-flows/src/order/workflows/add-line-items.ts
packages/core/core-flows/src/order/workflows/create-order.ts
```
2025-09-26 07:19:46 +00:00
Hakim Saoudi
a501364b2d fix(product): Correctly fetch category descendants by handle (#13579)
This PR fixes the issue #13518  where product category descendants were not retrieved when
filtering by handle with the include_descendants_tree flag. The handle filter was not
being correctly removed before the descendant tree query was executed.
2025-09-23 14:40:31 +00:00
Adrien de Peretti
e39c472a84 Feat(): faster entity serializer (#13564)
**What**
Improve serialization further on complex entities to reduce bottleneck.

**Notes**
It might good at some point to integrate these improvements into mikro orm package 📦 


**Load test**
The test is using autocanon and wrap the serializers call behind http end points.
Each product has 2 variants, 3 options and 3 options values.

autocanon is configured for 10 connections during 20 second and 1 pipelining. This is repeated for each configuration and each catch size.

    🚀 Load Testing Serializers with Autocannon
    ================================================================================

    ====================================================================================================
    🎯 TESTING 10 PRODUCTS
    ====================================================================================================
    🖥️  Server started on port 57840
    📊 Testing with 10 products per request

    🔥 Load testing: MikroOrm
    --------------------------------------------------
       Requests/sec: 33.85
       Avg Latency: 319.30ms
       P90 Latency: 327.00ms
       Throughput: 31.36 MB/s
       Errors: 0

    🔥 Load testing: Current
    --------------------------------------------------
       Requests/sec: 821.15
       Avg Latency: 11.67ms
       P90 Latency: 12.00ms
       Throughput: 0.18 MB/s
       Errors: 0

    🔥 Load testing: Optimized
    --------------------------------------------------
       Requests/sec: 1286.75
       Avg Latency: 7.25ms
       P90 Latency: 7.00ms
       Throughput: 37.31 MB/s
       Errors: 0

    📈 Load Testing Performance Comparison for 10 products:
    --------------------------------------------------------------------------------------------------------------------------------------------
    Serializer      Requests/sec    Avg Latency (ms)   P90 Latency (ms)   Throughput (MB/s)  Errors     RPS Improvement
    --------------------------------------------------------------------------------------------------------------------------------------------
    MikroOrm        33.85           319.30             327.00             31.36              0          baseline
    Current         821.15          11.67              12.00              0.18               0          24.3x
    Optimized       1286.75         7.25               7.00               37.31              0          38.0x

    🎯 Key Insights for 10 products:
       • Optimized serializer handles 1.6x more requests/sec than Current
       • Optimized serializer handles 38.0x more requests/sec than MikroOrm
       • 37.9% lower latency compared to Current  serializer

    🔴 Server stopped for 10 products test

    ====================================================================================================
    🎯 TESTING 100 PRODUCTS
    ====================================================================================================
    🖥️  Server started on port 57878
    📊 Testing with 100 products per request

    🔥 Load testing: MikroOrm
    --------------------------------------------------
       Requests/sec: 3.69
       Avg Latency: 3241.29ms
       P90 Latency: 4972.00ms
       Throughput: 35.04 MB/s
       Errors: 0

    🔥 Load testing: Current
    --------------------------------------------------
       Requests/sec: 87.45
       Avg Latency: 117.20ms
       P90 Latency: 116.00ms
       Throughput: 0.02 MB/s
       Errors: 0

    🔥 Load testing: Optimized
    --------------------------------------------------
       Requests/sec: 143.56
       Avg Latency: 70.62ms
       P90 Latency: 72.00ms
       Throughput: 42.22 MB/s
       Errors: 0

    📈 Load Testing Performance Comparison for 100 products:
    --------------------------------------------------------------------------------------------------------------------------------------------
    Serializer      Requests/sec    Avg Latency (ms)   P90 Latency (ms)   Throughput (MB/s)  Errors     RPS Improvement
    --------------------------------------------------------------------------------------------------------------------------------------------
    MikroOrm        3.69            3241.29            4972.00            35.04              0          baseline
    Current         87.45           117.20             116.00             0.02               0          23.7x
    Optimized       143.56          70.62              72.00              42.22              0          38.9x

    🎯 Key Insights for 100 products:
       • Optimized serializer handles 1.6x more requests/sec than Current
       • Optimized serializer handles 38.9x more requests/sec than MikroOrm
       • 39.7% lower latency compared to Current  serializer

    🔴 Server stopped for 100 products test

    ====================================================================================================
    🎯 TESTING 1,000 PRODUCTS
    ====================================================================================================
    🖥️  Server started on port 57930
    📊 Testing with 1000 products per request

    🔥 Load testing: MikroOrm
    --------------------------------------------------
       Requests/sec: 0.00
       Avg Latency: 0.00ms
       P90 Latency: 0.00ms
       Throughput: 0.00 MB/s
       Errors: 10

    🔥 Load testing: Current
    --------------------------------------------------
       Requests/sec: 0.00
       Avg Latency: 0.00ms
       P90 Latency: 0.00ms
       Throughput: 0.00 MB/s
       Errors: 20

    🔥 Load testing: Optimized
    --------------------------------------------------
       Requests/sec: 13.79
       Avg Latency: 792.94ms
       P90 Latency: 755.00ms
       Throughput: 41.47 MB/s
       Errors: 0

    📈 Load Testing Performance Comparison for 1000 products:
    --------------------------------------------------------------------------------------------------------------------------------------------
    Serializer      Requests/sec    Avg Latency (ms)   P90 Latency (ms)   Throughput (MB/s)  Errors     RPS Improvement
    --------------------------------------------------------------------------------------------------------------------------------------------
    MikroOrm        0.00            0.00               0.00               0.00               10         NaNx
    Current         0.00            0.00               0.00               0.00               20         NaNx
    Optimized       13.79           792.94             755.00             41.47              0          Infinityx

    🎯 Key Insights for 1000 products:
       • Optimized serializer handles Infinityx more requests/sec than Current
       • Optimized serializer handles Infinityx more requests/sec than MikroOrm
       • -Infinity% lower latency compared to Current  serializer

    🔴 Server stopped for 1000 products test


    ======================================================================================================================================================
    📊 COMPREHENSIVE AUTOCANNON LOAD TESTING ANALYSIS
    ======================================================================================================================================================

    🚀 Autocannon Load Testing Scaling Analysis:
    --------------------------------------------------------------------------------------------------------------------------------------------
    Size         RPS (M/O/Op)         Avg Latency (M/O/Op)   P90 Latency (M/O/Op)   Throughput MB/s (M/O/Op)  Speedup vs M (O/Op) Speedup vs O (Op)
    --------------------------------------------------------------------------------------------------------------------------------------------
    10           33.9/821.1/1286.8    319.3/11.7/7.3         327.0/12.0/7.0         31.4/0.2/37.3             24.3x/38.0x        1.6x
    100          3.7/87.5/143.6       3241.3/117.2/70.6      4972.0/116.0/72.0      35.0/0.0/42.2             23.7x/38.9x        1.6x
    1,000        0.0/0.0/13.8         0.0/0.0/792.9          0.0/0.0/755.0          0.0/0.0/41.5              NaNx/Infinityx     Infinityx

    🎯 Overall Load Testing Performance Summary:

       📈 10 products:
          • +56.7% more requests/sec vs Current  (821.1 → 1286.8)
          • +3701.3% more requests/sec vs MikroOrm (33.9 → 1286.8)

       📈 100 products:
          • +64.2% more requests/sec vs Current  (87.5 → 143.6)
          • +3790.5% more requests/sec vs MikroOrm (3.7 → 143.6)

       📈 1000 products:
          • +Infinity% more requests/sec vs Current  (0.0 → 13.8)
          • +Infinity% more requests/sec vs MikroOrm (0.0 → 13.8)
2025-09-22 17:02:10 +00:00
Adrien de Peretti
12a96a7c70 chore(): Move peer deps into a single package and re export from framework (#13439)
* chore(): Move peer deps into a single package and re export from framework

* WIP

* update core packages

* update cli and deps

* update medusa

* update exports path

* remove analyze

* update modules deps

* finalise changes

* fix yarn

* fix import

* Refactor peer dependencies into a single package

Consolidate peer dependencies into one package and re-export from the framework.

* update changeset

* Update .changeset/brown-cows-sleep.md

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>

* rm deps

* fix deps

* increase timeout

* upgrade version

* update versions

* update versions

* fixes

* update lock

* fix missing import

* fix missing import

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-09-22 18:36:22 +02:00
Adrien de Peretti
4c1c1dd4c0 chore(): Further improve promotions computation (#13556)
* chore(): Further improve promotions

* chore(): Further improve promotions

* chore(): Further improve promotions

* chore(): Further improve promotions

* chore(): Further improve promotions

* Create lazy-lemons-occur.md

* chore(): Further improve promotions

* WIP

* fix

* improve:

* fix attribute tests

* fix tests

* union
2025-09-19 21:34:35 +02:00
Bastien
bb6cc586f7 feat: Add metadata to shipping options endpoints (#13554) 2025-09-19 12:28:20 +02:00
github-actions[bot]
174b5b1cb7 chore: Version Packages (#13494)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-09-18 18:38:07 +02:00
Sebastian Rindom
41047b3854 feat(dashboard): configurable product views (#13408)
* feat: add a reusable configurable data table

* fix: cleanup

* fix: cleanup

* fix: cache invalidation

* fix: test

* fix: add configurable products

* feat: add configurable product table

* fix: build errors+table style

* fix: sticky header column

* add translations

* fix: cleanup counterenderer

* fix: formatting

* fix: client still skips nulls

* fix: test

* fix: cleanup

* fix: revert client bracket format

* fix: better typing

* fix: add placeholder data to product list
2025-09-18 18:27:17 +02:00
Carlos R. L. Rodrigues
9563ee446f fix(utils,core-flows): subtotal calculation and returns location (#13497)
* fix(utils,core-flows): subtotal calculation and returns location

* changeset

* fix test

* var

* rm extra field from test

* fix original total

* fix partial refunds and pending difference

* fix test

* fix test

* test

* extract to util

* original total and update payment when receive return

* original_subtotal

* default fields

* test

* calculate pending difference

* revert claims test

* pending difference

* creadit line fix

* if
2025-09-18 17:50:40 +02:00
Oli Juhl
76497fd40a fix(core-flows): Lock cart on shipping update (#13535) 2025-09-17 21:29:45 +02:00
Adrien de Peretti
c847f7d8bf test(): Try to reproduce automatic promotion adjustments being applied twice (#13533)
**What**
Check that cart update will remove adjustment before creating a new one

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-09-17 18:24:27 +00:00
William Bouchard
1071296236 feat(core-flows): hook to set shipping opt context when listing (#13468)
* feat(core-flows): add hook to set shipping option context when listing them

* changeset

* add integration test

* add it to other workflow

* missing hook in workflow response

* rework workflow

* rework workflow

* typing issue

* comment from oli

* cursor the goat

* tests

* save lines

* move code around

* missing additional params in many places

* smal fix

* smal fix
2025-09-17 19:20:02 +02:00
Frane Polić
8565dcfc46 fix(core-flows, medusa): don't allow negative line item quantity (#13508)
* fix(core-flows,medusa): don't allow negative line item quantity

* fix: greater than 0

* feat: add test

* wip: update update item flow to remove item when qty is 0

* fix: paralelize

* fix: when argument

* fix: emit event
2025-09-16 11:54:20 +02:00
Adrien de Peretti
25634b0382 test(): test dynamic max workers and improve CI (#13516)
* test(): test dynamic max workers

* test(): test dynamic max workers

* test(): test dynamic max workers

* test(): test dynamic max workers

* test(): test dynamic max workers

* test(): test dynamic max workers

* test(): test dynamic max workers

* test(): test dynamic max workers

* test(): test dynamic max workers

* test(): test dynamic max workers

* test(): test dynamic max workers

* test(): test dynamic max workers

* test(): test dynamic max workers

* test(): test dynamic max workers

* test(): test dynamic max workers

* test(): test dynamic max workers

* Clarify test description and improve CI
2025-09-16 11:11:03 +02:00
Adrien de Peretti
ebf33bea43 fix(): pipeline missing suites (#13457)
* fix(): pipeline missing suites

* fix tax integration tests

* fix tax integration tests

* fix pipeline

* fix link integration tests

* remove old tests and move current one

* fix workflow execution integration tests

* fix tests and orchestrator

* Fix missing suites in pipeline

Remove integration-tests-modules from patch list.
2025-09-15 12:54:57 +02:00
github-actions[bot]
6525ac5c1c chore: Version Packages (#13354)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-09-12 15:42:43 +02:00
William Bouchard
4fded2602b fix(medusa,product): fix ordering product categories (#13487)
CLOSES CORE-1191

cc @SteelRazor47
2025-09-11 21:18:40 +00:00
Adrien de Peretti
de9a21a9da chore(): Improve link indexes (#13459)
RESOLVE CORE-1183

**What**
Update link indexes to include deleted_at index constraint
2025-09-11 07:44:13 +00:00
William Bouchard
e0943f3c90 fix(medusa): stop loading entry points in exec command (#13438) 2025-09-09 18:10:56 +00:00
Amirkhon
1b681a79da feat(dashboard,currency): added Tajikistani somoni currency (#13178)
* added Tajikistani somoni currency

* updated currencies.ts

* changeset

* updated changeset

---------

Co-authored-by: William Bouchard <46496014+willbouch@users.noreply.github.com>
2025-09-09 13:03:39 -04:00
Carlos R. L. Rodrigues
71d8a0031f fix(index): index enum fields (#13428)
https://github.com/medusajs/medusa/issues/13372

What:
 - It handles enum fields corretly when added to filterable fields
2025-09-07 13:39:58 +00:00
Carlos R. L. Rodrigues
bd571aca82 chore(orchestration): remote joiner query planner (#13364)
What:
 - Added query planning to the Remote Joiner, enabling phased and parallel execution of data aggregation.
- Replaced object deletes with non-enumerable property hiding to improve performance.
2025-09-04 14:18:02 +00:00
William Bouchard
faae150a58 fix(utils): big bumber should give numeric value of 0 for small numbers (#13394)
* fix(utils): big bumber should give numeric value of 0 for small numbers

* circular dep

* fix imports

* fix infinite loop

* fix test

* changeset
2025-09-03 13:45:41 -04:00
William Bouchard
2f6edf367a feat(dashboard,cart,types,utils): refine order details summary (#13313)
* feat(dashboard,types,utils): refine order details summary

* fix tests

* changeset

* ui corrections

* tests again

* weird tests failing

* revert update to subtotal

* revert http tests too

* comments

* move credit lines so it makes more sense

* remove currency codes and add bold prices

* add new properties in default for storefront

* minor to patch

* remove bold on things that should be

* olis comment about taxes

* remove bold from shipping
2025-09-02 20:50:37 +02:00
Adrien de Peretti
bd206cb250 chore(): improve workflow engine storage (#13345)
* chore(workflow-engines): Improve race condition management

* cleanup

* cleanup

* chore(workflow-engines): Improve race condition management

* chore(workflow-engines): Improve race condition management

* chore(workflow-engines): heartbeat extend TTL

* Refactor chore title for workflow engine improvements

* chore(): Improve workflow execution db interaction

* chore(): Improve workflow execution db interaction

* chore(): Improve workflow execution db interaction

* chore(): Improve workflow execution db interaction

* chore(): Improve workflow execution db interaction

* chore(): Improve workflow execution db interaction

* chore(): Improve workflow execution db interaction

* chore(): Improve workflow execution db interaction

* chore(): Improve workflow execution db interaction

* update tests

* revert idempotent

* add run_id index + await deletion

* improve saving

* comment

* remove only

---------

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
2025-09-02 11:18:12 +02:00
Carlos R. L. Rodrigues
b4c0f131b7 chore(framework,medusa): load custom flags before medusa config (#13312)
* chore(framework,medusa): load custom flags before medusa config

* test

* test runner

* changeset

* check manager featureFlags

* discover and register flags

* rm comments

* update changeset

* changeset

* use local cli

* execute from local medusa command

---------

Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
2025-09-01 16:04:43 +02:00
Riqwan Thamir
ca038ff583 feat(promotion): Allow buyget promotion to apply multiple times on cart (#13305)
what:

Introduces 2 new features to promotion module:

1. Introduce max quantity limit to promotion application - This will limit the application of the promotion based on the quantity of the target products in the cart. 
2. When applying buy get promotions, we will now apply buyget promotion until eligible items are exhausted or max quantity is reached. 

```
- Buy 2 t-shirts, Get 1 sweater
- Max quantity -> 1

This means you can add two t-shirts, and get 1 sweaters for free. However, if you add four t-shirts, you only get one sweater for free.
```

```
- Buy 2 t-shirts, Get 1 sweater
- Max quantity -> 3

This means you can add six t-shirts, and get three sweaters for free. However, if you add eight t-shirts, you only get three sweaters for free
```

```
- Buy 4 t-shirts, Get 2 sweater
- Max quantity -> 1

This should throw on creation, as the max quantity should as a minimum be the same value as the target rule quantity
```

RESOLVES SUP-2357 / https://github.com/medusajs/medusa/issues/13265
2025-08-31 13:35:36 +00:00
github-actions[bot]
6dca59d0a5 chore: Version Packages (#13338)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-28 22:58:13 +02:00
Carlos R. L. Rodrigues
8176d0f684 chore(core-flows): revert idempotent cart (#13336) 2025-08-28 22:45:43 +02:00
github-actions[bot]
08ec3ed9f2 chore: Version Packages (#13209)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-28 17:25:32 +02:00
Carlos R. L. Rodrigues
9412669e65 chore: idempotent cart operations (#13236)
* chore(core-flows): idempotent cart operations

* changeset

* add tests

* revert

* revert route

* promo test

* skip bugs

* fix test

* tests

* avoid workflow name conflict

* prevent nested workflow from being deleted until the top level parent finishes

* remove unused setTimeout

* update changeset

* rm comments

---------

Co-authored-by: adrien2p <adrien.deperetti@gmail.com>
2025-08-28 15:04:00 +02:00
Carlos R. L. Rodrigues
f764b3a364 feat(index): $nin and $not operators (#13289)
* feat(index): add $not and $nin operators

* logical operator

* test

* test

* types

* logical

* schema ID

* types and $ilike fix

* index type
2025-08-28 11:56:17 +02:00
Oli Juhl
b3fb0f7634 chore: Revert #13189 (#13318) 2025-08-28 11:46:01 +02:00
Frane Polić
6b04fbcc50 fix(core-flows): pass backorder flag when recreating reservations after fulfilment cancelation (#13076) 2025-08-27 21:22:03 +02:00
Frane Polić
71818e43cb fix(medusa): fetching a product without a category with categories filed passed (#13020)
**What**
- adding `categories` to `fields` param would return 404 for an existing product if the product was not associated with a category

---

CLOSES CMRC-1046
2025-08-26 16:35:41 +00:00
Carlos R. L. Rodrigues
e413cfefc2 feat(utils): define file config (#13283)
** What
 - Allow auto-loaded Medusa files to export a config object.
 - Currently supports isDisabled to control loading.
 - new instance `FeatureFlag` exported by `@medusajs/framework/utils`
 - `feature-flags` is now a supported folder for medusa projects, modules, providers and plugins. They will be loaded and added to `FeatureFlag`

** Why
 - Enables conditional loading of routes, migrations, jobs, subscribers, workflows, and other files based on feature flags.

```ts
// /src/feature-flags

import { FlagSettings } from "@medusajs/framework/feature-flags"

const CustomFeatureFlag: FlagSettings = {
  key: "custom_feature",
  default_val: false,
  env_key: "FF_MY_CUSTOM_FEATURE",
  description: "Enable xyz",
}

export default CustomFeatureFlag
```

```ts
// /src/modules/my-custom-module/migration/Migration20250822135845.ts

import { FeatureFlag } from "@medusajs/framework/utils"

export class Migration20250822135845 extends Migration {
  override async up(){ }
  override async down(){ }
}

defineFileConfig({
  isDisabled: () => !FeatureFlag.isFeatureEnabled("custom_feature")
})
```
2025-08-26 12:22:30 +00:00
Adrien de Peretti
fc49253273 feat(core, event-bus): Compensate emit event step utility (#13281)
* feat(core, event-bus): Compensate emit event step utility

* tests

* Update changeset to remove integration-tests-modules

Removed integration-tests-modules from changeset.

* revert test script
2025-08-25 15:08:09 +02:00
Adrien de Peretti
6264a6262b fix: Cart operation should calculate item prices accounting for quantity (#13251)
* fix(): Cart operation should calculate item prices accounting for quantity

* fix(): Cart operation should calculate item prices accounting for quantity

* fix(): Cart operation should calculate item prices accounting for quantity

* fix when call warning

* fix tests and remove unnecessary object copy

* Create warm-dancers-allow.md

* fix update line item in cart workflow

* fix changeset

* update order flows

* fix cart spec integration tests

* improve create order workflow

* fixes and tests adjustments/improvements

* configurable useQueryGraphStep return type

* revert nullable take

* cleanup useQueryGraphStep
2025-08-25 09:38:58 +02:00
Adrien de Peretti
06ef9197f8 chore(pricing): Fix excessive db queries during price sets update (#13258)
* chore(pricing): Fix excessive db queries during price sets update

* chore(pricing): Fix excessive db queries during price sets update

* finalize upsert with replace of the rules

* fix limit

* Create quiet-pumpkins-hang.md

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-08-22 10:51:50 +02:00
Frane Polić
492e018957 feat(dashboard, core-flows, js-sdk, types, medusa): listing order's shipping options (#13242)
* feat(dashboard, core-flows,js-sdk,types,medusa): listing order's shipping option

* fix: typo

* chore: migrate claim form

* fix: cleanup rule logic

* feat: add test case, rm params

* fix: expand location name
2025-08-21 13:01:27 +02:00
William Bouchard
6602e893b8 chore(medusa): fetch shipping related attributes (#13244)
* chore(medusa): fet shipping related attributes

* some tests

* changeset

* small refactor

* typing

* adapt attribute value

* test

* test again
2025-08-20 13:03:27 -04:00
Oli Juhl
b152210554 feat(core-flows): Refresh adjustments when editing orders (#13189)
* wip

* add tests

* add more tests

* fixes buy-get promotion

* Create empty-pillows-promise.md

* chore: use query graph

* Update packages/core/core-flows/src/order/workflows/order-edit/refresh-order-edit-adjustments.ts

Co-authored-by: Frane Polić <16856471+fPolic@users.noreply.github.com>

---------

Co-authored-by: Frane Polić <16856471+fPolic@users.noreply.github.com>
2025-08-20 15:04:27 +02:00
Frane Polić
2f594291ad fix(core-flows, dashboard, types): improve allocation flows on Admin (#12572)
**What**
- handle single inventory items with `required_quantity > 1` correctly in the allocate UI flow
- display correct availability amount in the create fulullment form for inventory kit items
- fix check in the create fulfillment flow that would allow negative reservation because `required_quantity` wasn't included in the check
- show the most recent reservations first in the reservations table
- display an error in the allocation form if a reservation is not created for some inventory items 
- display inventory kit in the order summary if the product has multiple same inventory items

---

CLOSES SUP-1655
2025-08-19 18:48:24 +00:00
William Bouchard
67d3660abf feat(dashboard, core-flows): associate shipping option to type (#13226)
* feat(dashboard, core-flows): allow associating shipping option type to a shipping option

* edit as well

* fix translation schema

* fix some tests

* changeset

* add new test to update shipping option type

* add new test to create shipping option with shipping option type

* pr comments

* pr comments

* rename variable

* make zod great again
2025-08-19 11:02:36 -04:00
Carlos R. L. Rodrigues
fd4e791428 fix(utils): auto generated update method return (#13225)
* fix(utils): auto generated update method return

* tests

* cleanup

* rm unused function

* Update .changeset/young-mangos-suffer.md

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-08-18 13:26:36 +02:00