Commit Graph

17 Commits

Author SHA1 Message Date
olivermrbl
f7a63f1782 chore(integration-tests): Fixed merge conflict 2022-08-25 16:04:49 +02:00
Carlos R. L. Rodrigues
ffd6234356 chore(integration): throw errors on catch blocks (#2091)
Why:
Suppressing errors and not failing the execution will lead to misleading errors of the following tests.

Fixes CORE-461
2022-08-25 06:36:24 +00:00
Adrien de Peretti
b3b69d7117 fix(integration-tests): Use asymmetric matcher for arrays in tests (#1992) 2022-08-07 11:50:12 +02:00
Adrien de Peretti
3b28998421 feat(medusa): Create/update Product Sales Channels (#1870)
* 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>
2022-07-28 20:19:30 +02:00
Philip Korsholm
5ce8839c54 add is_disabled to create sales channel (#1928)
**What**
- include `is_disabled` when creating a sales channel

**Why**
- To enable creation of draft sales channels
2022-07-28 14:17:11 +00:00
Adrien de Peretti
df66378535 feat(medusa): Attach or update cart sales channel (#1873)
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>
2022-07-27 16:54:05 +00:00
Adrien de Peretti
110c995a6a feat(medusa): Allow to query order/product by SC (#1867)
**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
2022-07-19 16:54:20 +00:00
Adrien de Peretti
f35ea5156a feat(medusa, medusa-js, medusa-react): Bulk add Products to a SalesChannel (#1833) 2022-07-14 16:39:44 +02:00
Adrien de Peretti
cdd91974f9 feat(medusa, medusa-js, medusa-react): Start implementing remove batch products on a sales channel (#1842)
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
2022-07-13 19:40:23 +00:00
Adrien de Peretti
a1a5848827 feat(medusa, medusa-js, medusa-react): Implement Sales Channel list (#1815)
**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
2022-07-13 10:28:53 +00:00
Oliver Windall Juhl
4e375c2203 feat(medusa): Prevent default channel from being deleted (#1835)
**What**
Prevent the default channel from being deleted

Fixes CORE-317
2022-07-13 06:41:03 +00:00
Philip Korsholm
19f35ba6aa Feat(medusa, medusa-js, medusa-react): Include sales channels in related queries as an optional expand parameter (#1816)
**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>
2022-07-11 16:45:01 +00:00
Adrien de Peretti
2d03634cfc feat(medusa, medusa-js, medusa-react): Implement Sales Channel deletion (#1804) 2022-07-07 10:47:51 +02:00
Frane Polić
0d1624cf6a feat(medusa, medusa-js, medusa-react): Implement Sales Channel creation (#1795) 2022-07-06 22:18:05 +02:00
Philip Korsholm
9d19cc0818 feat(medusa, medusa-js, medusa-react): Implement Sales Channel update (#1797) 2022-07-06 15:44:09 +02:00
Adrien de Peretti
263a661031 feat(medusa, medusa-js, medusa-react): Implement Sales Channel retrieval (#1793) 2022-07-06 12:17:26 +02:00
Philip Korsholm
413b2850bf feat(medusa): SC service (#1784)
* add sales channel service and empty api index

* add integration testing file

* add tyeps

* remove ts directive

* add sales channel test

* update import

* remove unused import

* fix tests
2022-07-05 14:40:10 +02:00