Commit Graph

896 Commits

Author SHA1 Message Date
Stevche Radevski
a62a8be016 chore: Move price list tests to HTTP folder (#7632)
* chore: Move price list tests to HTTP folder

* chore: Remove several unused helpers
2024-06-06 17:17:41 +02:00
Riqwan Thamir
0507dbe027 chore(core-flows,inventory,types,medusa): add fixes to inventory module + location levels api (#7629)
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
2024-06-06 12:58:17 +00:00
Kasper Fabricius Kristensen
50ce223e4b feat(types,js-sdk,medusa,fulfillment): Types and SDK methods related to Stock Locations (#7625) 2024-06-06 11:04:42 +02:00
Stevche Radevski
d2e1e9f8c7 fix: Apply strict schema for all body and query parameters (#7624) 2024-06-05 15:40:54 +00:00
Stevche Radevski
a39b542759 chore: Move fulfillment set tests to http folder (#7618) 2024-06-05 17:35:04 +02:00
Riqwan Thamir
0a5b2b5fa7 chore: fix inventory items specs (#7620) 2024-06-05 15:27:54 +02:00
Stevche Radevski
37b794b89d chore: Move upload tests to HTTP layer (#7610) 2024-06-05 12:24:33 +00:00
Stevche Radevski
b2f2c366ec chore: Move stock location tests to HTTP folder (#7615) 2024-06-05 10:37:14 +00:00
Stevche Radevski
1e3c8747e5 chore: Move inventory tests to HTTP layer (#7613) 2024-06-05 09:36:58 +00:00
Stevche Radevski
fafc92b875 Revamp auth module to support multiple providers linked to a single auth identity (#7521) 2024-06-05 07:47:16 +00:00
Oli Juhl
dc087bf310 feat: Move shipping option + profile test and more (#7609) 2024-06-05 08:36:41 +02:00
Stevche Radevski
e44fe78b96 fix: Several fixes to store product endpoints, moved several test suites to HTTP (#7601)
* 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
2024-06-04 21:00:07 +02:00
Riqwan Thamir
e7005a0aac feat(core-flows,medusa): adds inventory kit creation to variants endpoint (#7599)
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
2024-06-04 13:49:31 +00:00
Harminder Virk
8d9d78029b Remove redundant methods from pricing module (#7597) 2024-06-04 16:33:06 +05:30
Carlos R. L. Rodrigues
68fb04b849 fix(order): ignore reservation when manage_inventory is false (#7594) 2024-06-04 07:08:54 -03:00
Stevche Radevski
0929c4f457 Feat: Add product tag endpoints, move tests to HTTP folder (#7591)
* chore: Move product type tests to HTTP folder

* feat: Add product tags endpoints and move tests to HTTP folder
2024-06-04 10:56:22 +02:00
Oli Juhl
ce40fe88f5 chore: Move admin invites + user tests to HTTP (#7596) 2024-06-04 10:53:01 +02:00
Riqwan Thamir
ecfbfcc707 feat(core-flows,modules-sdk,types,medusa,link-modules): adds variant <> inventory item link endpoints (#7576)
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
```
2024-06-03 18:23:29 +00:00
Carlos R. L. Rodrigues
122186a78d chore(order): cancel order (#7586) 2024-06-03 12:31:33 -03:00
Stevche Radevski
fdd9022376 chore: Move payment tests to http folder (#7588) 2024-06-03 15:04:18 +00:00
Oli Juhl
0c0c510a37 chore: Move admin region tests (#7582) 2024-06-03 14:25:43 +02:00
Stevche Radevski
eb9b77a4d7 chore: Temporarily disable variant ordering test (#7578) 2024-06-03 12:26:39 +02:00
Stevche Radevski
100154d905 chore: Move currency, collection, and auth tests to http folder (#7581)
* chore: Move auth tests to http folder

* chore: Migrate collection tests to http folder

* chore: Move currency tests to http folder
2024-06-03 12:13:22 +02:00
Oli Juhl
cabdb2fcd8 chore: Move sales channel tests (#7579)
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
2024-06-03 09:47:45 +00:00
Oli Juhl
65d3222973 chore: Move customer + customer group integration tests and fixes issues (#7577)
* chore: Move customer + customer group and fixes issues

* remove /customer sendpoint
2024-06-03 10:52:32 +02:00
Carlos R. L. Rodrigues
af0140d317 feat(order): cancel fulfillment (#7573) 2024-06-02 09:33:24 -03:00
Oli Juhl
4e04214612 chore: Move product category integration tests (#7569)
* chore: Move category integration tests

* remove module service
2024-06-02 14:03:11 +02:00
Stevche Radevski
294ec36cc3 Move few test suites from api to http folder (#7558)
* 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
2024-05-31 16:12:04 +02:00
Stevche Radevski
4117beed58 chore: Refactor batch product workflows and add tests (#7540) 2024-05-30 15:53:03 +02:00
Riqwan Thamir
15e9787465 feat(types,medusa): add inventory quantity to products endpoint (#7541)
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
2024-05-30 13:20:06 +00:00
Stevche Radevski
eeb8225b5e chore: Remove redundant product tests, add missing to http layer (#7543) 2024-05-30 11:26:50 +00:00
Stevche Radevski
6698f3ab7b feat: Add http integration tests and enable them in pipeline (#7532) 2024-05-30 10:51:31 +02:00
Stevche Radevski
5ad6864b82 feat: Improve zod error messages (#7535) 2024-05-30 09:52:47 +02:00
Riqwan Thamir
f0b9d5534e chore: query inventory items by location id (#7524)
what:

- allows querying inventory items by the correct location_id
2024-05-29 14:14:10 +00:00
Carlos R. L. Rodrigues
f1ced57d5f chore: payment auto capture + remove enum from utils (#7513)
What:

- handles payments session that are auto captured
- removes all the enums from `@medusajs/types`
- move all `@medusajs/types` to devDependencies
2024-05-29 11:12:59 +00:00
Carlos R. L. Rodrigues
bbca54efa7 chore(order): aggregate statuses (#7497) 2024-05-29 07:05:42 -03:00
Stevche Radevski
af7a885b5b fix: Ensure sales channel updates don't remove sales channel on other products (#7510)
* fix: Make all product tests pass

* fix: Ensure product update doesnt remove sales channels on other products
2024-05-28 18:24:27 +02:00
Harminder Virk
82be054a1a chore: Rename config properties to camelCase (#7498)
* refactor: rename config types to camelCase

* refactor: update config references to use renamed options

* refactor: update more references

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2024-05-28 14:49:29 +02:00
Oli Juhl
c9de1d28a4 feat: Assign store default sales channel in cart creation (#7495) 2024-05-28 12:12:01 +02:00
Oli Juhl
ad21bd30b1 fix: errors thrown in transformer (#7480)
* chore: wup

* throw on error

* add back test

---------

Co-authored-by: Carlos R. L. Rodrigues <rodrigolr@gmail.com>
2024-05-28 08:44:33 +02:00
Riqwan Thamir
7baedf73d5 feat(core-flows,types,utils,medusa): Update existing line items when adding the same variant to cart (#7470)
* 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
2024-05-27 17:54:11 +02:00
Adrien de Peretti
45bcdfec17 fix: Listening events (#7474)
* fix: Listening events

* cleanup
2024-05-27 15:31:57 +02:00
Stevche Radevski
10ef32c5a3 feat: Apply authentication middleware globally (#7396)
* feat: Apply auth middleware globally

* feat: Remove local auth middleware where it makes sense
2024-05-27 15:24:53 +02:00
Carlos R. L. Rodrigues
62ef82f497 feat(order): fulfillment workflow (#7385)
FIXES: CORE-2162 CORE-2167 CORE-2041
2024-05-27 12:49:33 +00:00
Adrien de Peretti
e275e01d85 chore: Cleanup medusa test utils (#7464)
* chore: Cleanup medusa test utils

* update yarn

* cleanup

* fix key

* cleanup

* fixes

* fixes

* fixes

* fixes

* fix runners

* fix bootstrap

* naming

* Improve runners options

* Improve runners options

* Improve runners options

* cleanup

* fix tests
2024-05-27 14:14:32 +02:00
Adrien de Peretti
b8bc3ed16f chore: Start cleaning up medusa-core-utils (#7450)
**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
2024-05-27 08:00:15 +00:00
Stevche Radevski
28a3f9a3df feat: Add list cart option typings, make region optional on update cart (#7455) 2024-05-27 09:37:10 +02:00
Adrien de Peretti
f585b13c96 chore: remove babel usage (#7452) 2024-05-24 20:51:12 +02:00
Stevche Radevski
135772b27b feat: Revert to using app_metadata for authentication (#7433) 2024-05-23 22:01:41 +02:00
Stevche Radevski
8a070d5d85 Revamp the authentication setup (#7419)
* feat: Add email pass authentication provider package

* feat: Revamp auth module and remove concept of scope

* feat: Revamp the auth module to be more standardized in how providers are loaded

* feat: Switch from scope to actor type for authentication

* feat: Add support for per-actor auth methods

* feat: Add emailpass auth provider by default

* fix: Add back app_metadata in auth module
2024-05-23 20:56:40 +02:00