We are adding tax inclusive pricing calculation when listing products.
Two things to keep in mind:
- `region_id` will be required if you request calculated prices.
- We won't accept `currency_code` anymore, as that will come from the region info (since ultimately a cart and its currency are tied to a region)
REF CORE-2376
DEPENDS ON #8003
* feat: Add price preference to sdk
* feat: Plug tax inclusivity settings for region in UI
* feat: Add price inclusivity indicator to variant and shipping price table columns
* fix: Rename price title to correct variable name
* feat: Add support for tax inclusive crud on region
* fix: Use the region endpoint for updating tax inclusivity
* chore: Factor out price columns from hooks
REF CORE-2376
Remaining pieces are adding UI to manage the flag, showing the flag in price editor, plugging it in cart calculations, and https://github.com/medusajs/medusa/pull/7827
* 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
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:
Multiple active sessions are used for split payments. We don't currently support split payments. Until we have that implemented, this change is to ensure that whenever we create a new payment session, we delete an existing session if present.
RESOLVES CORE-2284
* feat: Normalize the categories interface to match standards
* feat: Revamp the product category implementation
* fix: Adjustments to code and tests around product categories
There are a lot of issues in the admin after applying the correct typings, but fixing those should be done gradually, it's better to keep it out of this PR
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
* chore: Move publishable api key tests to HTTP
* chore: Move store tests to HTTP folder
* fix: Add tests for store products, fix several bugs around publishable keys
what:
When creating a variant, we can now create inventory as a part of the product and variants create endpoint.
This applies only to variants where `manage_inventory=true`. 2 cases present itself:
1. When inventory_items are present
- Link an inventory item with required_quantity to the variant
- the inventory item already needs to be present
2. When inventory_items are not present
- A default inventory item will be created
- links the created item to the variant with a default required_quantity
RESOLVES CORE-2220
what:
- adds variant inventory link management endpoints:
```
Link inventory item to variant
POST /products/:id/variants/:vid/inventory-items
Update variant's inventory item link
POST /products/:id/variants/:vid/inventory-items/:iid
Unlink variant's inventory item
DELETE /products/:id/variants/:vid/inventory-items/:iid
```
- a batch endpoint that does the above 3 across variants
```
POST /products/:id/variants/inventory-items
```