@labdigital/commercetools-mock 2.9.0 → 2.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -4
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/repositories/cart.ts +9 -0
- package/src/services/cart.test.ts +24 -0
package/dist/index.d.cts
CHANGED
|
@@ -81,6 +81,7 @@ declare class CartRepository extends AbstractResourceRepository<'cart'> {
|
|
|
81
81
|
getActiveCart(projectKey: string): Cart | undefined;
|
|
82
82
|
actions: {
|
|
83
83
|
addLineItem: (context: RepositoryContext, resource: Writable<Cart>, { productId, variantId, sku, quantity }: CartAddLineItemAction) => void;
|
|
84
|
+
recalculate: () => void;
|
|
84
85
|
addItemShippingAddress: (context: RepositoryContext, resource: Writable<Cart>, { action, address }: CartAddItemShippingAddressAction) => void;
|
|
85
86
|
changeLineItemQuantity: (context: RepositoryContext, resource: Writable<Cart>, { lineItemId, lineItemKey, quantity }: CartChangeLineItemQuantityAction) => void;
|
|
86
87
|
removeLineItem: (context: RepositoryContext, resource: Writable<Cart>, { lineItemId, quantity }: CartRemoveLineItemAction) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -81,6 +81,7 @@ declare class CartRepository extends AbstractResourceRepository<'cart'> {
|
|
|
81
81
|
getActiveCart(projectKey: string): Cart | undefined;
|
|
82
82
|
actions: {
|
|
83
83
|
addLineItem: (context: RepositoryContext, resource: Writable<Cart>, { productId, variantId, sku, quantity }: CartAddLineItemAction) => void;
|
|
84
|
+
recalculate: () => void;
|
|
84
85
|
addItemShippingAddress: (context: RepositoryContext, resource: Writable<Cart>, { action, address }: CartAddItemShippingAddressAction) => void;
|
|
85
86
|
changeLineItemQuantity: (context: RepositoryContext, resource: Writable<Cart>, { lineItemId, lineItemKey, quantity }: CartChangeLineItemQuantityAction) => void;
|
|
86
87
|
removeLineItem: (context: RepositoryContext, resource: Writable<Cart>, { lineItemId, quantity }: CartRemoveLineItemAction) => void;
|
package/dist/index.js
CHANGED
|
@@ -2315,6 +2315,8 @@ var CartRepository = class extends AbstractResourceRepository {
|
|
|
2315
2315
|
}
|
|
2316
2316
|
resource.totalPrice.centAmount = calculateCartTotalPrice(resource);
|
|
2317
2317
|
},
|
|
2318
|
+
recalculate: () => {
|
|
2319
|
+
},
|
|
2318
2320
|
addItemShippingAddress: (context, resource, { action, address }) => {
|
|
2319
2321
|
const newAddress = createAddress(
|
|
2320
2322
|
address,
|