**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.
**what:**
- DML can apply composite indexes
- Where clause is currently a string, QB version will come as a follow up
```
model.define("user", {
email: model.text(),
account: model.text(),
}).indexes([
{
name: "IDX-unique-name",
unique: true,
on: ["email", "account"],
where: "email is NOT NULL",
},
])
```
RESOLVES CORE-2391
* feat: manage inventory items for variants
* fix: show action only when manage inventory
* fix: translation key
* fix: labels depending on number of items
* fix: address feedback
---------
Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
* fixed associated schema names
* move OAS method and summary descriptions to knowledge base
* refactoring and fixes
* detect default object value in delete responses
- Change existing data model guides and add new ones for DML
- Change module's docs around service factory + remove guides that are now necessary
- Hide/remove all mentions of module relationships, or label them as coming soon.
- Change all data model creation snippets to use DML
- use `property` instead of `field` when referring to a data model's properties.
- Fix all snippets in commerce module guides to use new method suffix (no more main model methods)
- Rework recipes, removing/hiding a lot of sections as a lot of recipes are incomplete with the current state of DML.
### Other changes
- Highlight fixes in some guides
- Remove feature flags guide
- Fix code block styles when there are no line numbers.
### Upcoming changes in other PRs
- Re-generate commerce module references (for the updates in the method names)
- Ensure that the data model references are generated correctly for models using DML.
- (probably at a very later point) revisit recipes
* chore: various DML improvements
* Check is something through static utils
* Check is something through static utils
* allow to define a schema with table name
* restrict searchable to text only
* rm searchable modifier
* extract constructor logic into separate function
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