feat(medusa): Create fulfillment with location (#2931)

* remove duplicate key from oas

* changeset

* initial suggestion for adding locations to fulfillments

* update migration

* re-add functionality for removing entire reservations

* fix tests

* add location when adjusting reserved inventory of a line_item

* add changest

* handle multiple reservations for a product in the same channel

* confirm inventory in stock location previous to creating the fulfillment

* fix tests after updating create-fulfillment to confirm inventory prior to creating fulfillment

* remove bugged code

* initial validation

* initial changes for review

* chekcpoint

* update validate inventory at location

* redo some unwanted changes

* typing

* update snapshots

* redo change for eslintrc

* add eslint disable

* re-order methods in interface

* assert no_notification

* iterate one time less

* add test for validation of correct inventory adjustments in case of no inventory service installation

* ensure correct adjustments for order cancellations

* remove comment

* fix tests

* fix but with coalescing

* remove location id from confirm inventory

* don't throw when adjusting reservations for a line item without reservations

* move reservation adjustments to the api

* add multiplication for updating a reservation quantity

* move inventory adjustments from the service layer to the api

* delete reservation if quantity is adjusted to 0

* rename updateReservation to updateReservationItem

* update dto fields

* reference the correct fields

* update with transaction

* add jsdocs

* force boolean cast

* context-ize cancel and create fulfillment transaction methods

* undo notification cast

* update with changes

* refactor withTransaction to variable

* use maps

* fix service mocks
This commit is contained in:
Philip Korsholm
2023-01-09 14:44:34 +01:00
committed by GitHub
parent 28bec599ae
commit 16716f5a4f
16 changed files with 546 additions and 86 deletions
@@ -152,6 +152,7 @@ Object {
"quantity": 1,
},
],
"location_id": null,
"metadata": Object {},
"no_notification": null,
"order_id": null,
@@ -1198,6 +1199,7 @@ Object {
"quantity": 2,
},
],
"location_id": null,
"metadata": Object {},
"no_notification": null,
"order_id": Any<String>,
@@ -1254,6 +1256,7 @@ Object {
"quantity": 2,
},
],
"location_id": null,
"metadata": Object {},
"no_notification": null,
"order_id": Any<String>,
@@ -1931,6 +1934,7 @@ Object {
"quantity": 1,
},
],
"location_id": null,
"metadata": Object {},
"no_notification": null,
"order_id": null,