Commit Graph

78 Commits

Author SHA1 Message Date
Frane Polić
0c58ead6d8 fix(medusa): Validate customer_id when completing a cart (#3967) 2023-05-07 13:12:06 +02:00
github-actions[bot]
6b2bcc1a36 chore: Version Packages (#3942)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-04 10:51:13 +02:00
Philip Korsholm
9838723192 fix(medusa): Performance improvement for variant availability (#3921)
**What**
- refactor availability invocations to only do one call to the inventory module

@adrien2p would love to run through some tests of this with you and get your take on approach
2023-05-03 09:17:55 +00:00
Riqwan Thamir
4e8045a0ac fix(medusa): Use query relation load strategy on Products (#3926)
* fix(medusa): products retrieve uses query strategy for performance

* chore: packaged version of medusa typeorm fix

* chore: update path

* chore: stock locations uses typeorm version

* chore: resolve typeorm to medusa package

* chore: Update medusa project in CI action

* chore: temp disable transaction timeout for plugins

---------

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: olivermrbl <oliver@mrbltech.com>
2023-05-02 19:37:44 +02:00
Oliver Windall Juhl
d539c6feeb chore: Bump Typeorm to Medusa fork (#3981)
* chore: Bump typeorm to medusa fork

* Update types + utils

* Bump integration test suites

* Create good-parents-prove.md
2023-05-02 14:37:19 +02:00
github-actions[bot]
b41b6303cc chore: Release (#3856)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-04-26 19:09:01 +02:00
Oliver Windall Juhl
3b3236cc01 fix(medusa): Reduce joins in cart retrieval (#3909)
* fix(medusa): Remove discounts.regions relation from cart retrieval

* Create violet-poets-rule.md

* fix service test

* update snapshot

---------

Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>
2023-04-25 12:51:33 +02:00
Philip Korsholm
2be144ff05 feat(medusa): Add purchasable prop on variants when setting availability (#3811)
* write integration tests

* update variant inventory decorator

* update types

* add changeset

* feedback comments

* add yaml schemas

* different oas approach

* pr feedback

* update oas

---------

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-04-20 08:54:26 +02:00
github-actions[bot]
0f51e3a400 chore: Release (#3818)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-04-14 11:18:39 +02:00
github-actions[bot]
3efe13eefd chore: Release (#3782)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-04-12 11:32:05 +02:00
Oliver Windall Juhl
654a546223 chore: Bump Typeorm (#3778) 2023-04-11 18:43:40 +02:00
Oliver Windall Juhl
085fedb1f7 chore(medusa): Upgrade ioredis-mock (#3704)
* chore(medusa): Upgrade ioredis-mock

* Create .changeset/old-spoons-bow.md

* chore: Increas jest timeout

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-04-09 16:10:04 +02:00
olivermrbl
4c268238a4 Merge branch 'master' into develop 2023-04-05 09:18:48 +02:00
olivermrbl
66c59d54ff chore(release): v1.8.0 2023-04-04 18:35:27 +02:00
olivermrbl
f0d37b4d2d chore(release): v1.8.0-rc.8 2023-04-04 17:37:13 +02:00
olivermrbl
7a3194c313 chore(release): v1.8.0-rc.7 2023-04-04 16:07:48 +02:00
Patrick
089f1eb19e feat(tests): harmonize and clean-up yarn test commands convention (#3695)
## What

Harmonize and clean-up yarn test commands convention.

## Why

Current strategy to filter integration tests from unit tests was cumbersome to maintain. Also, some packages declared `test:unit` which ended up being an alias to `test`.

## How

* Remove all occurrences of `test:unit`
* Rename all `test` commands under `/integration-tests/**/package.json` to `test:integration`
* In the root `package.json`, rewrite `test:integration` command to run `turbo run test:integration`
* In the root `package.json`, remove filtering on the `test` command
* Introduce a new `test:integration` task in the Turborepo config.
2023-04-04 13:47:54 +00:00
Philip Korsholm
748833383f hotfix(medusa): Temporary multi-warehouse support for draft orders (#3665)
* remove reservations from draft order creation and show correct inventory

* add changeset

* add integration tests

* adjust inventory on payment if no inventory service is installed
2023-04-04 11:36:51 +02:00
olivermrbl
bb9df09e37 chore(release): v1.8.0-rc.6 2023-04-03 18:05:12 +02:00
Philip Korsholm
0cca13779d Fix(medusa): stocked quantity counting when listing products (#3684)
* count stocked quantity correctly when listing products

* add integration test

* add changeset
2023-04-03 11:07:56 +02:00
olivermrbl
6f85a3d366 chore(release): v1.8.0-rc.5 2023-03-31 13:27:14 +02:00
Oliver Windall Juhl
809ab2e0eb chore: Merge master to develop (#3653) 2023-03-31 13:09:57 +02:00
olivermrbl
89d4d84666 chore(release): v1.8.0-rc.4 2023-03-30 17:12:37 +02:00
Philip Korsholm
5e405be02c feat(medusa): Remove reservations for all line items when an order edit is accepted (#3544)
**What**
- Remove all allocations to line items once an order edit is confirmed

**Why**
- Since all line items of an order are discarded once an order edit is confirmed it will orphan the reservations causing inconsistencies with the stock
2023-03-30 09:56:10 +00:00
Philip Korsholm
5fd74b38ae feat(medusa): remove created reservations on subsequent failure for cart completion (#3554)
**What**
- If cart completion fails after creating reservations, remove those reservations

**Why**
- To avoid hanging reservations if something fails at a later point
2023-03-29 17:03:53 +00:00
olivermrbl
15a43c1cc0 chore(release): v1.8.0-rc.3 2023-03-29 13:42:11 +02:00
olivermrbl
8ddb3952c0 chore(release): v1.8.0-rc.2 2023-03-28 21:04:57 +02:00
olivermrbl
990c79d2d5 chore(release): v1.8.0-rc.1 2023-03-28 19:32:36 +02:00
olivermrbl
b57ea22461 chore: Enter pre-release mode and version packages 2023-03-24 10:16:11 +01:00
Oliver Windall Juhl
ef5ef9f5a2 feat(medusa,event-bus-local,event-bus-redis): Event Bus modules (#2599) 2023-03-22 10:26:21 +01:00
Philip Korsholm
55c5fba0d3 Feat(admin, medusa): add locations to claim and swap creation (#3522)
**What**
- Add location selection to claim and swap creation

Fixes CORE-1269
2023-03-20 14:05:37 +00:00
Philip Korsholm
026bdab05d Feat/fulfill swaps and claims with locations (#3518)
* re-add if statements

* initial implementation

* add changeset

* address feedback

* remove context param from create-fulfillment

* fix tests
2023-03-20 13:48:25 +01:00
Philip Korsholm
ea2633bccf Fix/minor mw fixes (#3521)
**What**
- Fix stock locations quantities being shown as `undefined` and `NaN`
- Throw if updates to location levels are made with negative quantities through the api
- Show "allocated" in order summary for partially fulfilled orders

Fixes CORE-1268, CORE-1267, CORE-1265
2023-03-19 20:28:59 +00:00
Philip Korsholm
0d1b63d773 fix(medusa): Use get for creating fulfillments (#3498)
* use get

* changeset

* use set

* add tests

---------

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-03-16 19:03:36 +01:00
Philip Korsholm
02c77d7059 Fix/adjust reservations correctly (#3474)
**What**
- Adjust reservations correctly according to the following heuristic: 

adjustment by addition:  (i.e. positive quantity adjustment passed to the adjustment method)
- if a reservation for the line-item in the location exists add quantity to that
- if not create a new reservation

adjustment by subtraction: 
- if a reservation with the exact quantity exists, delete it and return
- if a reservation with a greater quantity exists, subtract from it and return 
- otherwise delete from reservations until a reservation with greater quantity than the remaining is found and adjust that with the remaining quantity OR there are no more reservations

Fixes CORE-1247
2023-03-16 09:47:54 +00:00
Philip Korsholm
38c8d49f46 Feat(medusa): handle reservation quantity update for line items (#3484)
**What**
-  Raise exception if a reservation is updated or created to have larger quantity than is unfulfilled for a line-item

Fixes CORE-1249
2023-03-16 09:15:39 +00:00
Carlos R. L. Rodrigues
77d46220c2 Feat(modules-sdk,inventory,stock-location): modules isolated connection (#3329)
* feat: scoped container for modules
2023-03-15 12:09:45 -03:00
Philip Korsholm
10bf05c147 Fix(inventory, stock-location): Remove orphaned location levels and reservations (#3460)
**What**
- Remove related inventory levels and reservation items when a stock location is removed

**How**
- Add bulk deletion methods for both inventory levels and reservation items to the inventory service api
- invoke both on location removal

Fixes CORE-1232
2023-03-15 09:12:46 +00:00
Philip Korsholm
fe9eea4c18 feat(medusa, admin-ui, medusa-react, medusa-js): Allow toggling of manage inventory (#3435)
**What**
- Toggle manage inventory in the inventory management modal

**How**
- Create/update/remove inventory item based on if `manage_inventory` is set and if an inventory item already exists
- Move all stock location updates to when the modal is submitted
- Add create-inventory-item endpoint in the core

Fixes CORE-1196

Co-authored-by: Sebastian Rindom <7554214+srindom@users.noreply.github.com>
2023-03-14 16:14:31 +00:00
Philip Korsholm
30a3203640 Fix(medusa): Missing location id on fulfillments (#3462)
**What**
- include location id when creating a fulfillment
- Allow location updates to reservations without passing along quantity

**Why**
- location_id on fulfillment was null after creation

Fixes CORE-1242, CORE-1243
2023-03-14 11:08:52 +00:00
olivermrbl
24604f1b71 chore: Merge conflicts with master 2023-03-14 11:43:31 +01:00
Philip Korsholm
55a1f232a3 Feat(admin-ui, medusa): request return with location (#3451)
* add location_id to request_return endpoint to support "receive_now" returns

* changeset

* admin request return

* add locations to recieving returns

* cleanup test

* add check for inventory service
2023-03-14 10:35:59 +01:00
Adrien de Peretti
f0a1355feb feat(medusa): Bulk emit events (#3407) 2023-03-13 15:28:51 +01:00
Frane Polić
f97b3d7cce feat(medusa): Cache modules (#3187) 2023-03-10 15:09:26 +01:00
Kasper Fabricius Kristensen
40de54b010 feat(admin,admin-ui,medusa): Add Medusa Admin plugin (#3334) 2023-03-03 10:09:16 +01:00
Philip Korsholm
5eb61fa0ef fix(medusa): update create fulfillment flow (#3172)
* update create fulfillment flow

* move transaction service creation close to where it's used

* integration tests

* fix feedback

* use transformBody

* add changeset
2023-02-28 16:28:11 +01:00
Philip Korsholm
a1e59313c9 feat(medusa, stock-location): Sales channel filtering when listing locations (#3324)
* only add ordering select if not already selected

* add integration test

* add changeset

* remove catch

* linting and suggestion from adrien

* add sales channel filtering when listing locations

* add changeset

* add exception back into sales channel location service

---------

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-02-28 10:41:59 +01:00
Philip Korsholm
08c8aa46c5 fix(medusa): Only add ordering select if not already present (#3319) 2023-02-26 13:08:06 +01:00
olivermrbl
e1b92e9b04 fix: Merge conflicts with master 2023-02-22 17:38:49 +01:00
Oliver Windall Juhl
f88af0c28d fix(medusa): Received quantity on return lines (#3267) 2023-02-17 10:13:50 +00:00