* feat: Custom line items
* fix tests
* fix migration
* Allow custom items in update line item workflow
* throw if line item doesn't have a price
* minor things
* wip
* fix flows
* fix test
* add default
* add to type
* fix(carts): Fixes cart modifications not accounting for certain price lists (#10493)
*What*
* Fixes#10490
* Expands any available customer_id into its customer_group_ids for cart
updates that add line items.
*Why*
* Cart updates from the storefront were overriding any valid price lists
that were correctly being shown in the storefront's product pages.
*How*
* Adds a new workflow step that expands an optional customer_id into the
customer_group_ids it belongs to.
* Uses this step in the addToCartWorkflow and
updateLineItemInCartWorkflow workflows.
*Testing*
* Using medusa-dev to test on a local backend.
* Adds integration tests for the addToCart and updateLineItemInCart
workflows.
Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
* chore: update cart workflows to accept new pricing context
* chore: add transfer specs
* chore: fix specs
* chore: modify types + specs
* chore: add data migration + dashboard changes
* chore: fix update line item workflow
* chore: add changeset + unskip spec
---------
Co-authored-by: Sergio Campamá <sergiocampama@gmail.com>
FIXES: FRMW-2727
MikroORM (with version 5.9) has [hardcoded the TypeScript module](https://github.com/mikro-orm/mikro-orm/blob/5.x/packages/core/src/utils/ConfigurationLoader.ts#L138-L139) system to `commonjs`, which makes it incompatible with the module system we are using, ie `Node16`.
So, in order to continue using the Mikro ORM CLI within our modules, we will have to monkey-patch the block of code responsible for configuring `ts-node`. However, the monkey-patching must be done before their CLI gets booted.
As a result of this, we have to create a wrapper CLI on top of Mikro ORM CLI that performs the following steps.
- Monkey-patch the relevant code
- Register Mikro ORM CLI as the second step.
Due do this, we will have to use this new wrapper CLI within the modules, which is exposed as `medusa-db`. Maybe, `medusa-db` is not a great name, so please send your suggestions.
* fix: normalize path before consuming it while loading models
* Make it so that models derived from the service if present
* fix linkable tests that now match what has been passed to the medusa service if there is no custom joiner config
* fix linkable tests that now match what has been passed to the medusa service if there is no custom joiner config
* fix linkable tests that now match what has been passed to the medusa service if there is no custom joiner config
**What**
Apply the `Module` util to each module to handle the export and provide the linkable configuration object.
- Most joiner config that does not have any special config are removed/cleaned up in favor of the autogenerated one or simpler one
- linkable are now available in all modules
- cleaned up the dependencies of the modules
FIXES CORE-2410
**What**
Update the `MedusaService` class, factory and types to remove the concept of main modules. The idea being that all method will be explicitly named and suffixes to represent the object you are trying to manipulate.
This pr also includes various fixes in different modules
Co-authored-by: Stevche Radevski <4820812+sradevski@users.noreply.github.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
* feat(core-flows,types,utils,medusa): Update existing line items when adding the same variant to cart
* chore: split steps into 2 for add-to-cart
* chore: split steps into 2 for add-to-cart
* chore: iterate safely
* chore: parallelize upsert