## 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.
* 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
**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
**What**
- If cart completion fails after creating reservations, remove those reservations
**Why**
- To avoid hanging reservations if something fails at a later point
**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
**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
**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
**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>
**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
* 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
* update create fulfillment flow
* move transaction service creation close to where it's used
* integration tests
* fix feedback
* use transformBody
* add changeset
* 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>
* 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
* add mw feature flag
* add services
* add types
* add module interfaces
* add interface export
* add models for mw
* to be ammended
* remove featureflag
* use correct count
* update cart completion strategy
* swap service conversion
* update return service
* update order service
* update claim service
* add exception to claim item
* update cart service
* add indicies
* add changeset
* nullable changes in store
* store model update
* fix unit tests
* remove old inventory service
* format integration test
* update snapshots
* remove old inventory service tests
* update snapshots
* remove old code
* option updates
* naming
* add jsdoc to pv inventory service
* rename class variables
* pr feedback
* rename option to context
* if(variant_id) instead of if(typeof varia...)
* update tests
* add jsdoc
* go for custom
* update code for readability