* 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:
- 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
```
What
- Move sales channel integration tests from `/api` to `/http`
Deleted tests that do not belong in the suite:
- POST /admin/products/:id
- Mutation sales channels on products
- POST /admin/products
- Creating a product with a sales channel
- GET /admin/products
- Filtering products by sales channel
- Expanding with a sales channel
- GET /admin/orders
- Filtering orders by sales channel
- Expanding with a sales channel
- POST /admin/orders/:id/swaps
- Creating a swap with a sales channel
* chore: Move api key tests to http folder
* chore: Move some of the product category tests to http
* chore: Move collection tests to http
* chore: Remove unused database test
what:
- when inventory_quantity is requested through the API, we calculate the inventory based on sales channels + stock locations and return the total available inventory.
A variant can have multiple inventory items. As an example:
Table: (variant)
- 4 (required_quantity via link) x legs (inventory item)
- 2 x table top
Only if all individual inventory items of a variant are available, do we mark the variant as available as a single unit.
RESOLVES CORE-2187
* feat(core-flows,types,utils,medusa): Update existing line items when adding the same variant to cart
* chore: split steps into 2 for add-to-cart
* chore: split steps into 2 for add-to-cart
* chore: iterate safely
* chore: parallelize upsert
**What**
- remove medusa-core-utils
- dispatch the utils where they belongs
- update usage
**NOTE**
I have been wondering if the graceful class should go into the utils package or medusa package, I ve put it in the medusa package as it seems to be the best place I can see for now and is tight to the server as well. Also, I wanted to avoid the utils package to depends on http and net dependencies, happy to change that if you feel like it