Commit Graph

556 Commits

Author SHA1 Message Date
Carlos R. L. Rodrigues
4e9d257d3b Chore(medusa,utils,types,inventory,stock-location): remove core dependency modules (#3531) 2023-03-23 08:07:32 -03: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
aed7805c0e fix(medusa): Error messages for reset tokens (#3514)
* initial

* reset password token handling

* Create .changeset/old-planes-cross.md

---------

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-03-19 10:52:10 +01:00
Carlos R. L. Rodrigues
aa690beed7 feat(medusa): Modules initializer (#3352) 2023-03-17 12:18:52 -03: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
Riqwan Thamir
061a600f80 fix(medusa): fix rank order changing on category update (#3486)
what:

- fixes issue where ranking changes when only properties other than rank are updated on categories

FIXES CORE-1253
2023-03-16 08:53:49 +00:00
Patrick
522e306e2e feat(oas): declare x-expanded-relations - Store (#3482)
* feat(oas): declare x-expanded-relations - Store

* fixup! feat(oas): declare x-expanded-relations - Store

* fixup! feat(oas): declare x-expanded-relations - Store

* fixup! feat(oas): declare x-expanded-relations - Store

* fixup! feat(oas): declare x-expanded-relations - Store

* chore(changeset): patch

* fix(tests): update store auth integration test

* fix: pr feedback

* fix(test): match response code
2023-03-16 09:08:20 +01: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
Riqwan Thamir
2f42ed35d6 feat(medusa, admin-ui): increase tree depth + scope categories on store + allow categories relation in products API (#3450)
What:
- increase tree depth in react nestable
- scope categories on store queries
- allow categories relation in products API

RESOLVES CORE-1238
RESOLVES CORE-1237
RESOLVES CORE-1236
2023-03-13 17:30:21 +00: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
Adrien de Peretti
53eda215e0 fix(medusa): Issue when ordering with multiple columns (#3385)
**What**
No true fix due to the same issue as [here](https://github.com/typeorm/typeorm/issues/6294) but at least the pagination works again. The ordering can't be applied on multiple columns/relation as it produce the wrong SQL.

FIXES CORE-1193
2023-03-08 12:37:18 +00:00
Riqwan Thamir
1d09a266be feat(medusa): category list API can return all descendant (#3392)
* chore: category list API can return all descendant

* chore: category handle is no longer required via api

* chore: added treescope to sorting

* chore: address feedback on PR
2023-03-07 15:54:49 +01:00
Adrien de Peretti
33c6ccf059 fix(medeusa): Transform query includes options should only be added to allowed props if there is already at least one allowed props (#3362)
**What**
when `fields` only contain includes options, it should return the entire object plus the include options. If the fields contains the included options + other fields, it should only return the requested fields + the included options
2023-03-07 11:52:14 +00:00
Riqwan Thamir
0a6aa0e624 feat(medusa): categories can be ranked based on position (#3341)
* chore: categories can be ranked based on position

* chore: fix tests

* chore: sort categories by order

* chore: fix bug where mpath relationship is messed up

* chore: enable linting - lint changes

* Update packages/medusa/src/repositories/product-category.ts

Co-authored-by: Frane Polić <16856471+fPolic@users.noreply.github.com>

* chore: fixed specs

* chore: cleanup repository to new typeorm interfaces + cleanup

* chore: revert repository changes due to incorrect sql

* chore: addressed pr reviews

---------

Co-authored-by: Frane Polić <16856471+fPolic@users.noreply.github.com>
Co-authored-by: adrien2p <adrien.deperetti@gmail.com>
2023-03-06 15:49:16 +01:00
olivermrbl
ad99a8bd24 chore: Fix merge conflicts with master 2023-03-03 12:01:35 +01:00
Kasper Fabricius Kristensen
40de54b010 feat(admin,admin-ui,medusa): Add Medusa Admin plugin (#3334) 2023-03-03 10:09:16 +01:00
Riqwan Thamir
c432481319 fix(medusa): Creating Product with Sales Channels disabled (#3357) 2023-03-02 11:59:10 +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
Adrien de Peretti
cbbf3ca054 fix(medusa): Clean response data usage for admin and store fields/expand (#3323)
* fix(medusa): Clean response data usage for admin and store fields/expand

* cleanup

* Create mighty-ads-fold.md

* fix integration

* fix integration

* refactor transform query and cleanup

* fix missing re naming

* Update packages/medusa/src/api/middlewares/transform-query.ts

---------

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-02-28 09:48:08 +01:00
Philip Korsholm
08c8aa46c5 fix(medusa): Only add ordering select if not already present (#3319) 2023-02-26 13:08:06 +01:00
Riqwan Thamir
6323868f65 feat(medusa) allow querying category descendants with a param in list endpoint (#3321)
What:

Allowing the list endpoint to return a full tree when requested. 

Why:

When scoped with parent_category_id=null and include_descendant_tree=true, the query cost is fairly low. This allows for fast querying and prevent FE from building out the entire tree from a flat list repeatedly. By default, it is set to false, so this should be an intentional change knowing the costs of doing it for the entire result set. 

How:

When include_descendants_tree is included in the request parameter or the service parameter, we do a loop on results of product categories and do a call to fetch the descendants of that product category. 

RESOLVES CORE-1128
2023-02-24 08:46:52 +00:00
olivermrbl
e1b92e9b04 fix: Merge conflicts with master 2023-02-22 17:38:49 +01:00
Riqwan Thamir
68496ffe60 fix(medusa): fixes bug for mpath incorrectly updated for nested categories (#3311)
* chore: fix issue with mpath being incorrectly set

* chore: address review changes
2023-02-22 15:43:58 +01:00
Adrien de Peretti
d11ab924b8 feat(medusa): Configurable returnable_items on order decorate totals (#3276) 2023-02-21 14:48:49 +01:00
Frane Polić
6c04624727 chore(medusa): remove PublishableAPIKeys feature flag (#3087) 2023-02-20 21:16:08 +01:00
Adrien de Peretti
46547f29c7 chore(medusa): Improve store list products (#3252)
* chore(medusa): Improve list products by 46.5 percents

* fix handler

* todo's

* Create tricky-terms-wash.md

---------

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-02-20 12:45:05 +01:00
Oliver Windall Juhl
f88af0c28d fix(medusa): Received quantity on return lines (#3267) 2023-02-17 10:13:50 +00:00
Rares Stefan
12d304307a feat(medusa-js, medusa-react, medusa): Prepare API for admin implementations (#3110)
********What********
Add `joinSalesChannels util to stock locations

Add the following endpoints to medusa-react
- inventory items
    - mutations
        - update
        - delete
        - update location level
        - delete location level
        - create location level
    - queries
        - list inventory items
        - get inventory item
        - list location levels
- Stock locations
    - mutations
        - create stock location
        - update stock location
        - delete stock location
    - queries
        - list stock locations
        - get stock locatoin
- Variants
    - queries
        - get inventory
- Reservations
    - mutations
        - create reservation
        - update reservation
        - delete reservation
    - queries
        - list reservations
        - get reservation
- sales channels 
  - mutations
    - associate location with sc
    - remove location association

**Why**
- Update clients to reflect new api endpoints in the core with inventory modules

Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>
2023-02-16 08:49:48 +00:00
Riqwan Thamir
121b42acfe chore(medusa): Typeorm upgrade to 0.3.11 (#3041) 2023-02-15 16:25:30 +01:00
Oliver Windall Juhl
968eb8fc6b fix(medusa): Refund amount on returns in claim flow (#3237) 2023-02-14 12:47:06 +01:00
Adrien de Peretti
5e0273a370 chore(medusa): New totals calc. in Swap creation (#3191)
* feat(medusa): Cleanup swap creation flow

* revert test and package

* fix unit tests

* fix swap seeder that does not include the tax lines on the return line item

---------

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-02-14 10:52:45 +01:00
Carlos R. L. Rodrigues
80452332d8 fix(medusa): Default sales channel on product create (#3249)
What:
Assign the default sales channel if none is provided while creating a new product.


FIXES: CORE-1114

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-02-14 08:46:14 +00:00
Adrien de Peretti
4cb44a3a2e fix(medusa): Discount allocation precision issues (#3244) 2023-02-13 17:22:18 +01:00
olivermrbl
4e4da52e8c Merge branch 'master' into develop 2023-02-10 09:27:19 +01:00
Oliver Windall Juhl
472f96d7fb fix(medusa): Missing refund amount when creating claim (#3224) 2023-02-10 09:26:54 +01:00
Adrien de Peretti
eee9283818 feat(medusa): Allow empty fields/expand (#3220) 2023-02-09 18:05:56 +01:00
olivermrbl
d3feb62b85 Merge branch 'master' into develop 2023-02-09 17:52:41 +01:00
Frane Polić
61b0b2f3aa fix(medusa): Pass query transformer config in storefront controllers (#3219) 2023-02-09 17:52:04 +01:00