Commit Graph

1564 Commits

Author SHA1 Message Date
Adrien de Peretti
f13c23a4b7 feat(): Sync order translations (#14267)
* feat(): Sync order translations

* feat(): Sync order translations

* tests

* Create tender-melons-develop.md

* fix tests

* cleanup

* cleanup
2025-12-11 15:40:11 +01:00
Nicolas Gorga
70929ecac3 fix(dashboard,medusa,types): improve performance for price list prices retrieval (#14138)
## Summary

**What** — What changes are introduced in this PR?

Price lists prices didn't have a dedicated method to query them and instead, relied on being returned as part of price lists. This, however, introduces optimization issues that for price lists with many prices, could cause crashes. The reason being that relations are not paginated and thus, all prices linked to the price list would be returned.

This PR aims to solve this by introducing a dedicated endpoint and avoiding returning the `prices` as part of price lists by default. The idea being that it is up to the user to explicitly express this, which, for small price lists no issues will arise, but for bigger ones, they will easily recognize the performance impact.

**Why** — Why are these changes relevant or necessary?  

Users with large enough price lists would have serious performance issues or even crashes when querying the `/admin/price-lists` endpoints. This is also true when navigating to the price list section of the Admin UI since it queries this same endpoints.

**How** — How have these changes been implemented?

- Removed the `prices` relation to be part of the default fields returned by the `/admin/price-lists/` endpoints. User may still request it by passing it in `fields` query param.
- Added new `/admin/price-lists/[id]/prices` GET endpoint to be able to retrieve a price list prices with pagination.

**Testing** — How have these changes been tested, or how can the reviewer test the feature?

Integration tests.

---

## Examples

Provide examples or code snippets that demonstrate how this feature works, or how it can be used in practice.  
This helps with documentation and ensures maintainers can quickly understand and verify the change.

```ts
// Example usage
```

---

## Checklist

Please ensure the following before requesting a review:

- [x] I have added a **changeset** for this PR
    - Every non-breaking change should be marked as a **patch**
    - To add a changeset, run `yarn changeset` and follow the prompts
- [x] The changes are covered by relevant **tests**
- [x] I have verified the code works as intended locally
- [x] I have linked the related issue(s) if applicable

---

## Additional Context

The current state of the PR fixes the issue on the price list list and detail component. It still doesn't solve the issue for the following screens: Edit Prices & Add Prices

All the prices are still retrieved from the `/admin/price-lists/` endpoint for these. I want first some feedback before changing it to the new endpoint, since the current DataGrid implementation doesn't support pagination and it seems we are passing a default limit for the products to show there, an arbitrarily large number 9999 and there is also a TODO comment of changing that.

This previous point, though, could be implemented in a later PR, so we can already fix the issue in the price list list and detail pages, so at least for large price lists these screens don't explode and smaller price lists can still have its product prices edited, while only large ones will explode when trying to perform this action. @adrien2p @fPolic thoughts?

closes ENTSUP-265, CORE-1239
2025-12-11 13:13:08 +00:00
olivermrbl
237b472e73 chore: Version packages 2025-12-11 14:10:54 +01:00
Shahed Nasser
a78f68fa46 fix(utils,core-flows): add events constant for translations and use it in workflows (#14277) 2025-12-11 11:22:08 +02:00
Adrien de Peretti
fd3965974d feat(): Pluralized props for list readonly link (#14190)
* feat(): Pluralized props for list readonly link

* Create perfect-jeans-end.md

* handle backward compat

* Add tests case
2025-12-10 19:38:06 +01:00
Oli Juhl
bca145bdbe chore: Add locks to order edit flows (#14270) 2025-12-10 17:55:03 +01:00
Adrien de Peretti
e4877616c3 feat(): sync cart translation synced (#14226)
ref: https://github.com/medusajs/medusa/pull/14189

  **Summary**

  This PR extends the translation module to support automatic translation syncing for cart line items based on the cart's locale.

  Key changes:
  - Added locale field to the Cart model to store the cart's locale preference
  - Created new workflow steps:
    - getTranslatedLineItemsStep - Translates line items when adding to cart or creating a cart
    - updateCartItemsTranslationsStep - Re-translates all cart items when the cart's locale changes
  - Integrated translation logic into cart workflows:
    - createCartWorkflow - Applies translations to initial line items
    - addToCartWorkflow - Applies translations when adding new items
    - updateCartWorkflow - Re-translates all items when locale_code is updated
    - refreshCartItemsWorkflow - Maintains translations during cart refresh
  - Added applyTranslationsToItems utility to map variant/product/type/collection translations to line item fields (title, subtitle, description, etc.)
2025-12-10 08:37:30 +00:00
Adrien de Peretti
356283c359 chore(): Accept an extra agument 'all-or-nothing' on the migrate command (#14262)
* chore(): Accept an extra agument 'all-or-nothing' on the migrate command

* Create rich-camels-brush.md

* chore(): Accept an extra agument 'all-or-nothing' on the migrate command

* chore(): Accept an extra agument 'all-or-nothing' on the migrate command

* chore(): Accept an extra agument 'all-or-nothing' on the migrate command

* chore(): fix broken down migrations

* chore(): update changeset
2025-12-10 09:23:41 +01:00
Nicolas Gorga
fdc2b722d9 fix(core-flows, medusa): Prevent cart addresses duplication on update (#13841)
* Allow id field in addresses properties for cart update validator

* Update cart addresses in update step where id is provided, both reference and nested fields

* Add tests

* Add changeset

* Remove unnecessary map step

* Review changes
2025-12-09 21:49:16 -03:00
Nicolas Gorga
4dbf46f2cb fix(utils): avoid inflating refundable_total for tax inclusive pricing (#14237)
* Prevent refundable_total inflation for tax inclusive item pricing

* Add tests

* Add changeset

* Update changeset

* Review changes
2025-12-09 19:28:22 +01:00
Shahed Nasser
cc84b9ac49 chore: improvements of TSDocs of link steps (#14261) 2025-12-09 16:59:15 +02:00
Adrien de Peretti
6dc0b8bed8 feat(): Introduce translation module and preliminary application of them (#14189)
* feat(): Translation first steps

* feat(): locale middleware

* feat(): readonly links

* feat(): feature flag

* feat(): modules sdk

* feat(): translation module re export

* start adding workflows

* update typings

* update typings

* test(): Add integration tests

* test(): centralize filters preparation

* test(): centralize filters preparation

* remove unnecessary importy

* fix workflows

* Define StoreLocale inside Store Module

* Link definition to extend Store with supported_locales

* store_locale migration

* Add supported_locales handling in Store Module

* Tests

* Accept supported_locales in Store endpoints

* Add locales to js-sdk

* Include locale list and default locale in Store Detail section

* Initialize local namespace in js-sdk

* Add locales route

* Make code primary key of locale table to facilitate upserts

* Add locales routes

* Show locale code as is

* Add list translations api route

* Batch endpoint

* Types

* New batchTranslationsWorkflow and various updates to existent ones

* Edit default locale UI

* WIP

* Apply translation agnostically

* middleware

* Apply translation agnostically

* fix Apply translation agnostically

* apply translations to product list

* Add feature flag

* fetch translations by batches of 250 max

* fix apply

* improve and test util

* apply to product list

* dont manage translations if no locale

* normalize locale

* potential todo

* Protect translations routes with feature flag

* Extract normalize locale util to core/utils

* Normalize locale on write

* Normalize locale for read

* Use feature flag to guard translations UI across the board

* Avoid throwing incorrectly when locale_code not present in partial updates

* move applyTranslations util

* remove old tests

* fix util tests

* fix(): product end points

* cleanup

* update lock

* remove unused var

* cleanup

* fix apply locale

* missing new dep for test utils

* Change entity_type, entity_id to reference, reference_id

* Remove comment

* Avoid registering translations route if ff not enabled

* Prevent registering express handler for disabled route via defineFileConfig

* Add tests

* Add changeset

* Update test

* fix integration tests, module and internals

* Add locale id plus fixed

* Allow to pass array of reference_id

* fix unit tests

* fix link loading

* fix store route

* fix sales channel test

* fix tests

---------

Co-authored-by: Nicolas Gorga <nicogorga11@gmail.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-12-08 19:33:08 +01:00
Nicolas Gorga
fea3d4ec49 fix(core-flows): Access orderItem.variant safely inside convertDraftOrderWorkflow when containing custom items (#14233)
* Access orderItem variant safely on convert draft order workflow

* Tests

* Add changest

* Remove .only from test
2025-12-08 08:56:05 -03:00
Adrien de Peretti
fe49b567d6 chore: Backend HMR (expriemental) (#14074)
**What**

 This PR introduces experimental Hot Module Replacement (HMR) for the Medusa backend, enabling developers to see code changes reflected immediately without restarting the server. This significantly improves the development experience by reducing iteration time.

### Key Features

  - Hot reload support for:
    - API Routes
    - Workflows & Steps
    - Scheduled Jobs
    - Event Subscribers
    - Modules
  - IPC-based architecture: The dev server runs in a child process, communicating with the parent watcher via IPC. When HMR fails, the child process is killed and restarted, ensuring
  clean resource cleanup.
  - Recovery mechanism: Automatically recovers from broken module states without manual intervention.
  - Graceful fallback: When HMR cannot handle a change (e.g., medusa-config.ts, .env), the server restarts completely.


### Architecture
```mermaid
  flowchart TB
      subgraph Parent["develop.ts (File Watcher)"]
          W[Watch Files]
      end

      subgraph Child["start.ts (HTTP Server)"]
          R[reloadResources]
          R --> MR[ModuleReloader]
          R --> WR[WorkflowReloader]
          R --> RR[RouteReloader]
          R --> SR[SubscriberReloader]
          R --> JR[JobReloader]
      end

      W -->|"hmr-reload"| R
      R -->|"hmr-result"| W
```

### How to enable it

Backend HMR is behind a feature flag. Enable it by setting:

```ts
  // medusa-config.ts
  module.exports = defineConfig({
    featureFlags: {
      backend_hmr: true
    }
  })
```

or

```bash
export MEDUSA_FF_BACKEND_HMR=true
```

or

```
// .env
MEDUSA_FF_BACKEND_HMR=true
```

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
2025-12-08 08:48:36 +00:00
Shahed Nasser
b517137466 fix(utils): fix error when generating migrations for a module with existing snapshot (#14218) 2025-12-08 08:54:32 +02:00
Nicolas Gorga
842c0f5007 fix(core-flows): refresh payment collection inside updateCartPromotionsWorkflow (#13963)
* Refresh payment collection after cart promotion update

* Add missing test

* Add changeset

* Update changeset

* Add force_refresh_payment_collection to updateCartPromotionsWorkflow to conditionally refresh payment collection

* Prevent refreshing payment collection multiple times

* Fix test

* Formatting and unused vars

---------

Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
2025-12-05 15:27:21 -03:00
Adrien de Peretti
9f7846ae0b chore(): revert route loading parallelization (#14204)
**What**
To prevent undeterministic route loading, remove route loading concurrency
2025-12-03 13:54:31 +00:00
olivermrbl
ba275a33bb chore: Version packages 2025-12-03 09:20:02 +01:00
Adrien de Peretti
391d8dc6cd fix(): event emitting (#14196)
* fix(): event emitting

* Create rude-queens-deny.md

* fix(): store subscriber should not be constraint

* Update rude-queens-deny.md

* Add tests to prevent regression
2025-12-03 08:53:09 +01:00
Shahed Nasser
92769b2b1c chore: fixes to TSDocs (#14186)
* chore: fixes to TSDocs

* update comments for auth provider
2025-12-02 11:57:04 +02:00
olivermrbl
1d4af32749 chore: Version packages 2025-12-01 18:54:07 +01:00
Frane Polić
8ddf8b4d76 fix: skip promotion usage limit checks on edit flows (#14176)
* fix: skip promotion usage limit checks on edit flows

* feat: add test check
2025-12-01 18:29:15 +01:00
Shahed Nasser
3cf1e5e9de chore: change 2.11.4 to 2.12.0 in TSDocs (#14174) 2025-12-01 17:33:28 +02:00
Pepijn
83dd1b616a chore: Add missing order metadata for create fulfillment (#14028)
* Add missing order metadata for create fulfillment

* Update .changeset/blue-olives-wave.md

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

---------

Co-authored-by: Frane Polić <16856471+fPolic@users.noreply.github.com>
2025-12-01 16:18:40 +01:00
Frane Polić
b74ef4a784 fix(fulfillment): make relationship between SO and SO type M:1 (#14061)
* fix(fulfillment): make relationship between SO and SO type M:1

* fix: test and types, remap type id to existing column

* Fix typo

* Fix typo

* chore: update changeset

* fix: typo

---------

Co-authored-by: Nicolas Gorga <62995075+NicolasGorga@users.noreply.github.com>
2025-12-01 16:16:29 +01:00
Shahed Nasser
ee1be833c3 chore: improve completeCartWorkflow TSDocs (#14153)
* chore: improve completeCartWorkflow TSDocs

* small improvement
2025-12-01 14:20:07 +02:00
Nicolas Gorga
3e2991e447 fix(core-flows): create reservations on draft order conversion to regular order (#14010)
## Summary

**What** — What changes are introduced in this PR?

Avoid creating reservations when draft order edits are confirmed and rather, create them when the draft order is converted into a regular order.

**Why** — Why are these changes relevant or necessary?  

While the order is a draft, creating reservations would potentially block inventory for regular order requests, when the draft represents a non materialized state of a purchase that might never be completed or at a latter point in time.

**How** — How have these changes been implemented?

Removed the reservation creations inside of `confirmDraftOrderEditWorkflow` and instead do it inside `convertDraftOrderWorkflow`

**Testing** — How have these changes been tested, or how can the reviewer test the feature?

Added integration tests.

---

## Examples

Provide examples or code snippets that demonstrate how this feature works, or how it can be used in practice.  
This helps with documentation and ensures maintainers can quickly understand and verify the change.

```ts
// Example usage
```

---

## Checklist

Please ensure the following before requesting a review:

- [x] I have added a **changeset** for this PR
    - Every non-breaking change should be marked as a **patch**
    - To add a changeset, run `yarn changeset` and follow the prompts
- [x] The changes are covered by relevant **tests**
- [x] I have verified the code works as intended locally
- [x] I have linked the related issue(s) if applicable

---

## Additional Context

Add any additional context, related issues, or references that might help the reviewer understand this PR.

fixes #13773 
closes SUP-2523
2025-12-01 12:08:03 +00:00
Shahed Nasser
73ae136965 chore: improve and add TSDocs for next release (#14170) 2025-12-01 13:41:31 +02:00
Shahed Nasser
00aa2c13bc fix(js-sdk,types,medusa): add HTTP types for update order change API route (#14169)
## Summary

**What** — What changes are introduced in this PR?

- Add HTTP type for update order API route payload + use it in the JS SDK and API route
- other: add `since` tag

**Why** — Why are these changes relevant or necessary?  

*Please provide answer here*

**How** — How have these changes been implemented?

*Please provide answer here*

**Testing** — How have these changes been tested, or how can the reviewer test the feature?

*Please provide answer here*

---

## Examples

Provide examples or code snippets that demonstrate how this feature works, or how it can be used in practice.  
This helps with documentation and ensures maintainers can quickly understand and verify the change.

```ts
// Example usage
```

---

## Checklist

Please ensure the following before requesting a review:

- [ ] I have added a **changeset** for this PR
    - Every non-breaking change should be marked as a **patch**
    - To add a changeset, run `yarn changeset` and follow the prompts
- [ ] The changes are covered by relevant **tests**
- [ ] I have verified the code works as intended locally
- [ ] I have linked the related issue(s) if applicable

---

## Additional Context

Add any additional context, related issues, or references that might help the reviewer understand this PR.
2025-12-01 11:28:08 +00:00
Frane Polić
536a3f802c feat: promotion usage limit (#13760)
* feat: promotion usage limit

* fix: update, refactor tests, parallel case

* fix: batch update, cleanup unused map

* feat: paralel campaign and promotion tests

* chore: changesets, fix i18 schema

* fix: ui tweaks

* chore: refactor

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-11-30 19:43:36 +01:00
Frane Polić
5da51064d7 feat: carry over promotions toggle on exchanges (#14128)
* feat: carry over promotions toggle on exchanges

* fix: inital flag value, return the flag on preview

* fix: validation of allocation type

* fix: revert client changes

* fix: invert condition

* feat: recompute adjustments when outbound item is updated

* fix: condition again

* fix: display more accurate inbound/outbound totals for exchanges

* fix: make exchanges specs green

* feat: more testing cases

* wip: pr feedback

* fix: use plural for the flag on Admin

* fix: schema test, route refactor

* feat: tooltip

* feat: refactor to use update workflow

* feat: display applied promotion per item on order details, show copy sku on hover

* feat: refactor edits and exchanges to have common flag toggle flow

* fix: delete empty file

* fix: exchange_id param query
2025-11-30 19:31:31 +01:00
Adrien de Peretti
6057afdfaa chore(): Add new regression tests to the remote joiner (#14119)
* Add tests

* Add tests

* Add tests
2025-11-27 09:31:25 +01:00
Shahed Nasser
e8990133e5 chore: fix payloads of events in TSDocs + description of emitEventStep (#14132) 2025-11-26 18:00:21 +02:00
Carlos R. L. Rodrigues
5725837ba8 fix(orchestration): fetch fields from link entities (#14097)
* fix(orchestration): fetch fields from link entities

* args
2025-11-25 11:35:05 +01:00
Nicolas Gorga
0e73d8d5e3 fix(core-flows): lock mark as delivered fulfillment/order flows (#14111)
* Lock markFulfillmentAsDeliveredWorkflow with fulifllment id

* Lock markOrderFulfillmentAsDeliveredWorkflow by orderId before calling markFulfillmentAsDeliveredWorkflow

* Add changeset
2025-11-25 06:56:10 -03:00
Oli Juhl
78842af1c3 fix: Compute "virtual" adjustments for order previews (#13306)
* wip

* add wip

* wip

* reuse action

* finish first draft

* fix tests

* cleanup

* Only compute adjustments when necessary

* Create hot-carrots-look.md

* address comments

* minor tweaks

* fix pay col

* fix test

* wip

* Dwip

* wip

* fix: adjustment typo

* fix: import

* fix: workflow imports

* wip: update test

* feat: upsert versioned  adjustments when previewing order

* fix: revert unique codes change

* fix: order spec test with versioning

* wip: save

* feat: make adjustments work for preview and confirm flow, wip base repo filtering of older version adjustments

* fix: missing populate where

* wip: populate where loading versioned adjustments

* fix: filter out older adjustment versions

* temp: comment adjustments in repo

* test: add adjustment if no version

* wip: configure populate where in order base repository

* fix: rm manual filtering

* fix: revert base repo changes

* fix: revert

* fix: use order item version instead of order version

* fix: rm only in test

* fix: update case spec

* fix: remove sceanrio, wip test with draft promotion

* feat: test correct adjustments when disabling promotion

* feat: complex test case

* feat: test consecutive order edits

* feat: 2 promotions test case with a fixed promo

* feat: migrate existing order line item adjustments to order items latest version

* feat: update dep after merge

* wip: load adjustments separatley

* feat: adjustments collections

* fix: spread result, handle related entity case

* fix: update lock

* feat: make sure version is loaded, refactor, handle related entity case

* fix: check fields

* feat: loading adjustments for list and count

* fix: correct items version field

* fix: rm empty array

* fix: wip order modules spec

* fix: order module specs

* feat: preinit items adjustments

* fix: rm only

* fix: rm only

* chore: cleanup

* fix: migration files

* fix: dont change formatting

* fix: core package build

* chore: more cleanup

* fix: item update util

* fix: duplicate import

* fix: refresh adjustments for exchanges (#13992)

* wip: exchange adjustments

* feat: test - receive items

* feat: finish test case

* fix: casing

* fix(draft-orders, core-flows, orders) refresh adjustments for draft orders (#14025)

* wip: draft orders adjustments refresh

* feat: rewrite to use REPLACE action + test

* fix: rm only

* feat: cleanup old REPLACE actions

* feat: cleanup adjustemnts when 0 promotions

* wip: canceling draft order

* fix: make version arg optional

* fix: restore promotion links

* feat: test reverting on cancelation

* fix: address comments in tests

* wip: fix summary on preview

* fix: get pending diff on preview summary from total

* fix: revert pending diff change

---------

Co-authored-by: fPolic <mainacc.polic@gmail.com>
Co-authored-by: Frane Polić <16856471+fPolic@users.noreply.github.com>
2025-11-25 10:41:14 +01:00
Pedro Guzman
b81f958d41 Add provider data to notifications (#14104)
## Summary

**What** —
Add a providerData field to notifications

**Why** —
We need the ability to pass dynamic fields to specific providers. E.g. CC and BCC for emails

**How** —
Just adding the field to the model

**Testing** —
Added the field to existing tests

## Checklist

Please ensure the following before requesting a review:

- [x] I have added a **changeset** for this PR
    - Every non-breaking change should be marked as a **patch**
    - To add a changeset, run `yarn changeset` and follow the prompts
- [x] The changes are covered by relevant **tests**
- [x] I have verified the code works as intended locally
- [ ] I have linked the related issue(s) if applicable



---

> [!NOTE]
> Adds `provider_data` to notifications (types, workflow input, DB model/migration) and forwards it in the Medusa Cloud Email provider, with tests updated accordingly.
> 
> - **Data/Schema**:
>   - Add `provider_data` (`jsonb`) to `notification` model and DB via migration `Migration20251121150408` and snapshot update.
> - **Types/DTOs**:
>   - Add optional `provider_data` to `CreateNotificationDTO`, `NotificationDTO`, and `ProviderSendNotificationDTO`.
> - **Workflows**:
>   - Extend `send-notifications` step input with `provider_data`.
> - **Providers**:
>   - Medusa Cloud Email: include `provider_data` in outgoing request payload.
> - **Tests**:
>   - Update integration tests to pass and assert `provider_data` propagation.
> - **Changeset**:
>   - Patch bumps for `@medusajs/notification`, `@medusajs/core-flows`, `@medusajs/types`.
> 
> <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 6f114c75c974a145ef60213637d7c41bc605a0bf. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup>
2025-11-24 09:18:47 +00:00
Pedro Guzman
f67bfb9f92 add from to notification model (#14102) 2025-11-24 09:24:38 +01:00
Nicolas Gorga
0cb12021ef fix(core-flows): Add discountable properties in queried fields to avoid overriding discountable properties when set (#14105)
* Add discountable properties to avoid applying adjustments to non discountable line items

* Add changeset
2025-11-24 09:24:24 +01:00
Nicolas Gorga
79582bc94e fix(core-flows): prevent completing cart from webhook when order already exists (#14108)
* Prevent completing cart when order already exists in processPaymentWorkflow

* Add tests

* Add changeset
2025-11-24 09:23:39 +01:00
Adrien de Peretti
beb91d88a2 chore(): Update glob package (#14083)
* chore(): Update glob package

* Create fresh-needles-wave.md
2025-11-19 21:53:32 +01:00
Nathan John
929607f692 fix(fulfillment) Variants changed from managed inventory to unmanaged are now fulfillable (#14056)
* (fix) Variants changed from managed inventory to unmanaged are now fulfillable

* Changeset

* Update dull-donkeys-ring.md
2025-11-19 17:01:36 +01:00
Adrien de Peretti
62d103b44f fix(payment): Double idempotent capture called with auto capture beha… (#14073)
* fix(payment): Double idempotent capture called with auto capture behaviour

* Create sweet-peaches-dress.md

* naming

* feedback

* naming
2025-11-18 10:50:50 +01:00
Adrien de Peretti
6746fecd72 chore(order): custom display id (#14024)
* chore(order): Accept a custom display generator option

* chore(order): Accept a custom display generator option

* wip

* wip

* finalize

* Create tricky-olives-battle.md

* fields

* changeset

* update integration tests

* update migrations

* fix changeset
2025-11-18 10:17:46 +01:00
Nicolas Gorga
0a0c2f41d8 fix(core-flows): avoid overriding customer and region from setPricingContext hook result (#14022)
## Summary

Updated context passed for each variant when calculating prices so that `region` and `customer` coming from `setPricingContext` are not overriden if provided.

*Please provide answer here*

Otherwise you can't provide your own `region` and `customer` objects with additional information and you are left with the ones we pass as part of the cart object to the workflows that execute the hook.

*Please provide answer here*

Changed the order in which we define the default `region` and `cart` fields, taking their value from the cart, to before the destructured `setPricingContextResult`.

*Please provide answer here*

**Testing** — How have these changes been tested, or how can the reviewer test the feature?

*Please provide answer here*

---

## Examples

Provide examples or code snippets that demonstrate how this feature works, or how it can be used in practice.  
This helps with documentation and ensures maintainers can quickly understand and verify the change.

```ts
// Example usage
```

---

## Checklist

Please ensure the following before requesting a review:

- [x] I have added a **changeset** for this PR
    - Every non-breaking change should be marked as a **patch**
    - To add a changeset, run `yarn changeset` and follow the prompts
- [ ] The changes are covered by relevant **tests**
- [x] I have verified the code works as intended locally
- [x] I have linked the related issue(s) if applicable

---

## Additional Context

fixes #13990 
closes SUP-2647


---

> [!NOTE]
> Adjust pricing context merge order so `setPricingContext`-provided `customer` and `region` are not overridden when calculating variant prices.
> 
> - **Core Flows (pricing)**:
>   - In `packages/core/core-flows/src/cart/workflows/get-variants-and-items-with-prices.ts`, change merge order when building `baseContext` so `customer` and `region` from `setPricingContextResult` take precedence over cart-derived values when pricing variants.
> - **Changeset**:
>   - Add patch changeset for `@medusajs/core-flows`.
> 
> <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 010da7340909016692bea183d022dd0585abdb5a. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup>
2025-11-17 18:59:24 +00:00
Adrien de Peretti
1ea932a56f fix(): Identify step that should require a save on checkpoint (#14037)
* fix(): Identify step that force save checkpoint

* Create sour-peas-provide.md
2025-11-17 12:47:57 +01:00
Adrien de Peretti
c2c3ad5ba5 chore(): Upgrade vit to non vulnerable one (#14042)
* chore(): Upgrade vit to non vulnerable one

* Create eight-dogs-allow.md

* remove unused global

* remove unused global

* remove unused global
2025-11-13 09:18:58 +01:00
Adrien de Peretti
e59cdae336 fix(): Proper schema usage when running migrations (#14036)
* fix(): Proper schema usage when running migrations

* Create thick-pugs-dance.md
2025-11-12 15:56:50 +01:00
Shahed Nasser
a85778679e fix(product, types): add missing types for variant images and thumbnails (#14026)
## Summary

**What** — What changes are introduced in this PR?

- Add missing `images` field of variants to the HTTP types
- Add missing `thumbnail` field to product variant schema, which leads to the thumbnail missing from auto generated types

**Why** — Why are these changes relevant or necessary?  

*Please provide answer here*

**How** — How have these changes been implemented?

*Please provide answer here*

**Testing** — How have these changes been tested, or how can the reviewer test the feature?

*Please provide answer here*

---

## Examples

Provide examples or code snippets that demonstrate how this feature works, or how it can be used in practice.  
This helps with documentation and ensures maintainers can quickly understand and verify the change.

```ts
// Example usage
```

---

## Checklist

Please ensure the following before requesting a review:

- [ ] I have added a **changeset** for this PR
    - Every non-breaking change should be marked as a **patch**
    - To add a changeset, run `yarn changeset` and follow the prompts
- [ ] The changes are covered by relevant **tests**
- [ ] I have verified the code works as intended locally
- [ ] I have linked the related issue(s) if applicable

---

## Additional Context

Add any additional context, related issues, or references that might help the reviewer understand this PR.
2025-11-11 15:25:39 +00:00
Adrien de Peretti
7e3eb6e413 chore: cleanup/improve bootstrap (#14023)
* chore: cleanup/improve bootstrap

* chore: cleanup/improve bootstrap

* Create few-guests-visit.md
2025-11-10 14:35:20 +01:00