Commit Graph

383 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
Jan Biardzki
257e71f988 fix(core-flows): fix update tax lines to apply tax rule by product type (#13202)
* test(draft-order): add draft order creation test with tax application by product type

* fix: add `product_type.id` and `items.product_type_id` fields to order utilities

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-08-14 20:07:43 +02:00
Carlos R. L. Rodrigues
9725bff25d fix(index): logical operators (#13137) 2025-08-07 07:34:50 -03: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
Frane Polić
9fb5baa912 fix(core-flows): guest customer updates email to another guest account (#13037)
* fix(core-flows); guest customer updates email to another guest account

* wip: refactor test

* fix: refactor step, add testing

* fix: update test

* fix: string assertion in a test
2025-07-25 12:49:06 +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
Carlos R. L. Rodrigues
fa76f85bba fix(index): merge filterable fields schema (#12888) 2025-07-04 09:41:40 -03:00
Riqwan Thamir
9a62f359f1 fix(core-flows,workflows-sdk): compensate account holders only when its created (#12825)
* fix(core-flows,workflows-sdk): compensate account holders only when its created

* chore: remove only
2025-06-26 12:30:08 +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ć
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
Carlos R. L. Rodrigues
490bd7647f fix(core-flows): complete cart improvements (#12646)
* fix(core-flows): use cartId as transactionId and acquire lock to complete cart

* fix cart update compensation
2025-05-30 14:15:08 +01:00
Frane Polić
9866baa852 feat(core-flows,js-sdk,medusa,types): draft order delete (#12172) 2025-05-28 14:37:00 +02:00
Carlos R. L. Rodrigues
ebe5cc7acd chore(index): return ids only (#12543) 2025-05-20 11:16:02 -03:00
Carlos R. L. Rodrigues
c661e06488 fix(index): query builder handle json array (#12480)
* fix(index): query builder handle json array

* fix sales channel event names
2025-05-14 18:43:01 +02:00
Oli Juhl
92af52d133 fix(tax): Make system provider registration backward compatible (#12441)
* fix(tax): Make provider registration backward compatible

* add tests
2025-05-12 17:06:43 +02:00
Frane Polić
5fe0e8250d fix(core-flows): Refund and recreate payment session on cart complete failure (#12263) 2025-05-11 19:53:49 +02:00
Frane Polić
47700899ed fix(core-flows): use product title for line item title (#12397)
* fix(core-flows): use prduct title for line item title

* fix: module tests

* fix: http tests

* fix: display item subtitle instead of prod title as secondary text in line item

* fix: claim/exchange items
2025-05-11 17:05:46 +02:00
Adrien de Peretti
091041f2da test(core-flows): Ensure productVariantUpdated failure compensate the workflow (#12381) 2025-05-09 13:03:22 +02:00
Adrien de Peretti
221c73f4a8 test(workflow-engine): Ensure failed subscriber does not compensate workflows (#12427)
* test(workflow-engine): Ensure failed subscriber does not compensate workflows

* test(workflow-engine): Ensure failed subscriber does not compensate workflows
2025-05-09 13:02:35 +02:00
Frane Polić
9cedeb182d feat(dashboard, js-sdk, medusa, tax, types): custom tax providers (#12297)
* wip: setup loaders, add endpoints, module work, types, js sdk

* fix: tax module provider loader

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

* feat: edit form

* fix: rename param

* chore: changeset

* fix: don't default to system provider

* fix: admin fixes, dispalt tax provider

* fix: some tests and types

* fix: remove provider from province regions in test

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

* fix: OE test

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

* feat: migrate script

* fix: refactor

* chore: use query graph

* feat: provider section
2025-05-06 19:26:33 +02:00
Carlos R. L. Rodrigues
b868a4ef4d feat(index): add filterable fields to link definition (#11898)
* feat(index): add filterable fields to link definition

* rm comment

* break recursion

* validate read only links

* validate filterable

* gql schema array

* link parents

* isInverse

* push id when not present

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

* log and fallback to entity.alias

* cleanup and fixes

* cleanup and fixes

* cleanup and fixes

* fix get attributes

* gql type

* unit test

* array inference

* rm only

* package.json

* pacvkage.json

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

* link parents as array

* Match only parent entity

* rm comment

* remove hard coded schema

* extend types

* unit test

* test

* types

* pagination type

* type

* fix integration tests

* Improve performance of in selection

* use @@ to filter property

* escape jsonPath

* add Event Bus by default

* changeset

* rm postgres analyze

* estimate count

* new query

* parent aliases

* inner query w/ filter and sort relations

* address comments

---------

Co-authored-by: adrien2p <adrien.deperetti@gmail.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-04-29 12:10:31 +02:00
Harminder Virk
552dc52228 test: use shared as integration-tests level (#12278) 2025-04-28 18:41:19 +05:30
Adrien de Peretti
2f6963a5fb fix(): Event group id propagation and event managements (#12157) 2025-04-14 15:57:52 -03:00
Carlos R. L. Rodrigues
31abba8cde fix(orchestrator): save checkpoint before async step (#12138) 2025-04-10 15:36:36 +00:00
Pedro Guzman
8804ca2f9c fix: allow backorder variants to be added to cart even if no locations (#12083)
* fix: allow backorder variants to be added to cart even if no locations

* document and unit test prepareConfirmInventoryInput
2025-04-09 19:15:42 +02:00
Carlos R. L. Rodrigues
f615ebb7e8 chore: retry util on tests (#12126) 2025-04-09 16:07:05 +00:00
Adrien de Peretti
13e159d8ad fix(workflow-engine-*): Prevent passing shared context reference (#11873)
* fix(workflow-engine-*): Prevent passing shared context reference

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

* prevent tests from hanging

* fix event handling

* add integration tests

* use interval for scheduled in tests

* skip tests for now

* Create silent-glasses-enjoy.md

* fix cancel

* changeset

* push multiple aliases

* test multiple field alias

* increase wait time to index on test

---------

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
Co-authored-by: Carlos R. L. Rodrigues <rodrigolr@gmail.com>
2025-04-09 10:39:29 +02:00
Harminder Virk
d3e725a907 feat: add hasMany flag to enforce in app link uniqueness (#12039)
* feat: add createMultiple flag to enforce inApp link uniqueness

* changes

* mocks

* default

* many to many

---------

Co-authored-by: Carlos R. L. Rodrigues <rodrigolr@gmail.com>
2025-04-02 10:46:51 +02:00
Harminder Virk
b1b3b48474 feat: Set pricing context hook (#11891) 2025-03-28 15:17:52 +05:30
Riqwan Thamir
1f8fab3636 feat(core-flows,types,order,cart): assign tax lines only to regular products (#11994)
what:

- assign tax lines only to regular products
2025-03-26 22:26:34 +00:00
Frane Polić
de8c034d1b feat(core-flows, types): calculated shipping in RMA flows (#11533)
* wip: calculated SO pricing in RMA flows

* fix: types

* chore: small refactor

* feat: caluclated shipping in return flow

* fix: module integrations

* fix: array containing

* feat: refresh shipping on update item quantity

* rm: log

* rm: log2

* feat: update interface, remove flag

* fix: revert change on OE for now

* fix: import

* feat: refactor flwos, cleanup cacluation cotext data model, wip exchanges

* feat: refreshing inbound/outbound shipping on items change

* feat: refresh exchange shipping on return item add, test

* feat: refresh shipping on exchange/return item remove

* fix: check optional

* feat: test recalculation on quantity update

* feat: calculated shipping on claims

* fix: comment

* wip: address comments

* fix: more remote query, fix build

* refactor: claim refresh workflow

* fix: remove throw option

* fix: deconstruct param

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-03-24 07:07:47 +01:00
Riqwan Thamir
cb6249320e fix(types,order,medusa): Create credit lines + hooks (#11569)
what:

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