-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
feat(cart): Shipping methods operations #6075
Conversation
…-module-service-impl
…-module-service-impl
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Ignored Deployments
|
@@ -47,7 +50,7 @@ export default class LineItem { | |||
@Property({ columnType: "text", nullable: true }) | |||
thumbnail?: string | null | |||
|
|||
@Property({ columnType: "text" }) | |||
@Property({ columnType: "integer" }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to support float as quantity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we use numeric and serializer?
@@ -31,7 +31,7 @@ | |||
"prepublishOnly": "cross-env NODE_ENV=production tsc --build && tsc-alias -p tsconfig.json", | |||
"build": "rimraf dist && tsc --build && tsc-alias -p tsconfig.json", | |||
"test": "jest --runInBand --bail --forceExit -- src/**/__tests__/**/*.ts", | |||
"test:integration": "jest --runInBand --forceExit -- integration-tests/**/__tests__/**/*.ts", | |||
"test:integration": "jest --runInBand --forceExit -- integration-tests/__tests__/services/cart-module/*.ts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo: should we revert that?
@@ -47,7 +50,7 @@ export default class LineItem { | |||
@Property({ columnType: "text", nullable: true }) | |||
thumbnail?: string | null | |||
|
|||
@Property({ columnType: "text" }) | |||
@Property({ columnType: "integer" }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we use numeric and serializer?
Closing in favor of #6101 |
Addressed all comments |
Awaiting #6066
What
Add shipping methods
There are three ways to add shipping methods to a cart; the operations differ slightly in behavior:
The first comes with cart validation, while as the two others do not.
In the two latter methods, we naively attempt to add one or more shipping methods to carts with whatever data you have passed. In case you are missing required data (e.g.
cart_id
orunit_price
), or the cart of the passedcart_id
does not exist, we throw a generic error:Remove shipping methods
There are three ways to remove shipping methods from a cart:
The first is a selector-based removal. In this example, we want to remove all shipping methods that have
provider_id=manual
.