Commit Graph
100 Commits
Author SHA1 Message Date
Carlos R. L. Rodrigues 65fae943c9 feat(orchestration): hydrate resultset (#11263)
What:
* Add support for aggregating data into existing resultset.
* `query.graph` new option `initialData` containing the resultset to be hydrated
* It fetches data where the requested fields are not present and merge with the existing resultset
2025-02-03 11:24:57 +00:00
Carlos R. L. Rodrigues c8376a9f15 chore(medusa): clear workflow execution (#11200)
CLOSES: SUP-704
2025-02-03 10:47:32 +00:00
Carlos R. L. Rodrigues e98d3c615e chore(orchestration): validate PK when throwIfKeyNotFound (#11190)
CLOSES: FRMW-2895
2025-01-29 19:17:36 +00:00
Carlos R. L. Rodrigues 5093224914 chore(index): config changes (#11121)
Closes FRMW-2884
2025-01-27 12:54:46 +00:00
Carlos R. L. Rodrigues a76208ed02 chore(utils): patch unique index migration (#11136) 2025-01-24 13:48:37 -03:00
Carlos R. L. Rodrigues 31384855af fix(fulfillment): migration so rules (#11113) 2025-01-23 12:43:32 +00:00
Carlos R. L. Rodrigues 5aa4797873 fix(fulfillment): migration so rules (#11109) 2025-01-23 11:50:11 +00:00
cc73802ab3 chore(order): dml (#10292)
* ../../core/types/src/dml/index.ts

* ../../core/types/src/dml/index.ts

* fix: relationships mapping

* handle nullable foreign keys types

* handle nullable foreign keys types

* handle nullable foreign keys types

* continue to update product category repository

* fix all product category repositories issues

* fix product category service types

* fix product module service types

* fix product module service types

* fix repository template type

* refactor: use a singleton DMLToMikroORM factory instance

Since the MikroORM MetadataStorage is global, we will also have to turn DML
to MikroORM entities conversion use a global bucket as well

* refactor: update product module to use DML in tests

* wip: tests

* WIP product linkable fixes

* continue type fixing and start test fixing

* test: fix more tests

* fix repository

* fix pivot table computaion + fix mikro orm repository

* fix many to many management and configuration

* fix many to many management and configuration

* fix many to many management and configuration

* update product tag relation configuration

* Introduce experimental dml hooks to fix some issues with categories

* more fixes

* fix product tests

* add missing id prefixes

* fix product category handle management

* test: fix more failing tests

* test: make it all green

* test: fix breaking tests

* fix: build issues

* fix: build issues

* fix: more breaking tests

* refactor: fix issues after merge

* refactor: fix issues after merge

* refactor: surpress types error

* test: fix DML failing tests

* improve many to many inference + tests

* Wip fix columns from product entity

* remove product model before create hook and manage handle validation and transformation at the service level

* test: fix breaking unit tests

* fix: product module service to not update handle on product update

* fix define link and joiner config

* test: fix joiner config test

* test: fix joiner config test

* fix joiner config primary keys

* Fix joiner config builder

* Fix joiner config builder

* test: remove only modifier from test

* refactor: remove hooks usage from product collection

* refactor: remove hooks usage from product-option

* refactor: remove hooks usage for computing category handle

* refactor: remove hooks usage from productCategory model

* refactor: remove hooks from DML

* refactor: remove cruft

* order dml

* cleanup

* re add foerign key indexes

* wip

* chore: remove unused types

* wip

* changes

* rm raw

* autoincrement

* wip

* rel

* refactor: cleanup

* migration and models configuration adjustments

* cleanup

* number searchable

* fix random ordering

* fix

* test: fix product-category tests

* test: update breaking DML tests

* test: array assertion to not care about ordering

* fix: temporarily apply id ordering for products

* types

* wip

* WIP type improvements

* update order models

* partially fix types temporarely

* rel

* fix: recursive type issue

* improve type inference breaks

* improve type inference breaks

* update models

* rm nullable

* default value

* repository

* update default value handling

* fix unit tests

* WIP

* toMikroORM

* fix relations

* cascades

* fix

* experimental dml hooks

* rm migration

* serial

* nullable autoincrement

* fix model

* model changes

* fix one to one DML

* order test

* fix addresses

* fix unit tests

* Re align dml entity name inference

* update model table name config

* update model table name config

* revert

* update return relation

* WIP

* hasOne

* models

* fix

* model

* initial commit

* cart service

* order module

* utils unit test

* index engine

* changeset

* merge

* fix hasOne with fk

* update

* free text filter per entity

* tests

* prod category

* property string many to many

* fix big number

* link modules migration set names

* merge

* shipping option rules

* serializer

* unit test

* fix test mikro orm init

* fix test mikro orm init

* Maintain merge object properties

* fix test mikro orm init

* prevent unit test from connecting to db

* wip

* fix test

* fix test

* link test

* schema

* models

* auto increment

* hook

* model hooks

* order

* wip

* orm version

* request return field

* fix return configuration on order model

* workflows

* core flows

* unit test

* test

* base repo

* test

* base repo

* test fix

* inventory move

* locking inventory

* test

* free text fix

* rm timeout mock

* migrate fulfillment values

* v6.4.3

* cleanup

* link-modules update sql

* revert test

* remove fake timers

---------

Co-authored-by: adrien2p <adrien.deperetti@gmail.com>
Co-authored-by: Harminder Virk <virk.officials@gmail.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-01-21 08:04:47 -05:00
Carlos R. L. Rodrigues 11f98f374c feat(core-flows): validate hook in cart workflows (#10967)
* feat(core-flows): validate hook

* rm only
2025-01-15 18:49:46 -05:00
Carlos R. L. Rodrigues c5a207144e fix(core-flows): missing variable of when condition (#10958) 2025-01-15 12:38:18 -05:00
Carlos R. L. Rodrigues 01acf9e700 fix(orchestration): avoid retry when finished (#10913) 2025-01-10 13:12:08 -03:00
Carlos R. L. Rodrigues 95baacfd00 fix(cart): Tax rate data type (#10626)
* fix(cart): tax rate data type

* update test
2024-12-16 20:09:05 +01:00
Carlos R. L. RodriguesandHarminder Virk 729eb5da7b chore(inventory): convert to dml (#10569)
Fixes: FRMW-2848

Co-authored-by: Harminder Virk <1706381+thetutlage@users.noreply.github.com>
2024-12-13 12:51:26 +00:00
Carlos R. L. Rodrigues 0264294ab5 chore(payment): Payment module DML (#10553)
* chore(payment): Payment module DML

* rm log

* migration
2024-12-11 13:09:10 -03:00
Carlos R. L. Rodrigues 69f4c4f4e0 chore(index): index dml (#10482)
What:
- DML - `autoincrement` property
- Index `type` option (GIN)
- Index module - DML
2024-12-10 10:55:12 +00:00
Carlos R. L. Rodrigues b0448a7c35 chore: locking-postgres provider dml (#10478) 2024-12-06 10:14:14 -03:00
Carlos R. L. Rodrigues f65a3cc06d fix(utils): avoid optional properties on graphql generated file (#10476)
FIXES: SUP-367
2024-12-06 12:16:02 +00:00
Carlos R. L. Rodrigues 90ae187e09 fix(workflows-sdk): name for when/then step (#10459) 2024-12-05 15:47:42 -03:00
Carlos R. L. Rodrigues 1f3754a75e chore(workflows-sdk): add unit test (#10419) 2024-12-04 10:32:03 +00:00
Carlos R. L. Rodrigues e9003c3124 fix(utils): read dir recursive (#10318)
What:
 - Using `Object.defineProperty) to avoid issues on Node versions that set this property as readonly.
2024-11-27 14:37:07 +00:00
Carlos R. L. Rodrigues a8eec16122 fix(core-flows): aggregate payment status (#10278) 2024-11-26 12:23:53 -03:00
Carlos R. L. Rodrigues aeb5b43692 feat(workflows-sdk): add response to permanent failure (#10177) 2024-11-20 17:29:37 -03:00
Carlos R. L. Rodrigues 42c08fa8e0 fix(framework): handle deprecated Dirent path (#10179)
What:

- `Dirent` class from `NodeJS` has different properties in different versions, causing issues in our loaders.
- Util `readDirRecursive` was introduced, avoiding old node versions to break

FIXES: https://github.com/medusajs/medusa/issues/8419
2024-11-20 20:25:48 +00:00
Carlos R. L. Rodrigues 47ca1d4b54 fix(inventory): update reservation quantity (#10139) 2024-11-18 11:55:22 -03:00
Carlos R. L. Rodrigues 06ce16c90b chore(local-file): throw error if file exist (#10087) 2024-11-14 12:11:37 -03:00
Carlos R. L. Rodrigues 3e265229f2 chore(event-bus): event bus error handling (#10085) 2024-11-13 18:03:29 -03:00
Carlos R. L. Rodrigues fc5d2b5fca feat(core-flows): order add quantity diff (#10065) 2024-11-12 16:49:58 -03:00
Carlos R. L. Rodrigues 2344012d1c fix(core-flows): capture before order created (#9980)
What:
 When `autocapture` is enabled, the webhook is processed before the order was created.
 The payment processing workflows were merged into a single one
 
FIXES: SUP-118, SUP-9

https://github.com/medusajs/medusa/issues/9998
2024-11-12 13:43:48 +00:00
Carlos R. L. Rodrigues 1eef324af3 fix(orchestration): fix set step failure (#10031)
What:
 - copy data before saving checkpoint
 - removed unused data format function
 - properly handle registerStepFailure to not throw
 - emit onFinish event even when execution failed
2024-11-12 10:06:36 +00:00
Carlos R. L. Rodrigues 1bae311a29 fix(core-flows): keep same customer on cart update (#9977)
* fix(core-flows): keep same customer on cart update

* update guest customer email

* create guest customer for new emails

* rm log
2024-11-10 14:11:40 +01:00
Carlos R. L. Rodrigues 03f4b66b90 fix(link-modules): generate graphql type of read only links (#9955) 2024-11-08 07:54:50 -03:00
Carlos R. L. Rodrigues 6496789c65 fix(framework): exclude nested fields when excluding requested field (#9979) 2024-11-07 18:26:02 -03:00
Carlos R. L. Rodrigues 898a437db0 chore(locking): disable default provider warning (#9956) 2024-11-06 14:06:01 -03:00
Carlos R. L. Rodrigues d8e3e04895 feat(core-flows): order events (#9702) 2024-10-21 15:26:44 -03:00
Carlos R. L. Rodrigues 6fa98b6a4d chore(orchestration): modules method context (#9669)
** What **
* Test to check if the MedusaContext is being injected when calling a Module's method
2024-10-18 21:08:06 +00:00
Carlos R. L. Rodrigues d3c1580c06 fix(orchestration): local workflow proxy (#9664) 2024-10-18 13:30:16 +00:00
Carlos R. L. Rodrigues 2a98be6b65 feat(medusa): ordem items endpoint (#9646) 2024-10-18 05:59:24 -03:00
Carlos R. L. Rodrigues 902ac12f73 chore: remove internal module resources option (#9582)
What:
* removes resouces type "shared" or "isolated" from internal modules.
* modules can have an isolated database connection by providing a database config as part of their options on `medusa-config`

CLOSES: FRMW-2593
2024-10-17 21:31:46 +00:00
Carlos R. L. RodriguesandAdrien de Peretti e9a06f4b4d fea(providers): locking postgres (#9545)
Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com>
2024-10-17 13:11:39 +00:00
Carlos R. L. Rodrigues f7fbc2f97c feat(core-flows): cart events (#9585) 2024-10-16 14:27:24 -03:00
Carlos R. L. Rodrigues 6a6c193042 chore(medusa): default endpoints size limit (#9616) 2024-10-16 14:27:01 -03:00
Carlos R. L. Rodrigues eb364834de fix(types): logger (#9581) 2024-10-16 06:29:49 -03:00
Carlos R. L. Rodrigues 4a03bdbb86 feat(providers): locking redis (#9544) 2024-10-15 12:40:24 -03:00
Carlos R. L. Rodrigues c8b375ae2d feat(locking): Locking module (#9524)
**What**
- Locking Module to manage concurrency
- Default `in-memory` provider
2024-10-11 16:30:06 +00:00
Carlos R. L. RodriguesandFrane Polić 4daf57dc1f fix(order): undo order change (#9497)
FIXES: CC-573

Co-authored-by: Frane Polić <16856471+fPolic@users.noreply.github.com>
2024-10-09 11:50:50 +00:00
Carlos R. L. Rodrigues 8fbef8a667 fix(order): searchable fields (#9493)
FIXES: TRI-353
2024-10-07 17:45:20 +00:00
Carlos R. L. Rodrigues f9e8403d29 fix(orchestrator, workflows-sdk): skip async step (#9482) 2024-10-07 07:35:30 -03:00
Carlos R. L. Rodrigues cc77ca1413 chore(types): index module type (#9473) 2024-10-04 16:54:43 +00:00
Carlos R. L. Rodrigues d06ea6985d fix: add order to pagination types (#9471) 2024-10-04 12:57:44 +00:00
Carlos R. L. Rodrigues 8155c4e9ee fix(workflows-sdk): when then return value (#9427) 2024-10-02 07:40:39 -03:00
Carlos R. L. Rodrigues d00afb76a6 chore(types): is_return on shipping options (#9352) 2024-09-27 12:54:11 +00:00
Carlos R. L. RodriguesandFrane Polić 19bc8d7f61 fix(core-flows): shipping options for cart (#9343)
FIXES: CC-536

Co-authored-by: Frane Polić <16856471+fPolic@users.noreply.github.com>
2024-09-27 12:32:32 +00:00
Carlos R. L. RodriguesandAdrien de Peretti ef15c60386 chore(modules-sdk): load modules in sequence (#9327)
What:
- The time taken to load in sequence is the same as in parallel, and it doesn't create multiple db queries simultaneously when starting each module.
- Rework modules bootstrap (now all dependencies are available from the constructor and cross deps are allowed without any topological sort needed. It also allow improvements in the future)
  - First load all modules
  - then resolve and register instances


Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com>
2024-09-26 16:33:35 +00:00
Carlos R. L. Rodrigues 11d8264062 fix(modules-sdk): default db options (#9313) 2024-09-25 19:44:12 -03:00
Carlos R. L. Rodrigues b4b1a48987 feat(utils): define read only link (#9254) 2024-09-24 12:00:38 -03:00
Carlos R. L. Rodrigues e54b339324 fix(core-flows): line item type collection (#9251) 2024-09-24 08:00:18 +00:00
Carlos R. L. Rodrigues 1215a7c094 chore(orchestrator): remote joiner using entitymap (#9205) 2024-09-20 05:30:08 -03:00
Carlos R. L. Rodrigues 3cfcd075ae chore(link-modules): fulfillment order fieldAlias (#9185) 2024-09-18 14:21:43 -03:00
Carlos R. L. Rodrigues adbeb9cc1d fix(workflow-engine-*): pass container to flow (#9180) 2024-09-18 08:44:11 -03:00
Carlos R. L. Rodrigues d6ff526820 fix(link-modules): table name (#9151)
FIXES: FRMW-2706
2024-09-16 19:08:42 +00:00
Carlos R. L. Rodrigues ef8dc4087e feat: run nested async workflows (#9119) 2024-09-16 13:06:45 +00:00
Carlos R. L. RodriguesandAdrien de Peretti 8829f89402 chore: query graph api (#9125)
CLOSES: FRMW-2704

**What**
Re-structure the Query graph API as well as introduce dynamic typing from schemas on the filters and better handling of relation treatment for fields/filters inference

Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com>
2024-09-16 11:32:44 +00:00
Carlos R. L. Rodrigues 950cf9af79 chore: remove container registration name (#9137) 2024-09-16 06:22:24 -03:00
Carlos R. L. Rodrigues e9280fb254 fix: product options event names (#9108) 2024-09-11 15:50:59 +00:00
Carlos R. L. Rodrigues 9a7daca21e feat(core-flows): product type, option and tag events (#9105) 2024-09-11 12:32:01 -03:00
Carlos R. L. Rodrigues fdd0543011 chore: joiner config entity property (#9084) 2024-09-11 06:25:25 -03:00
Carlos R. L. Rodrigues afb83b2408 fix(orchestration): filter out undefined items (#9046) 2024-09-08 07:58:48 -03:00
Carlos R. L. Rodrigues fde2a9b9be feat(product): product option value methods (#9004) 2024-09-05 11:03:29 +00:00
Carlos R. L. Rodrigues 2a055b71ef feat(core-flows): custom price flag for order line items and shipping methods (#8969)
CLOSES: CC-402
2024-09-04 20:30:59 +00:00
Carlos R. L. Rodrigues fb832072a4 fix(utils): graphql enum options (#8985) 2024-09-04 10:40:31 +00:00
Carlos R. L. Rodrigues 5a097d8954 feat(utils): dml to graphql (#8951) 2024-09-04 06:15:07 -03:00
Carlos R. L. Rodrigues 4ffb49efd0 chore(cart): completed at (#8921) 2024-08-31 12:42:58 -03:00
Carlos R. L. Rodrigues 89c6ef8fc9 chore(core-flows): added workflow events (#8915)
* chore(core-flows): added workflow events

* remove from parallelize

* check array
2024-08-30 16:32:08 -03:00
Carlos R. L. Rodrigues 891037081d chore(core-flows): apply taxes to items and shipping on RMA flows (#8858)
** What
Apply taxes to order line items and shipping methods
2024-08-29 17:33:39 +00:00
Carlos R. L. Rodrigues 90a6f61c62 fix(order): populate version entities (#8884) 2024-08-29 13:22:24 -03:00
Carlos R. L. Rodrigues b6521e4c1a feat(medusa): order changes endpoint (#8728)
What:
- `admin/orders/:id/changes` endpoint to get order changes related to the order
- added `*_by` attributes missing
2024-08-29 14:20:12 +00:00
Carlos R. L. Rodrigues 6cfe9bd874 fix(orchestration): remote joiner alias conflict (#8844) 2024-08-28 11:34:22 -03:00
Carlos R. L. Rodrigues 8dea3e44c6 fix(order): order change references (#8845) 2024-08-28 08:57:44 -03:00
Carlos R. L. Rodrigues ff6fcfb139 fix(core-flows,order): return damaged items (#8818) 2024-08-27 11:21:10 -03:00
Carlos R. L. Rodrigues 571f0c7629 chore(core-flows): product events (#8769) 2024-08-26 18:38:30 -03:00
Carlos R. L. Rodrigues 3b4eea08ef chore: peer dependency version (#8771)
* fix peer dependency version

* dotenv

* commands

* dotenv cli
2024-08-26 21:55:57 +02:00
Carlos R. L. Rodrigues afd25846f0 chore: dependencies reorg (#8744) 2024-08-26 09:37:05 +00:00
Carlos R. L. Rodrigues 12670683af fix(payment-stripe): fix rounding (#8753) 2024-08-25 10:44:51 +02:00
Carlos R. L. Rodrigues 058378970a chore: dependecies reorg (#8535) 2024-08-23 07:16:04 -03:00
Carlos R. L. Rodrigues 9931b69a2a chore(core-flows): test allow backorder (#8725) 2024-08-22 11:47:31 +00:00
Carlos R. L. Rodrigues 4c43122358 chore(core-flows): order edit - remove item update action (#8722) 2024-08-22 11:32:27 +00:00
Carlos R. L. Rodrigues cad6dae231 fix(core-flows): allow backorder (#8721) 2024-08-22 13:28:22 +02:00
Carlos R. L. Rodrigues 24377053f0 fix(types): pluralize (#8709) 2024-08-21 14:04:16 -03:00
Carlos R. L. Rodrigues 27a2dcb10d feat(core-flows): order edit request (#8705) 2024-08-21 13:59:33 -03:00
Carlos R. L. Rodrigues 99eca64c20 chore(order): preview removed items (#8680) 2024-08-20 14:53:39 -03:00
Carlos R. L. Rodrigues eb0bfe9f33 feat(workflows-sdk): log on error (#8666) 2024-08-20 06:23:24 -03:00
Carlos R. L. Rodrigues 1be9373290 chore(core-flows): order update item quantity (#8659) 2024-08-19 18:14:57 +00:00
Carlos R. L. Rodrigues dd82a56ec5 fix(payment-stripe): fix smallest unit calculation (#8663) 2024-08-19 19:19:49 +02:00
Carlos R. L. Rodrigues aa6e504771 chore(core-flows): set packed_at when fulfillment is created (#8665) 2024-08-19 19:16:48 +02:00
Carlos R. L. Rodrigues be942ff15c fix(order): update order summary when transactions change (#8633) 2024-08-16 19:40:44 +00:00
Carlos R. L. Rodrigues 5200e816c9 fix(order): order summary on order creation (#8624) 2024-08-16 07:52:24 -03:00
Carlos R. L. Rodrigues ba34c53151 fix(order): summary original_total (#8616) 2024-08-15 14:15:05 -03:00
Carlos R. L. Rodrigues c92aa3e397 feat(core-flow): order edit endpoints (#8596)
* The relevant part of this PR is only at folder `packages/medusa/src/api/admin/order-edits/`
All the other changes are Types

Missing: 
* `/store` endpoints to confirm/decline the order change
* http tests of the full flow
2024-08-15 16:59:36 +00:00
Carlos R. L. Rodrigues a45ff1c147 fix(chore-flows): update shipping method price (#8592) 2024-08-14 12:53:59 +00:00
Carlos R. L. Rodrigues 3d3fd9e500 fix(core-flows): add order transaction on capture (#8591) 2024-08-14 11:16:19 +00:00