Commit Graph

1682 Commits

Author SHA1 Message Date
Oliver Windall Juhl
d2b272fab6 feat(medusa): Trim discount code on insert and retrieve (#2369) 2022-10-07 09:07:32 +02:00
Oliver Windall Juhl
1c688ec499 fix(medusa): Add allowed relations to order retrieval (#2370)
**What**
Add allowed relations to list orders and get order to throw appropriate error message + status code

**Test**
- Integration: Throw on invalid relation provided to list orders
- Integration: Add test suite get order
   - Successfully retrieve order with expand + fields
   - Throw on invalid relation provided
2022-10-06 13:39:47 +00:00
Philip Korsholm
642902aaeb feat(medusa-js, medusa-react): Support expand fields in order retrieval (#2353) 2022-10-06 13:58:46 +02:00
Carlos R. L. Rodrigues
e20f77ac66 feat: payment collection data model (#2343)
* feat: payment collection data model
2022-10-04 15:41:12 -03:00
olivermrbl
44b774c72c Merge branch 'master' into develop 2022-10-04 19:09:36 +02:00
Oliver Windall Juhl
5908d9b9b6 fix(medusa): Race condition in cart completion strategy (#2341) 2022-10-04 16:31:36 +02:00
Shahed Nasser
88c86614a4 docs: changed medusa's readme (#2334) 2022-10-04 15:48:44 +03:00
olivermrbl
94eb2bfc02 Merge branch 'master' into develop 2022-10-04 10:50:12 +02:00
Adrien de Peretti
df62e618bc feat(medusa,medusa-payment-stripe): Migrate Stripe to Abstract payment service (#1790) 2022-10-04 10:49:43 +02:00
Oliver Windall Juhl
1024ac1a36 fix(medusa-payment-manual): Add missing update method (#2254) 2022-10-04 10:48:39 +02:00
Philip Korsholm
00959f79bc Feat(medusa): remove item from order (#2273)
* wait for update to order edit model

* delete line item tests

* create remove method for lineitem with tax lines

* add remove item tests

* split delete allocation tests into two: more and less than total

* remove unused import

* cleanup

* add medusa-js and react endpoints

* pr feedback fixes

* linting

* remove unused relation from query

* remove removed-event and unused imports

* add await
2022-09-30 09:48:18 +02:00
Adrien de Peretti
95c0dc653a feat(medusa, medusa-js, medusa-react): Implement store complete order… (#2275)
**What**

Allow a customer to complete a requested order edit.

**Test**
- Unit tests complete flow
- Unit tests medusa react
- Integration tests of order edit completion

FIXES CORE-501
2022-09-29 17:06:45 +00:00
Adrien de Peretti
678a06752a feat(medusa): Migrate services to use TransactionBaseService (#2276) 2022-09-29 15:58:17 +02:00
Oliver Windall Juhl
8797a1441b fix(medusa): Query SalesChannel Products in storefront (#2272) 2022-09-29 14:40:24 +02:00
Adrien de Peretti
a2bb504e6e fix(medusa): order retrieval missing relations + allow for expand (#2267)
**What**

Fix missing relation on the order retrieval endpoint as well as allow the expand fields

FIXES CORE-578
2022-09-29 10:04:39 +00:00
Adrien de Peretti
9a532de7bd feat(medusa): Improve transform middleware (#2271)
**What**

Improve transform query middleware management of the allowed fields and relations in order to improve security upon access data

FIXES CORE-651
2022-09-29 09:41:09 +00:00
Adrien de Peretti
2be00007b2 Feat(medusa, medusa-js, medusa-react): order edit confirmation (#2264)
**what**

Support confirm of an order edit:

Upon confirmation, the items of the original order are detached and the items from the order edit are attached to the order.
The order total is recomputed with the correct total which can defer from the paid_total and refundable_amount (based on the paid_total)


**Tests**

- Unit tests medusa-js and medusa-react as well as the core
- Integration test of the confirmation flow which check that the order edit is properly confirmed and can be confirmed idempotently. Also validate the totals and that the order items correspond to the order edit items. Also validate the order totals.

FIXES CORE-498
2022-09-29 08:00:48 +00:00
Philip Korsholm
87ad29dda4 Feat(medusa): add 'edits' to order relations if the feature is enabled (#2263)
**What**
- add "edits" relation if order editing is enabled
- use the featureflag key from the saleschannels flag in loaders
2022-09-28 14:11:01 +00:00
Sebastian Rindom
7dc8d3a0c9 feat(medusa): PriceList import strategy (#2210) 2022-09-28 15:30:15 +02:00
Frane Polić
884f36e8a8 feat: add a line item to an order edit (#2243)
**What**
- Implement adding a line item to order (edit)

**How**
- _by implementing the following "flow"_
  - generate a line item
  - computing line item adjustments for that line item
  - creating tax lines
  - creating a change record

**Testing**
- **_integration tests_**
  - check if line item and order item change objects are created (with correct tax lines)
  - line item adjustments are generated if
    - fixed discount is applied to cart
    - percentage discount is applied
- **_unit tests_** 
  - ensure that methods from Inventory, LineItem, LineItemAdjustment etc. services are called 

---

RESOLVES CORE-495
2022-09-28 11:51:13 +00:00
Adrien de Peretti
474e97252c Feat(medusa, medusa-js, medusa-react): order edit item update (#2246)
**what**
Support `updateLineItem` which does the following:
- If no item change exist then create a new one and attaches the clone item with the adjustments and tax lines
- if an item change exists then delete/create adjustments and tax lines and update the cloned item quantity

**Tests**
- Unit tests core + client
- integration tests
  - When no item change already exists
  - When an item change already exists

FIXES CORE-497
2022-09-28 09:09:33 +00:00
Philip Korsholm
1807bff029 Feat(medusa): cancel order edit (#2240)
**What**
- cancel an order edit

Fixes CORE-500
2022-09-27 03:13:15 +00:00
Adrien de Peretti
d138baf460 feat(medusa): refactor the way the order edit handle the items (#2255)
* feat(medusa): Reftor the way the order edit works
2022-09-26 16:01:20 +02:00
Sebastian Rindom
7e56935e7a fix(medusa): Remove atomicPhase usage in OAuthService (#2249) 2022-09-26 11:09:45 +02:00
Adrien de Peretti
74342fc1ea feat(medusa): Improve order edit retrieve active (#2244)
**What**
- Improve `retrieveActive` to take into account `(confirmed/canceled/declined)_at`

**Test**
- one more Integration test on that case

FIXES CORE-601
2022-09-22 16:19:10 +00:00
Philip Korsholm
6da29c72c4 Feat(medusa): request order edit (#2239)
**What**
- Implement `admin/order-edits/:id/request`

Fixes CORE-499
2022-09-22 10:17:00 +00:00
Adrien de Peretti
14e808c724 feat(medusa, medusa-js, medusa-react): Implement item change deletion from an order edit (#2241) 2022-09-22 11:02:58 +02:00
Carlos R. L. Rodrigues
eb8034502b chore: initial commit fix linting issues (#2169)
* chore: lint fixes
2022-09-21 12:19:03 -03:00
Philip Korsholm
c661cc789b Feat/decline order edit (#2234)
**What**
- Decline an order edit from a store endpoint
- Refactor totals setting to a service method

Fixes CORE-502
2022-09-21 11:02:10 +00:00
Frane Polić
de85a971c6 fix: infer MA currency on PL create (#2232)
**What**
- a MoneyAmount record can be created with either providing region or currency. MA records cannot be inserted in the DB without currency due to not null constraints therefore the currency needs to be inferred from provided region

**How**
- by using the same utility that fixes this issue on PL update

**Testing**
- extend the "create PL" integration test to handle a MA with a region

---

FIXES CORE-525
2022-09-19 18:30:31 +00:00
Frane Polić
e1fe5ed094 feat(medusa): Update OrderEdit (#2220) 2022-09-19 13:29:12 +02:00
Philip Korsholm
5a2ac76762 feat(medusa): Hard delete OrderEdits (#2225) 2022-09-19 10:18:21 +02:00
Oliver Windall Juhl
3f73170288 fix(medusa): Normalize discount code before querying DB (#2224)
**What**
Normalize discount code before querying DB

Fixes CORE-567
2022-09-16 12:01:36 +00:00
Adrien de Peretti
f7177c9033 feat(medusa): Implement premises of the creation flow of an order edit (#2187)
**What**
- Implements the admin create end point 
- Service implementation of the create method and the retrieveActive as well as the totals computation
- Improve compute line items
- client
  - medusa-js api
  - medusa-react mutations hooks

**Tests**
- Unit tests of the create end points
- Unit tests of the service create method
- Integration tests for admin that also take into account totals computations
- client
  - medusa-js tests
  - medusa-react hooks tests

FIXES CORE-491
2022-09-16 08:29:40 +00:00
sabakhilji
6132711eef fix(medusa-js): Use correct payload type in medusa-js (#2207) 2022-09-16 09:42:26 +02:00
Philip Korsholm
09627c01d3 feat(medusa): Support OrderEdit removal (#2204) 2022-09-16 08:39:40 +02:00
olivermrbl
6225aa57b8 chore(release): Publish 2022-09-15 17:22:12 +02:00
olivermrbl
625964dcf3 Merge branch 'master' into develop 2022-09-15 17:15:18 +02:00
Philip Korsholm
6f4b221971 fix(medusa): Cleanup Tax lines in case of a failed cart completion (#2212) 2022-09-15 17:14:10 +02:00
Oliver Windall Juhl
5d75e16b1f fix(medusa): Expose list-currencies endpoint by removing feature flag guard (#2216) 2022-09-15 16:29:14 +02:00
Shahed Nasser
7c6521101e docs: fixed errors in OAS comments (#2215) 2022-09-15 16:01:34 +03:00
Shahed Nasser
9dcbefd829 docs: fixes to OAS comments (#2214)
* fixed tag name

* added price selection query params

* added more info to the currency_code query param

* fix change in imports
2022-09-15 15:04:36 +03:00
Adrien de Peretti
f863d28b9a feat(medusa): Implement premises of order edit retrieval (#2183)
**What**
- Implements the admin/store retrieval end point 
- Service implementation of the retrieve method
- Service implementation of the computeLineItems method which aggregates the right line item based on the changes that are made
- client
  - medusa-js api
  - medusa-react queries hooks

**Tests**
- Unit tests of the retrieval end points
- Unit tests of the service retrieve method and computeLineItems
- Integration tests for admin/store
- client
  - medusa-js tests
  - medusa-react hooks tests

FIXES CORE-492
2022-09-15 09:12:20 +00:00
Shahed Nasser
effa4248b6 docs: added docs for how to Import Products using API (#2209)
* fix code snippet for create upload

* added product import docs

* fix to upload endpoint code example

* added minimum version for MinIO
2022-09-14 16:17:02 +03:00
olivermrbl
3efeb6b84f chore(release): Publish 2022-09-14 11:36:53 +02:00
olivermrbl
b227fcb163 Merge branch 'master' into develop 2022-09-14 10:25:03 +02:00
olivermrbl
9be3860fa5 chore(release): Publish 2022-09-14 10:08:29 +02:00
Frane Polić
992ef733f4 fix(medusa): Check for Sales Channel on product import (#2202) 2022-09-14 09:53:23 +02:00
Sebastian Rindom
eb3b02baf4 fix(medusa): cart to be created with a country code (#2197)
Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2022-09-13 19:19:06 +00:00
Frane Polić
f2eb942b41 feat: order editing data model (#2184)
**What**
- add order editing entities
- add repositories
- add a feature flag for the order editing feature
- add the migrations file

RESOLVES CORE-490
2022-09-13 16:40:21 +00:00