Files
medusa-store/packages
Philip Korsholm 1304657133 fix(medusa-plugin-brightpearl): stacking reservations (#4383)
**What**
- Change the way we create reservations in brightpearl

Previously we would create reservations 1 to 1 from medusa to brightpearl. This causes issues due to brightpearl collapsing reservations causing occasional double reservations. 
i.e. this update would allocate 4 stock for the order row
```
{
	"products": [
		{
			"productId": "2713",
			"salesOrderRowId": "224688",
			"quantity": "2"
		},
		{
			"productId": "2713",
			"salesOrderRowId": "224688",
			"quantity": "2"
		}
	]
}
```

Instead what we do now is create the rows with reservation quantity based on total quantity reserved in medusa. This means that a reservation creation acts as a trigger to update the reservation in brightpearl, but not with any specific amount. Instead we calculate how much total is reserved and create that in brightpearl.
2023-07-19 07:38:29 +00:00
..
2023-07-11 20:38:52 +02:00
2023-07-11 20:38:52 +02:00
2023-07-11 20:38:52 +02:00