429 Commits

Author SHA1 Message Date
William Bouchard
4b3c43fe92 feat(dashboard, js-sdk): shipping option type mngmt dashboard (#13208)
* chore(types, api): support shipping option type api endpoints

* core flows

* api

* typos

* compiler errors

* integration tests

* remove metadata

* changeset

* modify test

* upsert

* change remote query

* minor to patch

* description optional

* chore(dashboard, js-sdk): shipping option type management on admin dashboard

* description optional

* woops my bad

* my bad again

* create and edit

* prettier

* build code from label

* remove metadata route

* remove some translation text that is not used

* remove unsued files

* changeset

* adapt test

* fix test

* suggestion

---------

Co-authored-by: william bouchard <williambouchard@williams-MacBook-Pro.local>
2025-08-14 15:21:33 -04:00
William Bouchard
34c3c14e0a chore(types, api): support shipping option type api endpoints (#13191)
* chore(types, api): support shipping option type api endpoints

* core flows

* api

* typos

* compiler errors

* integration tests

* remove metadata

* changeset

* modify test

* upsert

* change remote query

* minor to patch

* description optional

* description optional

* woops my bad

* my bad again

---------

Co-authored-by: william bouchard <williambouchard@williams-MacBook-Pro.local>
2025-08-14 10:15:51 -04:00
github-actions[bot]
01fa17d2ad chore: Version Packages (#13045)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-14 13:23:45 +02:00
Oli Juhl
f4ae615a3e fix(tax): Use correct rule reference for shipping (#13195)
* fix(tax): Use correct rule reference

* fix tests
2025-08-13 21:06:19 +02:00
Riqwan Thamir
224eaedf5c fix(dashboard,promotion): percentage promotions + set currency code on percentage promotions (#13161) 2025-08-07 13:07:41 +02:00
William Bouchard
acf6bbc2ec chore(core-flows): throw error on invalid promo code (#13140)
* chore(core-flows): throw error on invalid promo code

* add changelog

* better error handling in test

---------

Co-authored-by: william bouchard <williambouchard@williams-MacBook-Pro.local>
Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
2025-08-05 09:01:41 -04:00
scherddel
51d4751d95 fix(utils): Fix on precision for high quantities for items when promotion is applied (#13131)
* Fix on precision for high quantities for items when promotion is applied

* Fix on precision for high quantities for items when promotion is applied
2025-08-03 19:16:16 +02:00
scherddel
9766570827 fix(types,utils,promotion): Move from total to original_total to resolve edge case for adjustments calculation (#13106)
* Move from total to original_total to resolve edge case in adjustment calculation

* Added changeset

* Added test case for correction

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-08-01 12:52:04 +02:00
tehaulp
881c8a4969 feat: added pacific franc currency (#13086) 2025-08-01 09:32:50 +02:00
scherddel
1bdf602f1c This fixes the discount_ calculation logic and promotion tax inclusiveness calculation (#12960)
* This fixes the discount_ calculation logic

* This fixes the adjustment to be handled as a subtotal value in every calculation and applies the tax inclusive logic on the promotion value itself

* Added some testcases and revoked some changes to improve testing output

* Fixed a test case based on feedback

* Corrected promotion/admin test cases

* Corrected cart/store test case

* Improved cart/store test cases for more robust promotion testing considering tax inclusion flags

* Remove unnessary changes as adjustments now automatically are subtotals and therefore the tax inclusive flag does not need to be applied again

* Remove adjustments->is_tax_inclusive usage everywhere

* Migration script to remove is_tax_inclusive in cart line item adjustment

* Forgot to adjust one more testcase

* Corrections based on fPolic feedback

* Refactored PR to consider feedback from oliver

* Added more testcases for promotion in cart

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-07-31 13:27:43 +02:00
Riqwan Thamir
75320e744f fix(promotion): check currency when computing actions for promotions (#13084)
* fix(promotion): check currency when computing actions for promotions

* chore: fix tests

* chore: fix more specs
2025-07-31 11:41:07 +02:00
github-actions[bot]
137ea0883d chore: Version Packages (#12924)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-24 09:41:35 +02:00
Frane Polić
439c711845 fix(dashboard, product): product attributes update with a relation update (#13019)
* fix(dashboard, product): product attributes update with a relation update

* fix: rm log

* chore: refactor
2025-07-23 21:01:50 +02:00
Frane Polić
40625c82d6 fix(core-flows): properly delete variant inventory item (#12958)
* fix(core-flows): properly delete variant inventory item

* fix: rm unused code
2025-07-16 21:16:29 +02:00
Christopher Seven Phiri
1797f0298b feat: Added Malawi kwacha to currency list (#12440)
* Add Malawi kwacha currency

* fix failing currency tests

---------

Co-authored-by: Stevche Radevski <sradevski@live.com>
2025-07-16 10:26:28 +02:00
Frane Polić
a28226af80 fix(core-flows): updating tax lines when draft order shipping is removed (#12919)
**What**
- don't call `updateOrderTaxLinesWorkflow` when a shipping method is removed from a draft order (tax lines will be cascade deleted with the method)
2025-07-14 13:35:44 +00:00
Riqwan Thamir
8c4228fc42 fix(link-modules,core-flows): Carry over cart promotions to order promotions (#12920)
what:

- Carry over cart promotions to order promotions
2025-07-11 08:05:20 +00:00
github-actions[bot]
b7aa719540 chore: Version Packages (#12883)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-08 19:49:15 +02:00
Oli Juhl
42be9a88d6 fix(medusa, core-flows): Update TIP on promotions (#12885)
* fix: Update TIP on promotions

* Create warm-rings-look.md

* only show for fixed discounts

* fix: handle type change

---------

Co-authored-by: fPolic <mainacc.polic@gmail.com>
Co-authored-by: Frane Polić <16856471+fPolic@users.noreply.github.com>
2025-07-08 19:20:29 +02:00
Oli Juhl
a7700f116f fix(order, core-flows): Tax inclusive order line item adjustments (#12875)
* fix(order, core-flows): Tax inclusive order line item adjustments

* fix test
2025-07-06 22:32:17 +02:00
Oli Juhl
46bf7ae7ae fix(core-flows): Locations levels check in draft order and order edit flows (#12881)
* fix: Inventory check

* mend

* centralise fields

* Create few-owls-push.md
2025-07-03 17:31:04 +02:00
github-actions[bot]
22396134b3 chore: Version Packages (#12832)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-06-30 16:16:24 +02:00
Adrien de Peretti
95d282e8ef fix: test utils events + workflow storage (#12834)
* feat(test-utils): Make event subscriber waiter robust and concurrent

* feat(test-utils): Make event subscriber waiter robust and concurrent

* fix workflows storage

* remove timeout

* Create gentle-teachers-doubt.md

* revert timestamp

* update changeset

* fix execution loop

* exit if no steps to await

* typo

* check next

* check next

* changeset

* skip when async steps

* wait workflow executions utils

* wait workflow executions utils

* wait workflow executions utils

* increase timeout

* break loop

---------

Co-authored-by: Carlos R. L. Rodrigues <rodrigolr@gmail.com>
Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
2025-06-30 13:34:08 +02:00
github-actions[bot]
628e8d22ee chore: Version Packages (#12691)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-06-25 11:41:13 +02:00
Adrien de Peretti
d517dbd66a feat(): Add support for jwt asymetric keys (#12813)
* feat(): Add support for jwt asymetric keys

* Create early-chefs-chew.md

* fix unit tests

* Add verify options support

* feedback

* fix unit tests
2025-06-25 10:29:32 +02:00
Adrien de Peretti
a833c3c98c fix(utils): build query withDeleted remove auto detection (#12788)
**What**
Currently, filtering data providing a `deleted_at` value will automatically apply the `withDeleted` flag which in turns remove the default constraint apply to all queries `deleted_at: null`. The problem is that it does not account for the value assign to `deleted_at` leading to inconsistent behaviour depending on the value. e.g filtering with `deleted_at: { $eq: null }` where the expectation is to only filter the non deleted record will end up returning deleted record as well by applying the `withDeleted` filters.

This pr revert this auto detection if favor of the user providing `withDeleted` explicitly, as it is already supported , plus the filters.

Further more, some integration tests demonstrate how to filter deleted records (e.g product) from the api. While the api did not properly support it, this pr adds support to pass with_deleted flags to the query and being handled accordingly to our api support. Validators have been updated and product list end point benefit from it. Also, the list config type was already accepting such value which I have translated to the remote query config.

Also, since the previous pr was adjusting the product types, I ve adjusted them to match the expectation
2025-06-25 07:51:37 +00:00
Ante Primorac
6ca755ede7 feat: Enable filtering admin products by variant EAN, UPC, and barcode (#12815)
* Add filters for variant ean, upc, and barcode in product queries and validators

* fix: Omit 'q' field from variants in product list and validation parameters

* Add tests for admin products filtering by variants ean, upc, and barcode

* Add changeset for filter admin products api by variant ean, upc, and barcode

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-06-25 09:17:01 +02:00
juanzgc
fbf33885f5 feat: Search by billing_address and shipping_address on Order model (#12814)
* feat: Search by billing_address and shipping_address on Order model

**What**
Added `.searchable()` method to the `shipping_address` and `billing_address` relationships in the `Order` model, enabling search functionality.

**Why**
Previously searching via `shipping_address` and `billing_address` was not supported, limiting the ability to find orders based on shipping or billing address information.

Resolves SUP-1838

* Update integration tests to include billing_address and non-existing addresses.
2025-06-25 09:16:40 +02:00
juanzgc
3826bde591 fix(medusa): Query Config update Order By filter (#12781)
**What**
Fixed a bug in the prepareListQuery function where nested field ordering was not properly building the expected nested object structure. The function was returning flat objects like { "employee.first_name": "ASC" } instead of the correct nested structure { "employee": { "first_name": "ASC" } }.

**Why**
The buildOrder function is designed to create nested objects from dot-notation field paths, which is essential for proper query building in the Medusa framework. When this functionality was broken, it prevented correct ordering of related fields and caused queries to fail or return unexpected results.

**How**
- Root cause: The `prepareListQuery` function was not properly utilizing the `buildOrder` utility function to transform dot-notation field paths into nested objects
- Before: order = "employee.first_name" → { "employee.first_name": "ASC" }
- After: order = "employee.first_name" → { "employee": { "first_name": "ASC" } }
- Added comprehensive tests: Created detailed unit tests for the prepareListQuery function focusing on buildOrder functionality, covering various scenarios including:
  - Simple ascending/descending order
  - Nested field ordering (e.g., product.title)
  - Deeply nested ordering (e.g., product.variants.prices.amount)
  - Multiple nesting levels (up to 5 levels deep)
- Added integration tests: Created integration tests in `product.spec.ts` to verify the full end-to-end functionality of nested ordering with variant titles

The fix ensures that the buildOrder function properly transforms dot-notation field paths into the expected nested object structure, enabling correct query building for related field ordering throughout the Medusa framework.

Resolves SUP-1868
2025-06-24 15:45:54 +00:00
Oli Juhl
b79215dd5c fix(utils): Typecasting non-text fields in FTS (#12729) 2025-06-13 13:18:50 +02:00
Adrien de Peretti
65f9333501 chore(): re enable integration tests bp (#12724)
* chore(): re enable integration tests bp

* chore(): re enable integration tests bp
2025-06-12 20:05:11 +02:00
Frane Polić
2621f00bb0 feat(promotion, dashboard, core-flows, cart, types, utils, medusa): tax inclusive promotions (#12412)
* feat: tax inclusive promotions

* feat: add a totals test case

* feat: add integration test

* chore: changeset

* fix: typo

* chore: refactor

* fix: tests

* fix: rest of buyget action tests

* fix: cart spec

* chore: expand integration test with item level totals

* feat: add a few more test cases

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-06-12 15:07:11 +02:00
Frane Polić
bd6d9777c5 fix(promotion, types): non discountable items check (#12644)
* fix(promotions): check if item is discountable

* fix: return earl yonly if non discountable

* fix: update test

* chore: add integration test
2025-06-12 10:23:06 +02:00
Harminder Virk
f2cb528a56 feat: wire up direct uploads with local file provider (#12643) 2025-06-10 15:07:54 +05:30
github-actions[bot]
68a796d300 chore: Version Packages (#12583)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-06-05 20:33:53 +02:00
Frane Polić
9866baa852 feat(core-flows,js-sdk,medusa,types): draft order delete (#12172) 2025-05-28 14:37:00 +02:00
Frane Polić
c4dd290461 fix(core-flows): reservation management on order edit and draft order confirm (#12546) 2025-05-28 09:52:01 +02:00
github-actions[bot]
5ad3615830 chore: Version Packages (#12576)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-22 14:04:27 +02:00
Frane Polić
c5a6573e26 fix(product, utils): handle metadata key deletion on product update (#12478) 2025-05-21 21:32:12 +02:00
Harminder Virk
fca5ad77b4 feat: process import from pre-processed chunks (#12527)
Fixes: FRMW-2968

In this PR we have done two major things.

- First, we remove storing CSV contents within the workflow storage and neither store the JSON payloads to be created/updated in workflows. Earlier, they all were workflow inputs, hence were stored in the workflow
- Introduce a naive concept of chunks and process chunks one by one. The next PR making chunking a bit more robust while using streams, adding ability to resume from the failed chunk and so on.

> [!IMPORTANT]  
> The new endpoint `/admin/product/imports` is not in use yet. But it will be after the next (final) PR.

## Old context in workflow storage

![CleanShot 2025-05-19 at 17 11 08@2x](https://github.com/user-attachments/assets/798bdcc9-a368-4c1f-afdd-2a77f5ce43e0)

## New context in workflow storage

![CleanShot 2025-05-19 at 17 15 08@2x](https://github.com/user-attachments/assets/0463d035-403f-4600-a9cd-5af24d5fee7c)
2025-05-20 12:33:18 +00:00
Harminder Virk
5cd4ff6fe7 test: remove snapshots usage (#12516)
* test: remove snapshots usage

* test: remove unneeded assertions

* Create plenty-poems-reply.md

* update tests

* update tests

---------

Co-authored-by: adrien2p <adrien.deperetti@gmail.com>
2025-05-16 16:11:01 +02:00
olivermrbl
8c0b49fed4 chore: Version packages 2025-05-16 11:04:39 +02:00
Frane Polić
9f4d32b220 fix(core-flows): fulfilment cancelation with shared inventory kit item (#12503)
* fix(core-flows): fulfilment cancelation with shared inventory kit item

* fix: typos, check if iitem exists

* chore: typo
2025-05-16 10:50:10 +02:00
Harminder Virk
e149a99886 feat: define validators and use normalize-products step (#12473)
Fixes: FRMW-2965

In this PR we replace/remove the existing step to normalize a CSV file with the newly written CSV normalizer and also we validate the file contents further using a Zod schema.

I have duplicated the schema for now. But it is makes sense to re-use the schema for CSV validating and `/admin/products/batch`, then I can keep one source of truth under utils and re-export it. WDYT?

**Screenshots of some errors after validating the file strictly**

![CleanShot 2025-05-15 at 16 36 46@2x](https://github.com/user-attachments/assets/c7fa424f-b947-4898-9b94-47c48617c129)

![CleanShot 2025-05-15 at 16 36 34@2x](https://github.com/user-attachments/assets/0fefef79-148b-4eeb-8ef0-3077e8063ea8)
2025-05-16 08:37:25 +00:00
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
olivermrbl
d3a5868e8b chore: Version packages 2025-05-13 12:56:07 +02:00
Frane Polić
39e5eadefc fix(core-flows, dashboard): reservation recreation on fulfilment cancel + allocation button display (#12447)
**What**
- fix recreation of reservations on fulfilment cancel
- fix allocate items button display

---

CLOSES CMRC-1018
2025-05-12 17:09:23 +00:00
Frane Polić
32e0194772 fix(dashboard, medusa): validate provider for top level tax regions (#12450)
* fix(dashboard, medusa): validate provider for top level tax regions

* chore: changesets, message

* chore: add test case for province

* fix: remove comment
2025-05-12 18:04:48 +02:00