* feat(medusa): Allow to create/update object sales channels assignment
* feat(medusa): cleanup
* feat(medusa): Update oas
* feat(medusa): Only add relation if required
* feat(medusa): Add feature flag decorators
* style(medusa): PR feedback
* feat(medusa): Remove circular by moving sales channel product existence check to the repo layer
* feat(medusa): Reduce selected column as they are not necessary
* feat(medusa): Refactor repository and usage
* feat(medusa): Improve entity name formatting
* feat(medusa): Add feature flag to the service
* fix(medusa): typo
* test(medusa): fix unit tests
* feat(medusa): include feedback
* feat(medusa): Adds validator pipe for Sales Channel existence (#1930)
* feat(medusa): Allow to create/update object sales channels assignment
* feat(medusa): cleanup
* feat(medusa): Update oas
* feat(medusa): Only add relation if required
* feat(medusa): Add feature flag decorators
* style(medusa): PR feedback
* feat(medusa): Remove circular by moving sales channel product existence check to the repo layer
* feat(medusa): Reduce selected column as they are not necessary
* feat(medusa): Refactor repository and usage
* feat(medusa): Improve entity name formatting
* feat(medusa): Add feature flag to the service
* fix(medusa): typo
* test(medusa): fix unit tests
* feat(medusa): Adds validator pipe for Sales Channel existence
* feat: Move product payload classes to types file
* fix unit tests
* fix integration test
Co-authored-by: adrien2p <adrien.deperetti@gmail.com>
* feat(medusa): Revert base repository and related
* feat(medusa): cleanup
* remove base repo export
Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
What
Allow to create a cart with a sales channel, otherwise the default one is attached.
Also allow to update the sales channel on an existing cart and in that case the line items that does not belongs to the new sales channel attached are removed
How
Updating existing end points and service method to integrate the new requirements
Tests
Add new integration tests
Fixes CORE-270
Fixes CORE-272
Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
**What**
Allow to query the products and orders by sales channels
**How**
Updating the existing end points and repositories (if necessary) to take a new query params that is sales_channel_id as an array of string
**Tests**
Add new integration tests
Fixes CORE-295
Fixes CORE-288
What
Support sales channel remove product batch in medusa, medusa-js and medusa-react
How
By implementing a new endpoint and the associated service method as well as the repository methods.
Medusa-js new removeProductd method in the resource
Medusa-react new hook in the mutations
Tests
Endpoint test
Service test
Integration test
Hook tests
Fixes CORE-292
**What**
Support sales channel list in medusa, medusa-js and medusa-react
**How**
By implementing a new endpoint and the associated service method as well as the repository methods.
Medusa-js new list method in the resource
Medusa-react new hook in the queries
**Tests**
Endpoint test
Service test
Integration test
Hook tests
Fixes CORE-280
**What**
- Add `transformQuery` to get endpoints for product, order and cart
- ensure that the default relations (when getting a singular entity) includes sales channels when enabled
- Add `EmptyQueryParams` class in common types to prevent query parameters while using `transformQuery`
- update product-, order- and cartFactory to include sales channels if provided
- remove `packages/medusa/src/controllers/products/admin-list-products.ts`
**Testing**
- expands sales channel for single order
- expands sales channels for orders with expand parameter
- returns single product with sales channel
- expands sales channels for products with expand parameter
- returns cart with sales channel for single cart
Fixes CORE-293
Co-authored-by: Sebastian Rindom <7554214+srindom@users.noreply.github.com>
Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com>