Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(medusa-plugin-brightpearl): stacking reservations #4383

Merged
merged 7 commits into from
Jul 19, 2023

Conversation

pKorsholm
Copy link
Contributor

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.

@pKorsholm pKorsholm requested a review from a team as a code owner June 21, 2023 14:43
@changeset-bot
Copy link

changeset-bot bot commented Jun 21, 2023

🦋 Changeset detected

Latest commit: 3647302

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
medusa-plugin-brightpearl Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Jun 21, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
medusa-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 19, 2023 7:31am

@pKorsholm
Copy link
Contributor Author

/snapshot-this

@github-actions
Copy link
Contributor

🚀 A snapshot release has been made for this PR

Test the snapshots by updating your package.json with the newly published versions:

yarn add @medusajs/[email protected]

Latest commit: 14bfe6d

@pKorsholm
Copy link
Contributor Author

/snapshot-this

@github-actions
Copy link
Contributor

🚀 A snapshot release has been made for this PR

Test the snapshots by updating your package.json with the newly published versions:

yarn add @medusajs/[email protected]

Latest commit: 14bfe6d

@olivermrbl olivermrbl changed the title Fix(medusa-plugin-brightpearl): stacking reservations fix(medusa-plugin-brightpearl): stacking reservations Jun 26, 2023
@kodiakhq kodiakhq bot merged commit 1304657 into develop Jul 19, 2023
@kodiakhq kodiakhq bot deleted the fix/bp-stacking-reservations branch July 19, 2023 07:38
This was referenced Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants