@final-commerce/command-frame 0.3.2-beta.1 → 0.4.0-beta.1
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.
|
@@ -3,7 +3,19 @@ import type { AddProductFeeParams } from "../add-product-fee/types";
|
|
|
3
3
|
export interface AddProductToCartParams {
|
|
4
4
|
/** ID of the variant to add. */
|
|
5
5
|
variantId: string;
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Defaults to 1. **May be fractional** — a variant sold by weight, volume or length is priced
|
|
8
|
+
* per its own unit and keyed in that unit, so `0.456` kg is a quantity, not a typo.
|
|
9
|
+
*
|
|
10
|
+
* How many decimals are allowed is the variant's own business: `variant.unit.precision` —
|
|
11
|
+
* `3` for a litre, `0` for anything sold by the piece. The engine refuses a quantity finer
|
|
12
|
+
* than that and says which unit it was measured against; do not round, floor or clamp before
|
|
13
|
+
* sending, and never key a quantity in base units to work around it (a per-100g price with a
|
|
14
|
+
* gram count is explicitly not supported).
|
|
15
|
+
*
|
|
16
|
+
* A quantity field should take its step and its decimal count from `variant.unit.precision`,
|
|
17
|
+
* not from a constant.
|
|
18
|
+
*/
|
|
7
19
|
quantity?: number;
|
|
8
20
|
/** Array of discounts to apply immediately. */
|
|
9
21
|
discounts?: AddProductDiscountParams[];
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
export interface UpdateCartItemQuantityParams {
|
|
2
2
|
/** The unique identifier for the specific cart item to update. */
|
|
3
3
|
internalId: string;
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* The new quantity. If set to 0, the item will be removed from the cart.
|
|
6
|
+
*
|
|
7
|
+
* **May be fractional** for a variant sold by measure; the number of decimals allowed comes
|
|
8
|
+
* from `variant.unit.precision`. The engine refuses anything finer and names the unit in the
|
|
9
|
+
* error. Do not round or clamp before sending — a silently altered quantity is charged and
|
|
10
|
+
* deducted differently than the one the cashier typed.
|
|
11
|
+
*/
|
|
5
12
|
quantity: number;
|
|
6
13
|
}
|
|
7
14
|
export interface UpdateCartItemQuantityResponse {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@final-commerce/command-frame",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0-beta.1",
|
|
4
4
|
"description": "Commands Frame library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"ignoreBranchesMissingTickets": true
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@final-commerce/common": "^2.0.
|
|
60
|
+
"@final-commerce/common": "^2.2.0-beta.1"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@commitlint/cli": "^19.0.0",
|