## Summary
**What** — What changes are introduced in this PR?
Allow payment session `captured` to be processable upon cart completion.
**Why** — Why are these changes relevant or necessary?
Without it it is impossible to complete a cart that has an already captured payment session.
**How** — How have these changes been implemented?
Added `captured` to the processable payment session status list in the complete cart workflow payment validation step.
**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
Add any additional context, related issues, or references that might help the reviewer understand this PR.
Closes CORE-1361
* Include locale field for traslations on tax line workflows
* Translate tax lines in getItemTaxLinesStep with new util
* Update tax calculation context, so that we pass locale to third party tax providers if they want to return translated tax rates
* Apply translations to tax lines on product and variant tax middlewares
* Cart management translations tests
* Update tax lines when order locale gets updated
* Add changeset
* Get tranlsated tax lines step
* Fix wording
* Mutate ref directly
* Update order tax lines translations upon order locale change
* Claims translations tests
* Update tax lines upon draft order locale update
* Exchange tests for tax lines translations
* Order edits test for tax line translation
* Add tests for shipping methods tax line translations on various order flows
* Returns shipping method translations tests
* Execute update in parallel
* Use TranslationFeatureFlag.key
* Fix feature flag import
* Add @medusajs/medusa dependency for feature flag usage
* Revert "Add @medusajs/medusa dependency for feature flag usage"
This reverts commit e8897aed0a88f83c1034ac73e817e4222250a2c9.
* Use feature flag string directly
* Fix test
* Parallelize tax line translations application
* Avoid throwing prices not found error when line item is custom unit price
* Add changeset
* Avoid throwing upo variant price validation for custom priced item variants
## Summary
**What** — What changes are introduced in this PR?
Export Zod as a dependency of `@medusajs/framework`.
Closes DX-2414
**Why** — Why are these changes relevant or necessary?
Zod is an essential part of Medusa development. We use it in the core and developers use it in their customizations.
Developers using pnpm won't have access to Zod, as it's not a top-level dependency. While they can install any version, since Zod is an essential aspect of our framework, it's more convenient that we export it and make it accessible to developers.
**How** — How have these changes been implemented?
1. Add Zod as a dependency in `@medusajs/deps` and export it in `@medusajs/framework`
2. Change imports of Zod across projects to import from `@medusajs/framework` and remove the Zod dependency.
> Note: this change doesn't cover admin extensions (and our related packages), as they're not related to the Medusa framework and using Zod in them isn't part of the conventions we document.
Developers can import Zod like this now:
```ts
import { z } from "@medusajs/framework/zod"
```
**Testing** — How have these changes been tested, or how can the reviewer test the feature?
Use the following import in a Medusa project to create an validate zod schemas:
```bash
import { MedusaRequest, MedusaResponse } from "@medusajs/framework/http";
import { z } from "@medusajs/framework/zod"
export const PostCustomSchema = z.object({
name: z.string(),
})
type PostCustomSchema = z.infer<typeof PostCustomSchema>
export async function POST(
req: MedusaRequest<PostCustomSchema>,
res: MedusaResponse
) {
res.json({
message: `Hello, ${req.validatedBody.name}`
})
}
// in middleware
import { defineMiddlewares, validateAndTransformBody } from "@medusajs/framework/http"
import { PostCustomSchema } from "./admin/custom/route"
export default defineMiddlewares({
routes: [
{
matcher: "/custom",
middlewares: [validateAndTransformBody(PostCustomSchema)],
},
],
})
```
---
## Examples
-
---
## 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
-
* feat(translation): Add support for locale to the graph query
* feat(translation): Add support for locale to the graph query
* feat(translation): Add support for locale to the graph query
* feat(translation): fix import
* fix
* cleanup
* fix context in product routes
* Create dull-onions-punch.md
* Avoid checking existent inventory item on fulfillment cancellation for variants without managed inventory
* Add changeset
* Dismiss existent variant inventory links when updating to unmanaged inventory
* Update input type and step name
* Dismiss inventory when variant is updated to unmanaged inventory
* Review changes
* Fix
* Fix
* Comments
* Include Map to avoid iterating unnecessarily
## Summary
**What**
Adds metadata field for reset password route that allows passing data from caller that can be found in the subscriber.
## 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]
> Introduces optional request `metadata` for reset-password and propagates it through to event subscribers.
>
> - Accepts `metadata` in `ResetPasswordRequest` validator and `reset-password` route; forwards it to `generateResetPasswordTokenWorkflow`
> - Workflow now accepts `metadata` and includes it in emitted `auth.password_reset` event data
> - Updates event docs to mention `metadata` field
> - Adds integration test verifying `metadata` is emitted in the password reset event
>
> <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 7f9855feabed284336e8872eebfb18fe3bd320db. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup>
* Add Translations route and guard it with feature flag. Empty TranslationsList main component to test route.
* Translation list component
* Add translations namespace to js-sdk
* Translations hook
* Avoid incorrectly throwing when updating and locale not included
* Translations bulk editor component v1
* Add batch method to translations namespace in js-sdk
* Protect translations edit route with feature flag
* Handle reference_id search param
* Replace entity_type entity_id for reference reference_id
* Manage translations from product detail page
* Dynamically resolve base hook for retrieving translations
* Fix navigation from outside settings/translations
* Navigation to bulk editor from product list
* Add Translations to various product module types
* Type useVariants hook
* Handle product module entities translations in bulk editor
* Fix categories issue in datagrid due to column clash
* Translations bulk navigation from remaining entities detail pages
* Add remaining bulk editor navigation for list components. Fix invalidation query for variants
* Expandable text cell v1
* Popover approach
* Add *supported_locales.locale to default fields in stores list endpoint
* Make popover more aligned to excell approach
* Correctly tie the focused cell anchor to popover
* Rework translations main component UI
* Fix link def export
* Swap axis for translations datagrid
* Add original column to translations data grid
* Remove is_default store locale from backend
* Remove ldefault locale from ui
* Type
* Add changeset
* Comments
* Remove unused import
* Add translations to admin product categories endpoint allowed fields
* Default locale removal
* Lazy loading with infinite scroll data grid
* Infinite list hook and implementation for products and variants
* Translation bulk editor lazy loaded datagrid
* Prevent scroll when forcing focus, to avoid scrollTop reset on infinite loading
* Confgiure placeholder data
* Cleanup logs and refactor
* Infinite query hooks for translatable entities
* Batch requests for translation batch endpoint
* Clean up
* Update icon
* Add query param validator in settings endpoint
* Settings endpoint param type
* JS sdk methods for translation settings and statistics
* Retrieve translatable fields and entities dynamically. Remove hardcoded information from tranlations list
* Resolve translation aggregate completion dynamically
* Format label
* Resolve bulk editor header label dynamically
* Include type and collection in translations config
* Avoid showing product option and option values in translatable entities list
* Translations
* Make translations bulk editor content columns wider
* Disable hiding Original column in translations bulk editor
* Adjust translations completion styles
* Fix translations config screen
* Locale selector switcher with conditional locale column rendering
* Batch one locale at a time
* Hooks save actions to footer buttons
* Reset dirty state on save
* Dynamic row heights for translations bulk editor. Replace expandable cell for text cell, with additional isMultiLine config
* Make columns take as much responsive width as possible and divide equally
* more padding to avoid unnecessary horizontal scrollbar
* Update statistics graphs
* Translations
* Statistics graphs translations
* Translation, text sizes and weight in stat graphs
* Conditionally show/hide column visibility dropdown in datagrid
* Allow to pass component to place in DataGrid header and use it in translations bulk editor
* Center text regardless of multiLine config
* Apply full height to datagrid cell regardles of multiSelect config
* Colors and fonts
* Handle key down for text area in text cell
* MultilineCell with special keydown handling
* Rework form schema to match new single locale edit flow
* Update created translations to include id, to avoid duplication issue on subsequent calls
* Handle space key for text cells
* Finish hooking up multiline cell with key and mouse events
* Disable remaining buttons when batch is ongoing
* Style updates
* Update style
* Refactor to make form updates and sync/comparison with server data more comprehensive and robust
* Update styles
* Bars and labels alignment
* Add languages tooltip
* Styles and translation
* Navigation update
* Disable edit translations button when no reference count
* Invert colors
---------
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
* feat: order export
* Merge branch 'develop' of https://github.com/medusajs/medusa into feat/order-export
* normalize status
* rm util
* serialize totals
* test
* lock
* comments
* configurable order list
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.)
* 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
* 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>
## 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
* 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