* remove defaults
* take 2
* works now
* add changeset
* pricing module and pricing service list take null updates
* update handlers
* update product module service with take:null where relevant
* no spread
* note to self:default offset should be 0, not 15
**what:**
**PriceList Service APIs:**
- createPriceList
- updatePriceList
- addPriceListPrices
- removePriceListRules
- setPriceListRules
- deletePriceList
- listPriceLists
- listAndCountPriceLists
**Price Calculations**
- Returns prices with price list prices
- Returns a new shape with calculated and original prices
Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>
**What**
At the moment, when importing something from medusa entry point, if two medusa packages are installed because of a plugin, the evaluation of the import can end up throwing that a workflow is already defined. To prevent that from happening, we can just not throw if it is already defined and just return prematurely and make it idempotent.
**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?
**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>
* 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>
**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
**What**
- includes some type fixes in the DAL layer
- List products including their prices and filtered by the sales channel as well as q parameter and category scope and all other filters
- Assign shipping profile
- ordering
- Add missing columns in the product module
- update product module migrations
**Comment**
- In regards to the fields, we can pass whatever we want the module will only return the one that exists (default behavior), but on the other hand, that is not possible for the relations.
**question**
- To simplify usage, should we expose the fields/relations available from the module to simplify building a query for the user and be aware of what the module provides
**todo**
- Add back the support for the user to ask for fields/relations
What:
- Setups the skeleton for pricing module
- Creates service/model/repository for currency model
- Setups types
- Setups DB
- Moved some utils to a common place
RESOLVES CORE-1477
RESOLVES CORE-1476
## What
Adds new options for easier usage of the `create-medusa-app` command for regular medusa users.
The following options are added:
- `--skip-db`: Skips creating the database, running migrations, and seeding, and subsequently skips opening the browser. Useful if the developer wants to set the database URL at a later point in the configurations.
- `--db-url <url>`: Skips database creation and sets the database URL to the provided URL. Throws an error if can't connect to the database. Will still run migrations and open the admin after project creation. Useful if the developer already has database created, locally or remotely.
- `--no-migrations`: Skips running migrations, creating admin user, and seeding. If used, it's expected that you pass the `--db-url` option with a url of a database that has all necessary migrations. Otherwise, unexpected errors will occur. Helpful only if combined with `--db-url`
- `--no-browser`: Disables opening the browser at the end of the project creation and only shows success message.
- `--directory-path <path>`: Allows specifying the directory path to install the project in. Useful for testing.
* Feat: create product with product module
* feat: create product wip
* feat: create product wip
* feat: update product relation and generate image migration
* lint
* conitnue implementation
* continue implementation and add integration tests for produceService.create
* Add integration tests for product creation at the module level for the complete flow
* only use persist since write operations are always wrapped in a transaction which will be committed and flushed
* simplify the transaction wrapper to make future changes easier
* feat: move some utils to the utils package to simplify its usage
* tests: fix unit tests
* feat: create variants along side the product
* Add more integration tests an update migrations
* chore: Update actions workflow to include packages integration tests
* small types and utils cleanup
* chore: Add support for database debug option
* chore: Add missing types in package.json from types and util, validate that all the models are sync with medusa
* expose retrieve method
* fix types issues
* fix unit tests and move integration tests workflow with the plugins integration tests
* chore: remove migration function export from the definition to prevent them to be ran by the medusa cli just in case
* fix package.json script
* chore: workflows
* feat: start creating the create product workflow
* feat: add empty step for prices and sales channel
* tests: update scripts and action envs
* fix imports
* feat: Add proper soft deleted support + add product deletion service public api
* chore: update migrations
* chore: update migrations
* chore: update todo
* feat: Add product deletion to the create-product workflow as compensation
* chore: cleanup product utils
* feat: Add support for cascade soft-remove
* feat: refactor repository to take into account withDeleted
* fix integration tests
* Add support for force delete -> delete, cleanup repositories and improvements
* Add support for restoring a product and add integration tests
* cleaup + tests
* types
* fix integration tests
* remove unnecessary comments
* move specific mikro orm usage to the DAL
* Cleanup workflow functions
* Make deleted_at optional at the property level and add url index for the images
* address feedback + cleanup
* fix export
* merge migrations into one
* feat(product, types): added missing product variant methods (#4475)
* chore: added missing product variant methods
* chore: address PR feedback
* chore: catch undefined case for retrieve + specs for variant service
* chore: align TEntity + add changeset
* chore: revert changeset, TEntity to ProductVariant
* chore: write tests for pagination, unskip the test
* Create chilled-mice-deliver.md
* update integration fixtuers
* update pipeline node version
* rename github action
* fix pipeline
* feat(medusa, types): added missing category tests and service methods (#4499)
* chore: added missing category tests and service methods
* chore: added type changes to module service
* chore: address pr feedback
* update repositories manager usage and serialisation from the write public API
* move serializisation to the DAL
* rename template args
* chore: added collection methods for module and collection service (#4505)
* chore: added collection methods for module and collection service
* Create fresh-islands-teach.md
* chore: move retrieve entity to utils package
* chore: make products optional in DTO type
---------
Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
* feat(product): Apply transaction decorators to the services (#4512)
* chore: added tags and types methods for product module
* chore: remove console log
* chore: fork managers on every repository call
* chore: add forked manager decorator
* chore: rename to inject manager from inject forked manager
* chore: added product tag and type create/update/delete
* chore: added collection create/update/delete
* chore: fix naming
* update injectManager and related behaviour
* simplify get active manager
* chore: reset package.json
* makes the base repository methods related to manager generic
* makes some wrapper generic enough
* add some todos
* chore: added options CRUD
* clean up
* chore: fix issue with deleted_at not being updated
* wip
* chore: added categories write operations
* chore: remove async nature of injection decorator
* chore: added changeset
* chore: reset package.json
* chore: add manager injection to all contextable methods
* chore: fix unit tests
---------
Co-authored-by: adrien2p <adrien.deperetti@gmail.com>
Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>