@propeller-commerce/propeller-sdk-v2 0.16.0 → 0.17.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/CHANGELOG.md CHANGED
@@ -4,6 +4,46 @@ All notable changes to `@propeller-commerce/propeller-sdk-v2` are documented her
4
4
 
5
5
  ---
6
6
 
7
+ ## [0.17.0] - 2026-09-23
8
+
9
+ Spare-parts machine fields come back in every language the tenant authored,
10
+ instead of only the one the query asked for.
11
+
12
+ ### Changed
13
+
14
+ - **`SparePartsMachineMinimalFields` no longer passes `(language: $language)`
15
+ to `name`, `description` and `slug`.** The field argument narrowed each of
16
+ them to a single language, which defeated the cross-language fallback every
17
+ consumer implements (`getLocalizedValue` returns the first non-empty entry).
18
+ A machine authored without a slug in the tree language came back with an
19
+ empty `slug`, the UI could not build an href, and the row was dropped from
20
+ the list entirely — a customer saw three of four machines with nothing saying
21
+ so (PWP-993).
22
+
23
+ The query-level `machine(… language: $language)` argument is untouched: it
24
+ still selects the tree. Only the per-node localized fields widen.
25
+
26
+ Affects `machine`, `machines`, `machineCreate` and `machineUpsert`. All four
27
+ keep `$language` — `MediaImageFields.alt(language: $language)` still
28
+ references it — so no operation is left with an unused variable.
29
+
30
+ **Consumers that assumed `name[0]` is the requested language must resolve by
31
+ language instead.** `getLocalizedValue` / `getLanguageString` in core-ui
32
+ already do, so react-ui and vue-ui needed no change.
33
+
34
+ Verified against a tenant whose machines are authored EN-only, where both
35
+ forms return one entry; the multilingual path follows the behaviour recorded
36
+ in PWP-1010(b) and still wants confirming on a multilingual tenant.
37
+
38
+ ### Documentation
39
+
40
+ - **`sum` / `sumNet` on `CartMainItem`, `CartBaseItem` and `TenderMainItem` now
41
+ lead with the warning that they are PER UOM, not line totals**, and point at
42
+ `totalSum` / `totalSumNet`. The description was always accurate but the name
43
+ reads like a line total, so `items.reduce((a, l) => a + l.sum, 0)` looks
44
+ right, compiles green, and returns a number that is wrong by a factor of the
45
+ quantity — a 30-piece line at €15.09 produced €15.09 (PWP-1006).
46
+
7
47
  ## [0.16.0] - 2026-08-04
8
48
 
9
49
  Puts product attributes on the grid. `ProductGridFields` now selects a lean
@@ -17,13 +17,13 @@ fragment SparePartsMachineMinimalFields on SparePartsMachine {
17
17
  media {
18
18
  ...SparePartsMachineMediaImagesOnlyFields
19
19
  }
20
- name(language: \$language) {
20
+ name {
21
21
  ...LocalizedStringFields
22
22
  }
23
- description(language: \$language) {
23
+ description {
24
24
  ...LocalizedStringFields
25
25
  }
26
- slug(language: \$language) {
26
+ slug {
27
27
  ...LocalizedStringFields
28
28
  }
29
29
  }
@@ -17,13 +17,13 @@ fragment SparePartsMachineMinimalFields on SparePartsMachine {
17
17
  media {
18
18
  ...SparePartsMachineMediaImagesOnlyFields
19
19
  }
20
- name(language: \$language) {
20
+ name {
21
21
  ...LocalizedStringFields
22
22
  }
23
- description(language: \$language) {
23
+ description {
24
24
  ...LocalizedStringFields
25
25
  }
26
- slug(language: \$language) {
26
+ slug {
27
27
  ...LocalizedStringFields
28
28
  }
29
29
  }
@@ -17,13 +17,13 @@ fragment SparePartsMachineMinimalFields on SparePartsMachine {
17
17
  media {
18
18
  ...SparePartsMachineMediaImagesOnlyFields
19
19
  }
20
- name(language: \$language) {
20
+ name {
21
21
  ...LocalizedStringFields
22
22
  }
23
- description(language: \$language) {
23
+ description {
24
24
  ...LocalizedStringFields
25
25
  }
26
- slug(language: \$language) {
26
+ slug {
27
27
  ...LocalizedStringFields
28
28
  }
29
29
  }
@@ -29,13 +29,13 @@ fragment SparePartsMachineMinimalFields on SparePartsMachine {
29
29
  media {
30
30
  ...SparePartsMachineMediaImagesOnlyFields
31
31
  }
32
- name(language: \$language) {
32
+ name {
33
33
  ...LocalizedStringFields
34
34
  }
35
- description(language: \$language) {
35
+ description {
36
36
  ...LocalizedStringFields
37
37
  }
38
- slug(language: \$language) {
38
+ slug {
39
39
  ...LocalizedStringFields
40
40
  }
41
41
  }
@@ -24,9 +24,20 @@ export interface CartBaseItem extends ICartBaseItem {
24
24
  totalPrice: number;
25
25
  /** Total net price for this cart item, including item specific discounts. */
26
26
  totalPriceNet: number;
27
- /** Gross sum of the main cart price and the prices of its child items per UOM. No item specific discounts are applied to this price. */
27
+ /**
28
+ * PER UOM, *not* the line total — despite the name. Gross sum of the main
29
+ * price and the prices of its child items, for ONE unit, with no item
30
+ * specific discounts applied.
31
+ *
32
+ * For the line total use {@link totalSum}. Summing `sum` across a cart
33
+ * under-reports every line by a factor of its quantity, and does it silently:
34
+ * the result is a plausible number and the types are green.
35
+ */
28
36
  sum: number;
29
- /** Net sum of the main cart price and the prices of its child items per UOM. No item specific discounts are applied to this price. */
37
+ /**
38
+ * PER UOM, *not* the line total — see {@link sum}. For the line total use
39
+ * {@link totalSumNet}.
40
+ */
30
41
  sumNet: number;
31
42
  /** Total gross sum of the main cart price and the prices of its child items. Including item specific discounts. */
32
43
  totalSum: number;
@@ -32,9 +32,20 @@ export interface CartMainItem extends ICartBaseItem {
32
32
  totalPrice: number;
33
33
  /** Total net price for this cart item, including item specific discounts. */
34
34
  totalPriceNet: number;
35
- /** Gross sum of the main cart price and the prices of its child items per UOM. No item specific discounts are applied to this price. */
35
+ /**
36
+ * PER UOM, *not* the line total — despite the name. Gross sum of the main
37
+ * price and the prices of its child items, for ONE unit, with no item
38
+ * specific discounts applied.
39
+ *
40
+ * For the line total use {@link totalSum}. Summing `sum` across a cart
41
+ * under-reports every line by a factor of its quantity, and does it silently:
42
+ * the result is a plausible number and the types are green.
43
+ */
36
44
  sum: number;
37
- /** Net sum of the main cart price and the prices of its child items per UOM. No item specific discounts are applied to this price. */
45
+ /**
46
+ * PER UOM, *not* the line total — see {@link sum}. For the line total use
47
+ * {@link totalSumNet}.
48
+ */
38
49
  sumNet: number;
39
50
  /** Total gross sum of the main cart price and the prices of its child items. Including item specific discounts. */
40
51
  totalSum: number;
@@ -75,9 +75,20 @@ export interface TenderMainItem extends ITenderBaseItem {
75
75
  surcharges?: TenderItemSurcharge[];
76
76
  /** The tender/order item's child items. E.g. surcharges, incentives, etc. */
77
77
  childItems?: ITenderBaseItem[];
78
- /** The gross price per UOM of this tender/order item, with item specific incentives and extra costs applied to this price. VAT excluding */
78
+ /**
79
+ * PER UOM, *not* the line total — despite the name. The gross price for ONE
80
+ * unit of this tender/order item, with item specific incentives and extra
81
+ * costs applied. VAT EXCLUDING (this API labels the ex-VAT figure "gross").
82
+ *
83
+ * For the line total use {@link totalSum}. Summing `sum` across the items
84
+ * under-reports every line by a factor of its quantity, and does it silently:
85
+ * the result is a plausible number and the types are green (PWP-1006).
86
+ */
79
87
  sum: number;
80
- /** The price per UOM of this tender/order item, with item specific incentives and extra costs applied to this price. VAT including */
88
+ /**
89
+ * PER UOM, *not* the line total — see {@link sum}. VAT INCLUDING. For the
90
+ * line total use {@link totalSumNet}.
91
+ */
81
92
  sumNet: number;
82
93
  /** The total gross price of this tender/order item, with item specific incentives and extra costs applied to this price. VAT excluding */
83
94
  totalSum: number;
@@ -14,13 +14,13 @@ fragment SparePartsMachineMinimalFields on SparePartsMachine {
14
14
  media {
15
15
  ...SparePartsMachineMediaImagesOnlyFields
16
16
  }
17
- name(language: \$language) {
17
+ name {
18
18
  ...LocalizedStringFields
19
19
  }
20
- description(language: \$language) {
20
+ description {
21
21
  ...LocalizedStringFields
22
22
  }
23
- slug(language: \$language) {
23
+ slug {
24
24
  ...LocalizedStringFields
25
25
  }
26
26
  }
@@ -14,13 +14,13 @@ fragment SparePartsMachineMinimalFields on SparePartsMachine {
14
14
  media {
15
15
  ...SparePartsMachineMediaImagesOnlyFields
16
16
  }
17
- name(language: \$language) {
17
+ name {
18
18
  ...LocalizedStringFields
19
19
  }
20
- description(language: \$language) {
20
+ description {
21
21
  ...LocalizedStringFields
22
22
  }
23
- slug(language: \$language) {
23
+ slug {
24
24
  ...LocalizedStringFields
25
25
  }
26
26
  }
@@ -14,13 +14,13 @@ fragment SparePartsMachineMinimalFields on SparePartsMachine {
14
14
  media {
15
15
  ...SparePartsMachineMediaImagesOnlyFields
16
16
  }
17
- name(language: \$language) {
17
+ name {
18
18
  ...LocalizedStringFields
19
19
  }
20
- description(language: \$language) {
20
+ description {
21
21
  ...LocalizedStringFields
22
22
  }
23
- slug(language: \$language) {
23
+ slug {
24
24
  ...LocalizedStringFields
25
25
  }
26
26
  }
@@ -26,13 +26,13 @@ fragment SparePartsMachineMinimalFields on SparePartsMachine {
26
26
  media {
27
27
  ...SparePartsMachineMediaImagesOnlyFields
28
28
  }
29
- name(language: \$language) {
29
+ name {
30
30
  ...LocalizedStringFields
31
31
  }
32
- description(language: \$language) {
32
+ description {
33
33
  ...LocalizedStringFields
34
34
  }
35
- slug(language: \$language) {
35
+ slug {
36
36
  ...LocalizedStringFields
37
37
  }
38
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@propeller-commerce/propeller-sdk-v2",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "description": "TypeScript GraphQL client for Propeller eCommerce V2 Platform - works with React, Vue, Angular and all JavaScript frameworks",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",