* feat: Completely revamp the pricing module
* chore: Update all places to the new pricing interfaces
* fix: Remove unnecessary join to itself
* chore: Add data migration for existing users
* fix: Apply the correct index to price rule
**What**
Unset `region_id` on countries when soft deleting the associated region. Otherwise, countries cannot be added to new or other regions
Alternatively, we hard delete the region, which will trigger the DB level cascade
In both cases, we cannot easily restore the region countries.
This also includes rework of the currency model for the Store module.
This change is breaking as existing stores won't have any supported currencies set, so users would need to go to the store settings again and choose the supported currencies there.
**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>
**what:**
- hides different fields depending on the chosen template
- remove operator values API
- fixes to edit promotion rules
- make currency optional for promotion
RESOLVES CORE-2297
**What**
Remove transaction decorator from the base medusa service method, the transaction will always be coming from the shared context. It fixes the issue that when you consume a base method directly it will return a proper tuple from the DB instead of the one from the entity map cc @VariableVic
**NOTE**
This pr also fix some categories issues in the product module which was preventing the tests from working. if @sradevski you could have a look later, in the mean time we can still merge it
FIXES CORE-2342
* feat: Normalize the categories interface to match standards
* feat: Revamp the product category implementation
* fix: Adjustments to code and tests around product categories
* chore: ability to group events on redis event bus
* chore: fix tests
* Update packages/modules/event-bus-redis/src/services/event-bus-redis.ts
Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
* chore: change shape of input and body data
* chore: fix builds
* chore: address comments
* chore: fix unit test
---------
Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
**What**
emit product tags events
**note**
Stil does not take into consideration non overriden method, delete and soft delete emits event under the hood and we will have to migrate that at the end
what:
- santizes inputs to prevent reserved_quantity from being updated directly
- inventory items create api can create location levels
- add validation to update quantity of reservation items
- general cleanup
RESOLVES CORE-2254
WIP, not ready to review
**what**
- add events
- integration tests of emitted events
- remove integration tests on auto generated services in favor of module method integration tests
**What**
- Return the updated/deleted/created entities from the upsert with replace according to the configuration
This will help to emit the events from the product module as it rely on this abstraction in many places