**Fixes**
- Fixes an issue where click the Delete button on a table item in the Price List overview would also navigate to the Price Lists page
- Fixes an issue where Region prices were not showing which region they belong to in the Bulk Editor
- Fixes an issue where the wrong widgets were being injected into the Price List domain
**Improvements**
- Align label for Expiry date field
- Add form validation to require setting the prices of at least one product variant when creating or adding prices to a Price List.
- Show a prompt warning if prices have not been set for all selected products in the create and add product flows.
**Why**
- We have some workflow-like flows in @medusajs/medusa. These should be moved over to the workflows package.
- Inventory Items <> Variant currently assume a 1-1 mapping. There should be support for a many-to-many mapping.
**What**
- PR introduces a feature flag for supporting many-to-many mappings for inventory and variants.
- Deletes legacy transaction handler in @medusajs/medusa.
- Adjusts existing createInventoryItems handler to remove dependency on variant data.
**Unkowns**
~~1. Couldn't find an existing test for the CreateProduct workflow. It should be tested that this still works as expected.~~
2. Have removed transaction managers as we should move to handling consistency through orchestration tooling. Are we ready for that?
* chore: remove skipping logic for migrations
* chore: medusa app returns migrations to run for modules
* chore: added migration for feature compatible
* chore: added changelog
* chore: create table only if it does not exist
* chore: update migration to pluck from registered modules
* chore: cleanup
* chore: make product an internal service temp
* chore: added options and deps to module
* chore: added link module options
* chore: remove duplicate
* chore: added missing column names in core + remove from model
* chore: scope migrations to only to create if not exist - money amount, currency
---------
Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
* adjusted tsdoc of methods and types in pricing module
* finished adding tsdocs
* small fixes
* remove reference files
* added github action
* fix typo in outPath
* Update packages/types/src/shared-context.ts
Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
* fix sharedContext description
* changed branch name of action
* added ignore for is_dynamic
* added private remark
---------
Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
**What**
- transform remote query object back to string array
- get all fields and fields from given relations from a GraphQL schema
Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
* fix for merging line items and quantity prices
* add changeset
* fix draft order unit_price calculation
* update test to reflect only quantity change
* fix unit tests
* update conditional
* initial
* initial service
* update pricing module service
* add integration test for rule-type
* update pricing-module integration tests
* update pricing service interface
* feat(pricing): PriceSets as entry point to pricing module
* chore: add price set money amount
* chore: add price set money amount
* chore: change name of test
* chore: added changeset
* chore: use filterable props from money amount in price sets
* chore: update migrations
* test update integration test
* fix weird behavior
* Update packages/pricing/integration-tests/__fixtures__/rule-type/index.ts
Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
* Apply suggestions from code review
Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
* move rule-type to common
* chore: reset migration
* chore: remove incorrect conflicts
* chore: address review
* chore: remove ghost price list
* Apply suggestions from code review
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
* update id prefix
* use persist not persistAndflush
* rename key_value to rule_attribute
* more renaming
* feat(types,pricing): add price set money amount rules to pricing module
* chore: cleanup + add test cases for relationship update
* chore: revert package json
* chore: cleanup
* initial
* update pricing module service
* update pricing-module integration tests
* update pricing service interface
* chore: update migrations
* fix weird behavior
* Apply suggestions from code review
Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
* move rule-type to common
* chore: delete duplicate migration files
* fix(link-modules): Fix link module initialization (#4990)
**What**
Add a new configuration on the relationship to specify if the relation is consumed from an internal service (from medusa core). In that case do not check if the service is part of the loaded modules
* initial price rule
* rebase develop
* save here
* final changes to create
* update price rule integration test
* add module integraiton tests for price rules
* fix merge
* redo wierd order change
* pr cleanup
* pr cleanup
* pr cleanup
* update pr
* sort out migrations
* [wip]
* wip
* chore: temporarily emulate mikroorm internals
* currency code hard filtering
* before creating subqueries
* chore: wip
* chore: wip
* chore: add exact match multiple contexts
* chore: add one more test
* chore: add query that works with exact match
* chore: qb the thingy
* chore: add some comments
* chore: removed extra filter
* chore: added some more comments + prettify
* chore: test with carlos
* chore: add fallbacks and exact match tests
* chore: cleanup
* feat(types,pricing): add price set money amount rules to pricing module (#5065)
* initial
* initial service
* update pricing module service
* add integration test for rule-type
* update pricing-module integration tests
* update pricing service interface
* feat(pricing): PriceSets as entry point to pricing module
* chore: add price set money amount
* chore: add price set money amount
* chore: change name of test
* chore: added changeset
* chore: use filterable props from money amount in price sets
* chore: update migrations
* test update integration test
* fix weird behavior
* Update packages/pricing/integration-tests/__fixtures__/rule-type/index.ts
Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
* Apply suggestions from code review
Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
* move rule-type to common
* chore: reset migration
* chore: remove incorrect conflicts
* chore: address review
* chore: remove ghost price list
* Apply suggestions from code review
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
* update id prefix
* use persist not persistAndflush
* rename key_value to rule_attribute
* more renaming
* feat(types,pricing): add price set money amount rules to pricing module
* chore: cleanup + add test cases for relationship update
* chore: revert package json
* chore: cleanup
---------
Co-authored-by: Philip Korsholm <philip.korsholm@hotmail.com>
Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
* chore: minor cleanup
* chore: added money amount scoping
* chore: added review comments
* chore: update changset and undo test scoping
* add migration for price_set_rule_type table
* update types
* initial add
* update tests
* working create with rule-types
* initial testing for money amount creation
* add price set money amount repo and service
* fix broken build
* create price list with prices and rule types
* create price set with info not being rules and money amounts
* create price set initial working implementation
* chore: introduce group by util + no queries on empty context
* addPrices
* remove comments
* Feat/pricing module methods (#5218)
chore: add removePrices to pricing module
* fix broken integration test
* Revert "Feat/pricing module methods (#5218)" (#5236)
This reverts commit 95c8aaa66423d290a35b6e736e5b187e12d44a36.
* feat(types,pricing): remove prices from a price set (#5235)
feat(types,pricing): remove prices from a price set
* add addRules
* typing
* add validation of price set ids for addRules
* add rule_attribute check for addRules method
* chore: review changes
* chore: update schema
* chore: first part of reviews
* chore: reset migration
* remove unnecessary init
* update interface
* use persist not persistAndflush
* chore: added money amount scoping
* chore: update schema
* fix
* fix 2
* add default pricing
* addPrices
* create
* update pricing service interface
* chore: rename money amounts to prices
* chore: cleanup + changelog
* chore: update package.json
* chore: cleanup persistAndFlushes from services
* jsdoc
* chore: add js docs for price rules
* chore: added js doc for psma and rule types
* chore: added jsdoc for currencies
* more jsdocs
* jsdoc money amounts
* chore: move jsdoc to interface
* chore: remove persist and flush to persist
* change overload
---------
Co-authored-by: Philip Korsholm <philip.korsholm@hotmail.com>
Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
* initial
* initial service
* update pricing module service
* add integration test for rule-type
* update pricing-module integration tests
* update pricing service interface
* feat(pricing): PriceSets as entry point to pricing module
* chore: add price set money amount
* chore: add price set money amount
* chore: change name of test
* chore: added changeset
* chore: use filterable props from money amount in price sets
* chore: update migrations
* test update integration test
* fix weird behavior
* Update packages/pricing/integration-tests/__fixtures__/rule-type/index.ts
Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
* Apply suggestions from code review
Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
* move rule-type to common
* chore: reset migration
* chore: remove incorrect conflicts
* chore: address review
* chore: remove ghost price list
* Apply suggestions from code review
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
* update id prefix
* use persist not persistAndflush
* rename key_value to rule_attribute
* more renaming
* feat(types,pricing): add price set money amount rules to pricing module
* chore: cleanup + add test cases for relationship update
* chore: revert package json
* chore: cleanup
* initial
* update pricing module service
* update pricing-module integration tests
* update pricing service interface
* chore: update migrations
* fix weird behavior
* Apply suggestions from code review
Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
* move rule-type to common
* chore: delete duplicate migration files
* fix(link-modules): Fix link module initialization (#4990)
**What**
Add a new configuration on the relationship to specify if the relation is consumed from an internal service (from medusa core). In that case do not check if the service is part of the loaded modules
* initial price rule
* rebase develop
* save here
* final changes to create
* update price rule integration test
* add module integraiton tests for price rules
* fix merge
* redo wierd order change
* pr cleanup
* pr cleanup
* pr cleanup
* update pr
* sort out migrations
* [wip]
* wip
* chore: temporarily emulate mikroorm internals
* currency code hard filtering
* before creating subqueries
* chore: wip
* chore: wip
* chore: add exact match multiple contexts
* chore: add one more test
* chore: add query that works with exact match
* chore: qb the thingy
* chore: add some comments
* chore: removed extra filter
* chore: added some more comments + prettify
* chore: test with carlos
* chore: add fallbacks and exact match tests
* chore: cleanup
* feat(types,pricing): add price set money amount rules to pricing module (#5065)
* initial
* initial service
* update pricing module service
* add integration test for rule-type
* update pricing-module integration tests
* update pricing service interface
* feat(pricing): PriceSets as entry point to pricing module
* chore: add price set money amount
* chore: add price set money amount
* chore: change name of test
* chore: added changeset
* chore: use filterable props from money amount in price sets
* chore: update migrations
* test update integration test
* fix weird behavior
* Update packages/pricing/integration-tests/__fixtures__/rule-type/index.ts
Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
* Apply suggestions from code review
Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
* move rule-type to common
* chore: reset migration
* chore: remove incorrect conflicts
* chore: address review
* chore: remove ghost price list
* Apply suggestions from code review
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
* update id prefix
* use persist not persistAndflush
* rename key_value to rule_attribute
* more renaming
* feat(types,pricing): add price set money amount rules to pricing module
* chore: cleanup + add test cases for relationship update
* chore: revert package json
* chore: cleanup
---------
Co-authored-by: Philip Korsholm <philip.korsholm@hotmail.com>
Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
* chore: minor cleanup
* chore: added money amount scoping
* chore: added review comments
* chore: update changset and undo test scoping
* chore: introduce group by util + no queries on empty context
* Feat/pricing module methods (#5218)
chore: add removePrices to pricing module
* Revert "Feat/pricing module methods (#5218)" (#5236)
This reverts commit 95c8aaa66423d290a35b6e736e5b187e12d44a36.
* chore: review changes
* chore: update schema
* chore: reset migration
---------
Co-authored-by: Philip Korsholm <philip.korsholm@hotmail.com>
Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
* initial code push
* update metadata and only merge if the existing line item allows merging
* update should_merge check
* undo changes to taxrate service
* update results with unit pricing corresponding to the db values after update
* add should_merge property to line_item creation
* add should_merge property to line_item creation
* fix unit tests
* undo adding "should_merge" to create-line-item
* undo change to "addOrUpdateLineItem"
* :wqh_merge from generate method
* undo changes to unit tests
* revert to adding pricing in updateLineItem method
* update cart service test
* Create funny-radios-juggle.md
---------
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Fixes some typos found while reviewing translations.
Potential improvements in the future: fragmented translations may need merging with `<Trans>`. For example:
```
"analytics-preferences-disclaimer": "Pour créer la meilleure expérience de commerce électronique possible, nous aimerions obtenir des informations sur la manière dont vous utilisez Medusa. Les informations sur les utilisateurs nous permettent de construire des produits meilleurs, plus attrayants et plus utilisables. Nous ne collectons des données que pour améliorer le produit. Lisez quelles données nous recueillons dans notre",
"analytics-preferences-documentation": "documentation",
```
```
"help-dialog-feel-free-to-join-our-community-of": "Feel free to join our community of",
"help-dialog-merchants-and-e-commerce-developers": "merchants and e-commerce developers",
```
```
"upload-modal-drop-your-file-here-or": "Drop your file here, or",
"upload-modal-click-to-browse": "click to browse.",
```
Example from my previous PR with `sales-channels-display-available-count`:
```
<Trans
i18nKey="sales-channels-display-available-count"
availableChannelsCount={availableChannelsCount}
totalChannelsCount={totalChannelsCount}
>
Available in{" "}
<span className="inter-base-semibold text-grey-90">
{{ availableChannelsCount }}
</span>{" "}
out of{" "}
<span className="inter-base-semibold text-grey-90">
{{ totalChannelsCount }}
</span>{" "}
Sales Channels
</Trans>
```
**What**
First iteration:
Admin list products return everything but does not include proper filtering by discount id or price list id. Also, same as the previous pr, the fields/expand is not included
depends on https://github.com/medusajs/medusa/pull/5130
**What**
Update cart must use the remote query when being in product isolation mode.
This pr is a first iteration that aims to quickly make compatible the end point in isolation. In a future iteration, this end point will be migrated to a workflow
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
**What**
For simplicity and compatibility with the front, the fields are stored as an array of strings containing the list of fields that should be selected by a query. In order to reduce the delta between this object shape and what is expected by the remoteQuery when passing an object, we built util to make the translation from fields to config.
This will allow us to update the endpoint fields to specify what exactly needs to be selected and based on that we will be able to build the remote query object. Furthermore, it will allow us to drop back the functionality of custom fields and relations. we will still have to take into account the limit constraint of an url size including the parameters if a user want to select everything from a relation. In that case, we might maybe think about handling this case once the modules will export all available relations and fields so that the remote joiner would be able to pass them all automatically if the relation is present but a `*` is passed or no values in the fields during the translation with the util. But this is something we can come up in a separate iteration